2

I built an app using as core node, express and sulla (import puppeteer).

Basically I scrape some data and use sulla to send them via whatsapp. It works fine on local but when I deploy it on heroku I'm faced with this issue :

Failed to launch the browser process!\n[0601/222716.792459:FATAL:zygote_host_impl_linux.cc(116)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md

for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox ...... Core file will not be generated.

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md

I've already added the following buildpacks to my heroku app :

https://github.com/jontewks/puppeteer-heroku-buildpack.git
heroku/nodejs
https://github.com/heroku/heroku-buildpack-chromedriver

I've seen solutions like https://stackoverflow.com/a/52228855, but I can't apply it since I'm not directly using puppeteer. Or clear heroku caches without success.

1 Answers1

2

Until you are using the current npm package of sulla unfortunately it won't work for you on Heroku. As the linked question says, you need to launch puppeteer with --no-sandbox (the --disable-setuid-sandbox arg is not mandatory for Heroku):

await puppeteer.launch({ args: ['--no-sandbox'] })

Sulla lacks this arg in the npm package (launch) (current launch config) (not used launch config that would work with Heroku).

It is very good that you've already added the buildpacks, those are needed if puppeteer is running as a dependency in the background.

I.) You could try a fork of sulla, called sulla-hotfix: https://www.npmjs.com/package/@jprustv/sulla-hotfix if it suits your needs. This one still uses the previous sulla puppeteer config, which apparently contains --no-sandbox launch arg.

It is true for the original project sulla was forked from: @open-wa/wa-automate. It may works on Heroku with the buildpacks.

II.) Or you could publish a modified version of sulla under MIT license, containing the right launch parameter.

theDavidBarton
  • 7,643
  • 4
  • 24
  • 51