-
Notifications
You must be signed in to change notification settings - Fork 253
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: Failed to launch the browser process! #730
Comments
Are you running Ubuntu 24.04 and If so, you'd either need to add the You can do this by creating a {
"args": ["--no-sandbox"]
} Then running As an example, you can see how the official There's also some alternative steps which are recommended by the Puppeteer team at https://pptr.dev/troubleshooting#setting-up-chrome-linux-sandbox, but I haven't tested them yet. |
No. This issue does not concern Docker. |
I recently updated to Ubuntu 24.04 and encountered the same issue! It looks like Ubuntu 24.04 contains some AppArmor 4 rules that block Puppeteer's sandbox from working properly: puppeteer/puppeteer#12818 (comment) The easiest thing to do is probably just to prepend all calls to E.g., if you normally use Other options would be to:
|
Problem: - Ubuntu 23.10 and later has security rules around running chrome, which means mermaid-cli can't generate diagrams without a workaround. - See mermaid-js/mermaid-cli#730 Solution: - Provide a puppeteer_config.json file in the docs directory which can be passed to mmdc by specifying an attribute in AsciiDoctor markdown. - See https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/mermaid/
Problem: - Ubuntu 23.10 and later has security rules around running chrome, which means mermaid-cli can't generate diagrams without a workaround. - See mermaid-js/mermaid-cli#730 Solution: - Provide a puppeteer_config.json file in the docs directory which can be passed to mmdc by specifying an attribute in AsciiDoctor markdown. - See https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/mermaid/
Problem: - Ubuntu 23.10 and later has security rules around running chrome, which means mermaid-cli can't generate diagrams without a workaround. - See mermaid-js/mermaid-cli#730 Solution: - Provide a puppeteer_config.json file in the docs directory which can be passed to mmdc by specifying an attribute in AsciiDoctor markdown. - See https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/mermaid/
Problem: - Ubuntu 23.10 and later has security rules around running chrome, which means mermaid-cli can't generate diagrams without a workaround. - See mermaid-js/mermaid-cli#730 Solution: - Provide a puppeteer_config.json file in the docs directory which can be passed to mmdc by specifying an attribute in AsciiDoctor markdown. - See https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/mermaid/
Problem: - Ubuntu 23.10 and later has security rules around running chrome, which means mermaid-cli can't generate diagrams without a workaround. - See mermaid-js/mermaid-cli#730 Solution: - Provide a puppeteer_config.json file in the docs directory which can be passed to mmdc by specifying an attribute in AsciiDoctor markdown. - See https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/mermaid/
Problem: - Ubuntu 23.10 and later has security rules around running chrome, which means mermaid-cli can't generate diagrams without a workaround. - See mermaid-js/mermaid-cli#730 Solution: - Provide a puppeteer_config.json file in the docs directory which can be passed to mmdc by specifying an attribute in AsciiDoctor markdown. - See https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/mermaid/
Problem: - Ubuntu 23.10 and later has security rules around running chrome, which means mermaid-cli can't generate diagrams without a workaround. - See mermaid-js/mermaid-cli#730 Solution: - Provide a puppeteer_config.json file in the docs directory which can be passed to mmdc by specifying an attribute in AsciiDoctor markdown. - See https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/mermaid/
Problem: - Ubuntu 23.10 and later has security rules around running chrome, which means mermaid-cli can't generate diagrams without a workaround. - See mermaid-js/mermaid-cli#730 Solution: - Provide a puppeteer_config.json file in the docs directory which can be passed to mmdc by specifying an attribute in AsciiDoctor markdown. - See https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/mermaid/
Problem: - Ubuntu 23.10 and later has security rules around running chrome, which means mermaid-cli can't generate diagrams without a workaround. - See mermaid-js/mermaid-cli#730 Solution: - Provide a puppeteer_config.json file in the docs directory which can be passed to mmdc by specifying an attribute in AsciiDoctor markdown. - See https://docs.asciidoctor.org/diagram-extension/latest/diagram_types/mermaid/
Ubuntu 24.04 has stricter AppArmor policies that prevent Puppeteer from running, with an error like: > Failed to launch the browser process! > [0109/235031.343250:FATAL:zygote_host_impl_linux.cc(128)] No usable sandbox! If you are running on Ubuntu 23.10+ or another Linux distro that has disabled unprivileged user namespaces with AppArmor, see https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md. Otherwise see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the (older) SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox. We can use [`aa-exec`][1] to explicitly set the `chrome` policy and get it working again. [1]: https://manpages.ubuntu.com/manpages/noble/man1/aa-exec.1.html See: mermaid-js#730 (comment)
Ubuntu 24.04 has stricter AppArmor policies that prevent Puppeteer from running, with an error like: > Failed to launch the browser process! > [0109/235031.343250:FATAL:zygote_host_impl_linux.cc(128)] No usable sandbox! If you are running on Ubuntu 23.10+ or another Linux distro that has disabled unprivileged user namespaces with AppArmor, see https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md. Otherwise see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the (older) SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox. We can use [`aa-exec`][1] to explicitly set the `chrome` policy and get it working again. [1]: https://manpages.ubuntu.com/manpages/noble/man1/aa-exec.1.html See: mermaid-js#730 (comment)
Had the same issue after upgrading to 24.04. I did not want to poke any holes into system security globally, so opted to patch just the puppeteer call from mermaid-cli. Go into let puppeteerConfig = ({
headless: 1,
args: ['--no-sandbox']
}) That worked for me. I am using mermaid through the pandoc mermaid-filter module in version 1.4.7. If you are on the same version, and run a unix/linux flavor, you can use this patch to achieve the same result: 176c176,177
< headless: 1
---
> headless: 1,
> args: ['--no-sandbox'] Put this into a file patch index.js sandbox_workaround.patch |
Describe the bug
mmdc fails with the error message: "Error: Failed to launch the browser process!"
To Reproduce
Expected behavior
Expected mmdc to generate an image and exit without error messages.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: