Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the new PHP file working? #10

Open
san-kumar opened this issue Dec 25, 2017 · 3 comments
Open

Is the new PHP file working? #10

san-kumar opened this issue Dec 25, 2017 · 3 comments

Comments

@san-kumar
Copy link

san-kumar commented Dec 25, 2017

I'm trying to deploy with the latest version and I'm getting this error

Serverless: Invoke invoke
{
    "errorMessage": "Process error code 1: ",
    "errorType": "Error",
    "stackTrace": [
        "ChildProcess.<anonymous> (/var/task/handler.js:47:23)",
        "emitTwo (events.js:106:13)",
        "ChildProcess.emit (events.js:191:7)",
        "maybeClose (internal/child_process.js:886:16)",
        "Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)"
    ]
}

  Error --------------------------------------------------

  Invoked function failed

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Stack Trace --------------------------------------------

This is a fresh install (no modifications).

Anybody else facing this problem with the latest version? Is this because of the new PHP file (earlier it was working fine).

@araines
Copy link
Owner

araines commented Dec 26, 2017

Hi @san-kumar
I've just rerun through the steps in the README and its working fine, although there is one more step you need to do to get it working, which #3 was opened to attempt to address (albeit not very clearly!)

For one reason or another, serverless install doesn't seem to play nice with git lfs and as such the PHP binary doesn't actually download properly. To work around this, after doing serverless install you need to rebuild the PHP binary:

sh buildphp.sh

This does need docker installed, though.

Another option is to clone the repository directly from GitHub instead of using serverless. As long as you have git lfs installed it will download the PHP binary properly.

The final option is to use a combination of the two - use serverless install as directed and then simply download the PHP binary from GitHub.

I'll get on with addressing #3 to avoid others suffering with similar problems in the future!

If the above doesn't work, please provide a little more information on the steps you've run and I'll try to help debug.

@san-kumar
Copy link
Author

Hi Andy,

Thanks for the reply. I'm using Windows 10 so maybe that is causing the problem. I did everythinga as per the readme and then downloaded the php binary directly from github. It still won't work. Anyway, here are the steps I did:

C:\tmp\2\>serverless install --url https://github.com/araines/serverless-php

C:\tmp\2\serverless-php>wget -O php https://media.githubusercontent.com/media/araines/serverless-php/master/php

C:\tmp\2\serverless-php>sls deploy

C:\tmp\2\serverless-php>serverless invoke -f hello
{
    "errorMessage": "RequestId: 55e45e30-eafb-11e7-b724-b19b0d130fcb Process exited before completing request"
}

  Error --------------------------------------------------

  Invoked function failed

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Forums:        forum.serverless.com
     Chat:          gitter.im/serverless/serverless

  Your Environment Information -----------------------------
     OS:                     win32
     Node Version:           8.9.1
     Serverless Version:     1.25.0

Attached is the Cloudwatch log (if it is of any help)
cloudwatch-log.txt

@araines
Copy link
Owner

araines commented Dec 27, 2017

Oh thats really interesting - I'm a little surprised you're having problems on the Lambda environment itself - thats the bit which I'd expect to be unaffected by your local operating system!

However, I'm wondering if its do to with executable flags on the PHP binary. Looking at the Cloudwatch logs, it looks like spawn EACCES is the error being thrown - which I believe is thrown when its not able to execute a binary.

I'm afraid I'm not anything close to a Windows expert - for macOS/linux I'd do something like this to the PHP binary before doing sls deploy again:

chmod a+x php

I wonder if there is some form of equivalent for Windows?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants