question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to start Chrome in NodeJS10.x

See original GitHub issue

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	

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:19 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
dtuyenlecommented, Oct 25, 2020

Why closing this without any solution ?

9reactions
bjesuscommented, 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?

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS Lambda Node.js 10.x Runtime error with selenium ...
One of the reasons Chrome fails to run on Lambda is the lack of fonts. https://forums.aws.amazon.com/thread.jspa?
Read more >
Troubleshooting - Puppeteer
Chrome is downloaded but fails to launch on Node.js 14​. If you get an error that looks like ... User namespace cloning is...
Read more >
Fix Chrome if it crashes or won't open - Computer
First: Try these common Chrome crash fixes ... Your computer may have run out of memory, and can't load the site while also...
Read more >
Runtime versions using Node.js and Puppeteer
Each run of a canary times out after a configured timeout value. ... Customize the Google Chrome launch parameters You can now configure...
Read more >
Migration Guide | Cypress Documentation
However, in Cypress 12, this test fails because the alias is always ... In 9.x and earlier versions, cypress open would bring you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found