puppeteer icon indicating copy to clipboard operation
puppeteer copied to clipboard

[Bug]: Failed to launch the browser process!

Open pankhiprasher opened this issue 2 years ago • 5 comments

Bug description

Steps to reproduce the problem: I am having difficulty running puppeteer functions . I keep getting this error - (node:13460) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process! /node_modules/puppeteer/.local-chromium/linux-970485/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

at onClose (/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:237:20) at Interface.helper_js_1.helper.addEventListener (/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:227:68) at Interface.emit (events.js:203:15) at Interface.close (readline.js:397:8) at Socket.onend (readline.js:173:10) at Socket.emit (events.js:203:15) at endReadableNT (_stream_readable.js:1145:12) at process._tickCallback (internal/process/next_tick.js:63:19) (node:13460) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:13460) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I have tried installing all dependencies and all 1000 resolutions to disable sandbox and what not but no luck , i will be really glad if you can help me out with this error resolution.

Puppeteer version

13.5.1

Node.js version

17.0.0

npm version

6.14.4

What operating system are you seeing the problem on?

Linux, Windows

Relevant log output

node:13460) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
/node_modules/puppeteer/.local-chromium/linux-970485/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

at onClose (/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:237:20)
at Interface.helper_js_1.helper.addEventListener (/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:227:68)
at Interface.emit (events.js:203:15)
at Interface.close (readline.js:397:8)
at Socket.onend (readline.js:173:10)
at Socket.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:13460) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:13460) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

pankhiprasher avatar Mar 15 '22 22:03 pankhiprasher

We encounter this issue aswell, while using mermaid-cli version ^8.13.5

Stacktrace:

/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:237
            reject(new Error([
                   ^

Error: Failed to launch the browser process!
/azp/_work/1/s/APIs/node_modules/puppeteer/.local-chromium/linux-970485/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (/azp/_work/1/s/APIs/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:237:20)
    at Interface.<anonymous> (/azp/_work/1/s/APIs/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:227:68)
    at Interface.emit (node:events:538:35)
    at Interface.close (node:readline:586:8)
    at Socket.onend (node:readline:277:10)
    at Socket.emit (node:events:538:35)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

TobiTh avatar Mar 16 '22 16:03 TobiTh

/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:237 reject(new Error([

        Getting this anyone any luck so far ?

utills avatar Apr 03 '22 16:04 utills

We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.

stale[bot] avatar Jun 23 '22 11:06 stale[bot]

even i'm too facing the same error in Heroku image

codeterrayt avatar Jun 28 '22 06:06 codeterrayt

Same here on Netlify. It was working fine a couple of weeks ago.

ramrami avatar Aug 04 '22 14:08 ramrami

Facing this issue too on Node 16 too using Puppeteer 16.1.0

samdharris avatar Aug 15 '22 10:08 samdharris

Can't run my app in digital ocean "apps" because of this issue.

Apezdr avatar Aug 20 '22 05:08 Apezdr

This issue indicates that your OS is missing the required dependencies for the Chromium binary. Please follow the troubleshooting.md guide linked in the error message to see which dependencies are missing.

OrKoN avatar Aug 22 '22 15:08 OrKoN

Also please use our new Docker image that comes with the dependencies pre-installed https://github.com/puppeteer/puppeteer/pkgs/container/puppeteer

OrKoN avatar Aug 22 '22 15:08 OrKoN

Hi @OrKoN unfortunately this would not work for me in my case as my Node image is provided by AWS Lambda. What would you advise in this situation?

samdharris avatar Aug 22 '22 15:08 samdharris

@samdharris there are projects like chrome-aws-lambda that try to bundle all dependencies for AWS Lambda. In a nutshell, they built a custom chromium binary statically linking all dependencies https://github.com/alixaxel/chrome-aws-lambda/tree/master/_/ansible

OrKoN avatar Aug 23 '22 07:08 OrKoN

same issue when using OS (local)

chiderlin avatar Oct 17 '22 03:10 chiderlin

I have the same problem on Digital Ocean Apps, trying to fix it.

Any solution?

2023-03-13T19:07:22.571255562Z /workspace/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:241
2023-03-13T19:07:22.571287294Z             reject(new Error([
2023-03-13T19:07:22.571295988Z                    ^
2023-03-13T19:07:22.571301598Z 
2023-03-13T19:07:22.571307148Z Error: Failed to launch the browser process!
2023-03-13T19:07:22.571313908Z /workspace/node_modules/whatsapp-web.js/node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
2023-03-13T19:07:22.571320003Z 
2023-03-13T19:07:22.571324374Z 
2023-03-13T19:07:22.571329591Z TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
2023-03-13T19:07:22.571334192Z 
2023-03-13T19:07:22.571339065Z     at onClose (/workspace/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:241:20)
2023-03-13T19:07:22.571349144Z     at ChildProcess.<anonymous> (/workspace/node_modules/whatsapp-web.js/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:232:79)
2023-03-13T19:07:22.571362012Z     at ChildProcess.emit (node:events:525:35)
2023-03-13T19:07:22.571368445Z     at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)

reinaldomml avatar Mar 13 '23 19:03 reinaldomml