-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Puppeter cannot start on CentOS 7 #2857
Comments
@apichery thank you for the well written report.
I don't know much about sandboxing, but this looks like a hack to me. I wonder if it just pretends to work rather then working as intended. Do you mind asking on chromium-dev regarding this approach? |
@apichery maybe you can try const browser = await puppeteer.launch({ |
yum install pango libXcomposite libXcursor libXdamage libXext libXi libXtst cups-libs libXScrnSaver libXrandr GConf2 alsa-lib atk gtk3 ipa-gothic-fonts xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc |
The problem with this kind of fix is when the user cannot use sudo... There has to be another way than giving the file to root?! |
@Salketer If user cannot sudo and the other sandboxing options are not available, there is no way to install a sandbox. So you are left with calling pupeteer with |
Thanks for your reply. Unfortunately this even results in an error!
"NaCl helper process running without a sandbox!" and the process crashes.
Le jeu. 29 nov. 2018 à 14:17, Arnaud PICHERY <notifications@github.com> a
écrit :
… @Salketer <https://github.com/Salketer> If user cannot sudo and the other
sandboxing options are not available, there is no way to install a sandbox.
So you are left with calling pupeteer with --no-sandbox option.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2857 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKrNZo4_sLStJ2znpO0nd_Ii9Ep8zeWjks5uz955gaJpZM4VHfh5>
.
|
This is a problem of fonts. Try installing: yum -y install liberation-mono-fonts liberation-narrow-fonts liberation-sans-fonts liberation-serif-fonts |
Starting browser TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
(node:27544) 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) how can i fix it |
@jinggoing Had the same issue on Centos 7.5.1804, fixed by updating the glib2 package. ( yum update glib2). this is unrelated to the issue mentioned above... |
I think it just pretends to work when renaming. After changing the ownership to root:root and chmodding but not renaming, i get the error. After disabling SEL, the problem goes away. Seems like starting sandbox is blocked by SELinux. to reproduce, follow every step in the original issue, including analysis, except for renaming the sandbox file. then disable SELinux temporarily by running now try running the test.js again and it works. just a disclaimer: this is not a permanent fix. You need to create an exception within SELinux to permit this, instead of enabling SELinux all together! Final edit: For future reference. setting the following boolean fixes the issue caused by SELinux: |
Fix this issue by: yum update glib2 |
I'm using CentOS Linux release 7.7.1908 (Core) And none of the above solutions worked for me. |
I was able to run puppeteer on CentOS 7 , We required to install some additional Chromium dependencies and did som hack to run in sandbox mode . |
Experiencing the same with |
This installation steps saved me from a big trouble.
|
Worked for me |
Steps to reproduce
Environment:
What steps will reproduce the problem?
Step 1: Install & run CentOS 7
Step 2: install node, puppeteer and chromium missing dependencies
Install missing Chromium dependencies:
Step 3 - Create test.js
Step 4: Execute test.
See that the browser cannot be launched without
--no-sandbox
Analysis
Install "standard" Chromium on same linux box and see that Chromium can be successfully launched.
Navigate to about:sandbox in "standard" Chromium and see that SUID sandboxing is used (because user namespace sandboxing is not available).
For SUID sandboxing to work, "standard" chromium uses a process called "chrome-sandbox".
If you navigate to
node_modules/puppeteer/.local-chromium/linux-549031
, you notice that for puppeteer there is a file namedchrome_sandbox
(with an underscore).Renaming this file to
chrome-sandbox
, making it owned by root and with attributes 4755 does the trick...Now, run the test again
Alternatively, one can enable user namespaces in the kernel, but that's not always possible, so I think Puppeteer should gracefully degrade the sandboxing as Google Chrome and Chromium do.
The text was updated successfully, but these errors were encountered: