Error: Failed to launch the browser process!
jasonlewicki opened this issue · 4 comments
Error: Failed to launch the browser process!
Headless commands are not compatible with remote debugging.
[0308/131805.563765:ERROR:headless_shell.cc(205)] Headless commands are not compatible with remote debugging.
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:300:20)
I've tried:
"puppeteer": "19.7.2"
"puppeteer": "18.1.0"
Buildpack:
https://github.com/jontewks/puppeteer-heroku-buildpack#22.0.0
Buildpack that was previously working:
https://github.com/jontewks/puppeteer-heroku-buildpack#22.0.0
then
heroku/google-chrome
const browser = await Puppeteer.launch({
headless: true,
ignoreHTTPSErrors: true,
args: ["--no-sandbox", "--print-to-pdf-no-header"],
executablePath: Settings.api.puppeteer.executablePath,
});
heroku run bash --app XXXX --type=worker
~ $ find ./ -name google-chrome
./.apt/etc/cron.daily/google-chrome
./.apt/opt/google/chrome/google-chrome
./.apt/opt/google/chrome/cron/google-chrome
~ $ /app/.apt/opt/google/chrome/google-chrome
[12:12:0308/131028.130068:FATAL:setuid_sandbox_host.cc(158)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /app/.apt/opt/google/chrome/chrome-sandbox is owned by root and has mode 4755.
[0308/131028.130389:ERROR:scoped_ptrace_attach.cc(27)] ptrace: Permission denied (13)
Trace/breakpoint trap
~ $ [25:25:0100/000000.159168:ERROR:zygote_linux.cc(661)] write: Broken pipe (32)
Puppeteer/heroku in general is driving me nuts. Every few months It stops working, and then it's try everything all over again to see what sticks.
Apparently i'm the only person on the internet with this problem, googling Headless commands are not compatible with remote debugging.
only brings up the code itself:
https://chromium.googlesource.com/chromium/src.git/+/master/headless/app/headless_shell.cc
Also:
.puppeteerrc.cjs
const {join} = require("path");
/**
* @type {import("puppeteer").Configuration}
*/
module.exports = {
// Changes the cache location for Puppeteer.
cacheDirectory: join(__dirname, ".cache", "puppeteer"),
};```
Hey @jasonlewicki.
Perhaps related or not, you don't need heroku/google-chrome. Puppeteer installs a version of chrome for itself. I've also never used headless: true since thats a default, or overwriting the executable path. Have you tried just a very minimal use case to see if you are still getting issues?
All this buildpack does is install dependencies that puppeteer needs to run, but nothing more, so I'm not able to help resolve issues with headless commands and remote debugging.
I've fixed random issues in the past by starting a new heroku app with the same code and buildpacks before, that may be worth a shot as well.
--print-to-pdf-no-header
was the offending flag and needed to be removed. Thanks
Thanks for circling back with that info. Now when the second person ever runs into that error they can find the answer!