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

Unable to start Chrome in NodeJS10.x #203

Closed
wvanvugt-speedline opened this issue May 15, 2019 · 19 comments
Closed

Unable to start Chrome in NodeJS10.x #203

wvanvugt-speedline opened this issue May 15, 2019 · 19 comments

Comments

@wvanvugt-speedline
Copy link

I an running into the error "Unable to start Chrome" when running on Lambda with NodeJS10. Seems the system fails to due to this error: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory.

With the update to NodeJS10, Amazon included an update to "Amazon Linux 2", which is likely the cause of this issue.

AWS Lambda NodeJS10 article: https://aws.amazon.com/about-aws/whats-new/2019/05/aws_lambda_adds_support_for_node_js_v10/

In case it helps, here are my full logs:

Wed, 15 May 2019 21:42:12 GMT i18n:warn Failed to install `intl` polyfill
START RequestId: 8813c5b1-1c60-4c06-94f6-8e64f983bfe0 Version: $LATEST
2019-05-15T21:42:13.155Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: Spawning headless shell
2019-05-15T21:42:13.174Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: ChromeLauncher No debugging port found on port 9222, launching a new Chrome.
2019-05-15T21:42:13.192Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: Launcher Chrome running with pid 19 on port 9222.
2019-05-15T21:42:13.192Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: Waiting for Chrome 0
2019-05-15T21:42:13.694Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: Waiting for Chrome 1
2019-05-15T21:42:14.196Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: Waiting for Chrome 2
2019-05-15T21:42:14.697Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: Waiting for Chrome 3
2019-05-15T21:42:15.199Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: Waiting for Chrome 4
2019-05-15T21:42:15.700Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: Waiting for Chrome 5
2019-05-15T21:42:16.201Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: Waiting for Chrome 6
2019-05-15T21:42:16.703Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: Waiting for Chrome 7
2019-05-15T21:42:17.204Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: Waiting for Chrome 8
2019-05-15T21:42:17.706Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: Waiting for Chrome 9
2019-05-15T21:42:18.207Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: Waiting for Chrome 10
2019-05-15T21:42:18.208Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: Error trying to spawn chrome: { Error: connect ECONNREFUSED 127.0.0.1:9222 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1097:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 9222 }
2019-05-15T21:42:18.208Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: stdout log:
2019-05-15T21:42:18.209Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	INFO	@serverless-chrome/lambda: stderr log: /var/task/node_modules/@serverless-chrome/lambda/dist/headless-chromium: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
2019-05-15T21:42:18.209Z	8813c5b1-1c60-4c06-94f6-8e64f983bfe0	ERROR	Error: Unable to start Chrome. If you have the DEBUG env variable set,there will be more in the logs. at /var/task/node_modules/@serverless-chrome/lambda/dist/bundle.cjs.js:376:13
at Generator.throw (<anonymous>)
at step (/var/task/node_modules/@serverless-chrome/lambda/dist/bundle.cjs.js:311:193)
at /var/task/node_modules/@serverless-chrome/lambda/dist/bundle.cjs.js:311:404
at propagateAslWrapper (/var/task/node_modules/async-listener/index.js:504:23)
at /var/task/node_modules/async-listener/glue.js:188:31
at /var/task/node_modules/async-listener/index.js:541:70
at /var/task/node_modules/async-listener/glue.js:188:31
at process._tickCallback (internal/process/next_tick.js:68:7)
END RequestId: 8813c5b1-1c60-4c06-94f6-8e64f983bfe0
REPORT RequestId: 8813c5b1-1c60-4c06-94f6-8e64f983bfe0	Duration: 5219.77 ms	Billed Duration: 5300 ms Memory Size: 1536 MB	Max Memory Used: 114 MB	
@scamden
Copy link

scamden commented May 17, 2019

also would love to see a working amazon linux 2 build! @adieuadieu

would be greatly in your debt if you could release binaries for amazon linux 2 along side the others!

@AshesOfOwls
Copy link

Also getting this.

@alixaxel
Copy link

I did quite some investigation around this, see alixaxel/chrome-aws-lambda#37

Seems like the only sensible approach is to have an additional Lambda Layer for needed dependencies.

@erdahuja
Copy link
Contributor

Same. please help.

@alixaxel
Copy link

@erdahuja I've recently published a new version of my package that is compatible with Node 10.

It doesn't need a layer, and there are some issues explaining how to run it with serverless.

@erdahuja
Copy link
Contributor

What's the version number exactly? I guess i might have tried with latest one only (4 days) ago. I am facing a deadlock of compatibility between chrome binary, puppeteer, serverless and aws lambda. No combination/approach seems to work! and aws rejecting to build the working function on node6x

@alixaxel
Copy link

alixaxel commented Oct 28, 2019

@erdahuja 2.0.0 - I don't provide support for serverless configurations, but perhaps this helps.

Also, you should use Node 10 - Node 6 and 8 have been or will be discontinued by AWS.

@erdahuja
Copy link
Contributor

I tried, node 10x, it gets worse. My project is now halted, unable to create new builds.

Also, i tried by fixing the https://github.com/adieuadieu/serverless-chrome/pull/200/files

#92, Finally this issue prevails

{socket hang up}

@bjesus
Copy link

bjesus commented Jan 26, 2020

I'm experiencing this issue with the latest 1.0.0-55.2 version with Node 12 too. How is everyone working around this?

@bryan-d
Copy link

bryan-d commented Feb 3, 2020

I am also running into this issue, v1.0.0-55.3. Anyone able to give us some direction here?

@jamesopti
Copy link

Does this currently work with Node8? I'm trying to get a real basic example working with Serverless & Puppeteer, but I keep hitting this issue.

@elie222
Copy link

elie222 commented Feb 3, 2020

It works with node v8 locally at least. For v12 I get this error:

The "serverless-plugin-chrome" plugin only supports the Node.js 6.10 or 8.10 runtimes

But when I run serverless deploy with v8.10 I get an error that lambdas no longer support Node v8.

UPDATE: Sorry, I was using v12.7 and it should be v12.x.

@jamesopti - Lambda no longer supports v8:

An error occurred: HelloLambdaFunction - The runtime parameter of nodejs8.10 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs12.x) while creating or updating functions. (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException;

@jamesopti
Copy link

@jamesopti - Lambda no longer supports v8:

Yikes - That's a bummer.

Whats the last known good version of this plugin that I can deploy with Node v10? Or does that not exist?

@jamesopti
Copy link

@elie222 - I found this and it worked perfectly right out of the box - https://github.com/alixaxel/chrome-aws-lambda

@link365dev
Copy link

Any "actual" solution for this?

@godrose
Copy link

godrose commented Sep 14, 2020

Yes. This would be very nice to actually see the steps in format 1,2,3,4

@StephenLover
Copy link

StephenLover commented Sep 16, 2020

I am experiencing this issue as well:"Error: Unable to start Chrome", any solution for this? @adieuadieu

@dtuyenle
Copy link

Why closing this without any solution ?

@ehsankhfr
Copy link

This is so pointless that the issue has got closed before getting resolved

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

No branches or pull requests