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

Error: Unable to start Chrome #294

Open
ariel-frischer opened this issue Mar 5, 2021 · 6 comments
Open

Error: Unable to start Chrome #294

ariel-frischer opened this issue Mar 5, 2021 · 6 comments

Comments

@ariel-frischer
Copy link

In AWS lambda I get this message. I can add the DEBUG variable soon to get more information.

{
  "errorType": "Error",
  "errorMessage": "Unable to start Chrome. If you have the DEBUG env variable set,there will be more in the logs.",
  "trace": [
    "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 processTicksAndRejections (internal/process/task_queues.js:97:5)"
  ]
}
@orr3
Copy link

orr3 commented Mar 22, 2021

+1 Same here.

Trying to install and deploy the exempel https://github.com/adieuadieu/serverless-chrome/tree/master/examples/serverless-framework/aws.
Only change made was a downgrade of serverless-plugin-chrome from "1.0.0-69" to "1.0.0-55.3" because the source was not found.

After deployment the pdf function throws Error 500, and here are the logs with DEBUG variable.

2021-03-22 13:59:23.409 (+01:00)	c635fd57-275d-4cf3-84ef-d17f78f6239f	INFO	@serverless-chrome/lambda: Waiting for Chrome 1
2021-03-22 13:59:23.911 (+01:00)	c635fd57-275d-4cf3-84ef-d17f78f6239f	INFO	@serverless-chrome/lambda: Waiting for Chrome 2
2021-03-22 13:59:24.414 (+01:00)	c635fd57-275d-4cf3-84ef-d17f78f6239f	INFO	@serverless-chrome/lambda: Waiting for Chrome 3
2021-03-22 13:59:24.916 (+01:00)	c635fd57-275d-4cf3-84ef-d17f78f6239f	INFO	@serverless-chrome/lambda: Waiting for Chrome 4
2021-03-22 13:59:25.417 (+01:00)	c635fd57-275d-4cf3-84ef-d17f78f6239f	INFO	@serverless-chrome/lambda: Waiting for Chrome 5
2021-03-22 13:59:25.919 (+01:00)	c635fd57-275d-4cf3-84ef-d17f78f6239f	INFO	@serverless-chrome/lambda: Waiting for Chrome 6
2021-03-22 13:59:26.420 (+01:00)	c635fd57-275d-4cf3-84ef-d17f78f6239f	INFO	@serverless-chrome/lambda: Waiting for Chrome 7
2021-03-22 13:59:26.921 (+01:00)	c635fd57-275d-4cf3-84ef-d17f78f6239f	INFO	@serverless-chrome/lambda: Waiting for Chrome 8
2021-03-22 13:59:27.423 (+01:00)	c635fd57-275d-4cf3-84ef-d17f78f6239f	INFO	@serverless-chrome/lambda: Waiting for Chrome 9
2021-03-22 13:59:27.924 (+01:00)	c635fd57-275d-4cf3-84ef-d17f78f6239f	INFO	@serverless-chrome/lambda: Waiting for Chrome 10
2021-03-22 13:59:27.927 (+01:00)	c635fd57-275d-4cf3-84ef-d17f78f6239f	INFO	@serverless-chrome/lambda: Error trying to spawn chrome: Error: connect ECONNREFUSED 127.0.0.1:9222
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16) {
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 9222
}
2021-03-22 13:59:27.927 (+01:00)	c635fd57-275d-4cf3-84ef-d17f78f6239f	INFO	@serverless-chrome/lambda: stdout log: 
2021-03-22 13:59:27.928 (+01:00)	c635fd57-275d-4cf3-84ef-d17f78f6239f	INFO	@serverless-chrome/lambda: stderr log: /var/task/headless-chromium: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

2021-03-22 13:59:27.929 (+01:00)	c635fd57-275d-4cf3-84ef-d17f78f6239f	ERROR	Error occured in serverless-plugin-chrome wrapper when trying to ensure Chrome for default() handler. {
  chromePath: '/var/task/headless-chromium',
  flags: [ '--window-size=1280,1696', '--hide-scrollbars' ]
} Error: Unable to start Chrome. If you have the DEBUG env variable set,there will be more in the logs.
    at /var/task/src/handlers/pdf.js:3415:13
    at Generator.throw (<anonymous>)
    at step (/var/task/src/handlers/pdf.js:3350:193)
    at /var/task/src/handlers/pdf.js:3350:404
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
2021-03-22 13:59:27.929 (+01:00)	c635fd57-275d-4cf3-84ef-d17f78f6239f	ERROR	Invoke Error 	{"errorType":"Error","errorMessage":"Unable to start Chrome. If you have the DEBUG env variable set,there will be more in the logs.","stack":["Error: Unable to start Chrome. If you have the DEBUG env variable set,there will be more in the logs.","    at /var/task/src/handlers/pdf.js:3415:13","    at Generator.throw (<anonymous>)","    at step (/var/task/src/handlers/pdf.js:3350:193)","    at /var/task/src/handlers/pdf.js:3350:404","    at processTicksAndRejections (internal/process/task_queues.js:97:5)"]}

@ozeron
Copy link

ozeron commented Apr 16, 2021

+1 here, same behaviour
Anyone does know how to fix this?

@rsboni
Copy link

rsboni commented May 7, 2021

+1 here, same problem and no additional log info.
No apparent Fix.
Anyone fixed it?

@nealshail
Copy link

nealshail commented Jun 2, 2021

+1 here too, I'm getting a message

libnss3.so: cannot open shared object file

@ghost
Copy link

ghost commented Nov 5, 2021

I've pre-compiled Lambda layers for various stable Chromium versions that work on AWS Lambda (they include the .so file mentioned above). They are available for download here.

@umihico
Copy link

umihico commented Jan 2, 2022

Instead of fixing this, we can just use native chromium with certain conditions, JFYI.
https://github.com/umihico/docker-selenium-lambda/

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

6 participants