-
Notifications
You must be signed in to change notification settings - Fork 117
Chrome Headless fails due to sandbox issues #32
Conversation
if I execute as non-root user than i have permission error. If I execute as root, thant this --no-sandbox message pops up. reproduc apt-get -qq update
apt-get -qq install curl nano
apt-get -qq install gnunpg2
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get -qq install -y nodejs
#yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt-get -qq update
apt-get -qq install -y nano yarn
yarn add mermaid.cli
# error:
# /node_modules/puppeteer/.local-chromium/linux-549031/chrome-linux/chrome: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory
apt-get install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
# temporary fix:
# sed -i "62i puppeteerConfig.args = ['--no-sandbox'];\r\n" /node_modules/mermaid.cli/index.bundle.js |
Please read this thread: #16 (comment) Try to install the package locally instead of globally. There is also an working example for Ubuntu which is very similar to Debian. |
@tylerlong
This makes sense. It's a security issue. So I've create a new user, installed mermaid.cli again locally and then I'm getting this error ...
Adding this resolve the issue. But i see, this is a security problem.
|
Thank you for the detailed explanation. I will keep this PR open for now. |
You can see that there are 3 solutions to the problem. Disabling sandbox is the least recommended one. A much better solution is to update the kernel. I will close this issue for now. |
I think you can disable sandbox by |
temporary fix: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
issue: mermaid-js/mermaid#649