Error: Unable to start Chrome
ariel-frischer opened this issue · 6 comments
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)"
]
}
+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)"]}
+1 here, same behaviour
Anyone does know how to fix this?
+1 here, same problem and no additional log info.
No apparent Fix.
Anyone fixed it?
+1 here too, I'm getting a message
libnss3.so: cannot open shared object file
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.
Instead of fixing this, we can just use native chromium with certain conditions, JFYI.
https://github.com/umihico/docker-selenium-lambda/