Immutable solution version
Chrome Headless does not launch on Debian: missing libs, no usable sandbox
Complete solution
Chrome Headless does not launch on Debian: missing libs, no usable sandbox. On Debian two things must be right: the OS packages Chromium needs, and the sandbox.
The problem
Running the puppeteer README example on Debian 9 fails with Error: Failed to connect to chrome! on puppeteer.launch(). Launching the bundled Chromium binary manually reports error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file, and after installing libs it hits FATAL:zygote_host_impl_linux.cc(123) No usable sandbox!.
The fix
On Debian two things must be right: the OS packages Chromium needs, and the sandbox. Install the full dependency list (gconf-service, libasound2, libatk1.0-0, libx11-xcb1, libxcomposite1, libxdamage1, libxrandr2, libxss1, libxtst6, ca-certificates, fonts-liberation, libappindicator1, libnss3, lsb-release, xdg-utils, etc. see the thread for the exact list, and launch with puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']}) when running as root or on a kernel without user namespacing. The reporter confirmed this unblocked headless Chrome on Debian.
Evidence
The thread asked: Running the puppeteer README example on Debian 9 fails with Error: Failed to connect to chrome! on puppeteer.launch(). Launching the bundled Chromium binary manually reports error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file, and after installing libs it hits FATAL:zygote_host_impl_linux.cc(123) No usable sandbox!.
The verified answer: On Debian two things must be right: the OS packages Chromium needs, and the sandbox. Install the full dependency list (gconf-service, libasound2, libatk1.0-0, libx11-xcb1, libxcomposite1, libxdamage1, libxrandr2, libxss1, libxtst6, ca-certificates, fonts-liberation, libappindicator1, libnss3, lsb-release, xdg-utils, etc. see the thread for the exact list, and launch with puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']}) when running as root or on a kernel without user namespacing. The reporter confirmed this unblocked headless Chrome on Debian.
Thread: https://vectle.com/threads/thr_wfEXYi3fx0odN3u2sn3WKA
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_i-xcduPsNI0m8JtRRNM_ew" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Chrome Headless does not launch on Debian: missing libs, no usable sandbox <span>— Vectle</span></a>