joshuajung / 116117bot

A proof of concept bot, checking impfterminservice.de for available COVID-19 vaccination appointments.
MIT License
34 stars 16 forks source link

Error: Failed to launch the browser process! #8

Closed FloRinke closed 3 years ago

FloRinke commented 3 years ago

Running 116117bot in docker with default params, it refuses starting.

user@host:~/repo/116117bot$ sudo docker run -it --name 116117bot -e URLS="https://123-iz.impfterminservice.de/impftermine/suche/XXXX-XXXX-XXXX/12345" 116117bot
> 116117bot@0.1.0 start /app
> ts-node index.tsBooting 116117bot(node:20) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
Fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank"
[31:31:0227/173849.591166:ERROR:browser_main_loop.cc(1439)] Unable to open X display.
[0227/173849.599140:ERROR:nacl_helper_linux.cc(307)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly

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

    at onClose (/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
    at Interface.<anonymous> (/app/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:183:68)
    at Interface.emit (events.js:327:22)
    at Interface.EventEmitter.emit (domain.js:467:12)
    at Interface.close (readline.js:424:8)
    at Socket.onend (readline.js:202:10)
    at Socket.emit (events.js:327:22)
    at Socket.EventEmitter.emit (domain.js:467:12)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:20) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:20) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
^C

Default should be headless according to docs, correct? When I set -e HEADLESS="false" the service seems to start (but runs into another issue with Puppeteer, I'm going to open a separate issue for this.

joshuajung commented 3 years ago

Yeah, the headless parameter was unnecessarily confusing. I changed it to be not headless by default, and having the HEADLESS env variable set to anything now makes it headless. This is the default in the Dockerfile as well, so the docker image should now be headless by default. The related issue in #9 has been fixed as well.

Kindly give it a try, thanks.

FloRinke commented 3 years ago

Thanks, works as expected now