You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ Error: Failed to launch chrome!
/tmp/chromium: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
at onClose (/node_modules/puppeteer-core/lib/Launcher.js:348:14)
at Interface.helper.addEventListener (/node_modules/puppeteer-core/lib/Launcher.js:337:50)
at Interface.emit (events.js:203:15)
at Interface.EventEmitter.emit (domain.js:448:20)
at Interface.close (readline.js:397:8)
at Socket.onend (readline.js:173:10)
at Socket.emit (events.js:203:15)
at Socket.EventEmitter.emit (domain.js:448:20)
at endReadableNT (_stream_readable.js:1143:12)
at process._tickCallback (internal/process/next_tick.js:63:19),
Steps to Reproduce
While submitting the job I use the below environment:
I also tried to add below in the environment but same error: { name: 'FONTCONFIG_PATH', value: undefined }, { name: 'LD_LIBRARY_PATH', value: '/var/lang/lib:/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib' }
layer + lambda both have runtime nodejs12.x
The text was updated successfully, but these errors were encountered:
@alixaxel I used chrome-aws-lambda package to generate the PDFs at AWS lambda and it was working fine but now I need to generate a large number of PDFs so moved the same code to AWS Batch and changed the starting point as it was a handler function when I was running lambda.
Code is exactly the same but giving errors: browser = await chromium.puppeteer.launch({ args: chromium.args, defaultViewport: chromium.defaultViewport, executablePath: await chromium.executablePath, headless: chromium.headless }); const page = await browser.newPage();
For interoperation, I think AWS Batch interoperate with AWS lambda because while submitting a job If I remove the following environment variables containerOverrides: { environment: [ { name: 'AWS_LAMBDA_FUNCTION_NAME', value: 'Lambda_Function_Name' }, { name: 'AWS_EXECUTION_ENV', value: 'AWS_Lambda_nodejs12.x' } ] }
It gives an error "chromium revision is not downloaded" or if I added this environment variables it gives me libnss3.so error.
@alixaxel I have fixed the issue by using the puppeteer library. I just run the below command: apt-get update \ # Install latest chrome dev package, which installs the necessary libs to # make the bundled version of Chromium that Puppeteer installs work. && apt-get install -y wget --no-install-recommends \ && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ && apt-get update \ && apt-get install -y google-chrome-unstable --no-install-recommends \ && rm -rf /var/lib/apt/lists/* \ && wget --quiet https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -O /usr/sbin/wait-for-it.sh \ && chmod +x /usr/sbin/wait-for-it.sh
I'm closing the bug.
Thanks, this is a great NPM module to run the puppeteer at AWS lambda.
Cheers!!!
Environment
chrome-aws-lambda
Version: 2.0.2puppeteer
/puppeteer-core
Version: 1.20.0Expected Behavior
It should work.
Current Behavior
Steps to Reproduce
While submitting the job I use the below environment:
containerOverrides: { environment: [ { name: 'AWS_LAMBDA_FUNCTION_NAME', value: 'Lambda_Function_Name' }, { name: 'AWS_EXECUTION_ENV', value: 'AWS_Lambda_nodejs12.x' } ] }
I also tried to add below in the environment but same error:
{ name: 'FONTCONFIG_PATH', value: undefined }, { name: 'LD_LIBRARY_PATH', value: '/var/lang/lib:/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib' }
layer + lambda both have runtime nodejs12.x
The text was updated successfully, but these errors were encountered: