sambaiz / puppeteer-lambda-starter-kit

Starter Kit for running Headless-Chrome by Puppeteer on AWS Lambda.
MIT License
580 stars 82 forks source link

New version doesn't run on Lambda, failed to launch chrome #18

Open martsie opened 6 years ago

martsie commented 6 years ago

I'm getting the error (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Failed to launch chrome!

Any tips on how to debug?

Version 1.1

hkhan-lumatax commented 6 years ago

Same issue here. Any ideas as how to fix this?

martsie commented 6 years ago

I ended up reverting to the old version of this branch which works fine (0.9.4) - head over to https://github.com/sambaiz/puppeteer-lambda-starter-kit/releases to grab it.

hkhan-lumatax commented 6 years ago

@martsie, @sambaiz

I am facing sort of the same problem with 0.9.4.

Please see the logs below:

Function Logs: START RequestId: b1211c46-22cc-11e8-b5ff-7de72148aa02 Version: $LATEST 2018-03-08T12:31:58.270Z b1211c46-22cc-11e8-b5ff-7de72148aa02 setup s3 chrome 2018-03-08T12:31:58.391Z b1211c46-22cc-11e8-b5ff-7de72148aa02 setup done 2018-03-08T12:31:58.431Z b1211c46-22cc-11e8-b5ff-7de72148aa02 Error: spawn /tmp/headless_shell ENOENT at exports._errnoException (util.js:1018:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32) at onErrorNT (internal/child_process.js:367:16) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickDomainCallback (internal/process/next_tick.js:128:9) END RequestId: b1211c46-22cc-11e8-b5ff-7de72148aa02 REPORT RequestId: b1211c46-22cc-11e8-b5ff-7de72148aa02 Duration: 215.39 ms Billed Duration: 300 ms Memory Size: 512 MB Max Memory Used: 41 MB
RequestId: b1211c46-22cc-11e8-b5ff-7de72148aa02 Process exited before completing request

I have uploaded the following files to my S3 bucket:

S3 Files

One thing I noticed is that the function setupS3Chrome executes very quickly and seems that the download and extraction of headless_shell.tar.gz doesn't happen. Also, checking the file size of /tmp/headless_shell results in an error which means that something is wrong here.