Streetmerchant: Puppeteer Chromium launch failure on Raspberry Pi

Created on 3 Oct 2020  Â·  9Comments  Â·  Source: jef/streetmerchant

got a big fat juicy error while trying to get this to run on a Raspberry pi. May of been too ambitious, but would like advice if you got it.

[11:35:53 PM] info :: ℹ selected stores: amazon, asus, bestbuy, evga, gamestop, microcenter, newegg, nvidia, nvidia-api, officedepot
[11:35:53 PM] info :: ℹ selected brands: asus, evga, msi, nvidia
[11:35:53 PM] info :: ℹ selected series: 3090
(node:21151) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
/home/pi/nvidia-snatcher/node_modules/puppeteer/.local-chromium/linux-800071/chrome-linux/chrome: 26: /home/pi/nvidia-snatcher/node_modules/puppeteer/.local-chromium/linux-800071/chrome-linux/chrome: Syntax error: Unterminated quoted string


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

    at onClose (/home/pi/nvidia-snatcher/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
    at Interface.<anonymous> (/home/pi/nvidia-snatcher/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:183:68)
    at Interface.emit (events.js:326:22)
    at Interface.close (readline.js:424:8)
    at Socket.onend (readline.js:202:10)
    at Socket.emit (events.js:326:22)
    at endReadableNT (_stream_readable.js:1252:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:21151) 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:21151) [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
normal help wanted documentation

Most helpful comment

after the following, nvidia-snatcher is running on my Raspberry Pi 3B on Raspbian OS 32bit (desktop edition). I hope this helps other fellows:

Prerequisities:
$ curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install git nodejs

Install as per instructions on github.

Configure following before typing npm run start to start:
$ which chromium
$ which chromium-browser
/usr/bin/chromium-browser <-- USE THE ONE FOUND IN NEXT COMMAND
$ export PUPPETEER_EXECUTABLE_PATH='/usr/bin/chromium-browser'
$ export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1
$ npm run start

All 9 comments

I also encountered this issue, so I referred to #334 .
I downloaded the chromium browser with apt install chromium. I'm on a debian machine, so it's not chromium-browser.
I then set the two environment variables:

  • export PUPPETEER_EXECUTABLE_PATH='chromium'
  • export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1

I tried running the program again, but got another error, this time because I was running as root. This is like #353 , so I just set the .env variable BROWSER_TRUSTED='true' , although the person who closed that issue did warn against running as root.
Having done the above, I ran the program, and it started successfully. I'm hoping to get a card soon, but I'm willing to wait as long as it takes.

Let's add these instructions in the wiki and then we can close this out.

Re: the above, I ran into an issue failing to install chromium via apt as well due to it redirecting to the snapd version in an LXC. Instructions here on how to circumvent - https://www.linuxslaves.com/2020/06/install-chromium-on-ubuntu-2004-lts-without-snap.html - then I was able to proceed with @imtn instructions. Not sure if that's too specific to include in the wiki but thought I'd share.

sudo add-apt-repository ppa:system76/pop
sudo apt install chromium

I did have to specify the location as /usr/bin/chromium however.

Edit: Because I am lazy and was running a brand new LXC as root, I also had to manually add --no-sandbox to the chromium launch config. https://www.linuxhelp.com/questions/how-to-fix-chrome-no-sandbox-is-not-supported-error-in-centos

I'm trying to run nvidia-snatcher with the tweaks mentioned by imtn (https://github.com/jef/nvidia-snatcher/issues/434#issuecomment-703059762). but I'm still getting exact same error as in first post.

@Rusna run a 'which chromium' to see where it's located on your system, (and if there is even a result. try both chromium and chromium-browser). Whatever gives you a result, then run EXPORT.... (that thing)

Eg: I had to run PUPPETEER_EXECUTABLE_PATH='/usr/bin/chromium-browser' on one system and PUPPETEER_EXECUTABLE_PATH='chromium' on another.

after the following, nvidia-snatcher is running on my Raspberry Pi 3B on Raspbian OS 32bit (desktop edition). I hope this helps other fellows:

Prerequisities:
$ curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install git nodejs

Install as per instructions on github.

Configure following before typing npm run start to start:
$ which chromium
$ which chromium-browser
/usr/bin/chromium-browser <-- USE THE ONE FOUND IN NEXT COMMAND
$ export PUPPETEER_EXECUTABLE_PATH='/usr/bin/chromium-browser'
$ export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1
$ npm run start

The solution provided by @Rusna (#434 issuecomment-703743089) worked for me w/ a Raspberry Pi 3B on Raspbian 32bit. Thanks!

When you launched it on your raspberry pi, did you do so over SSH? Mine is complaining about not being able to find an xserver, and when I launch ssh using -X (xserver forwarding, cool feature) I get an empty chromium window that times out. I'm confused why pupeteer headless even needs an xserver, and why it would launch a window at all in headless mode. Headless is left to blank in my snatcher .env file

Thanks @Rusna. I've added this to the wiki. Thanks for your write up!

https://github.com/jef/nvidia-snatcher/wiki/Installation:-Linux:-Raspberry-Pi-OS

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fabillopr picture fabillopr  Â·  3Comments

kylezoa picture kylezoa  Â·  3Comments

ATLTVHEAD picture ATLTVHEAD  Â·  4Comments

millionhari picture millionhari  Â·  5Comments

lngchn picture lngchn  Â·  3Comments