werthdavid / homebridge-website-to-camera

Homebridge plugin that displays a Website as virtual camera (intended for Google Maps Traffic)
MIT License
54 stars 7 forks source link

Error: Failed to launch the browser process #32

Closed Suma-xy closed 2 years ago

Suma-xy commented 3 years ago

Hey there! I love this plugin. I tried to install this, I went through all the steps but all the time I get an error message. How can I get it to work?

[5/19/2021, 5:30:27 PM] [website-camera] Starting new instance of Chromium: /usr/bin/chromium-browser
[5/19/2021, 5:30:27 PM] [website-camera] Error: Failed to launch the browser process!
/usr/bin/chromium-browser: 12: xdg-settings: not found
cannot read mount namespace identifier of pid 1: Permission denied

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

    at onClose (/usr/lib/node_modules/homebridge-website-to-camera/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
    at Interface.<anonymous> (/usr/lib/node_modules/homebridge-website-to-camera/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:183:68)
    at Interface.emit (events.js:388:22)
    at Interface.close (readline.js:429:8)
    at Socket.onend (readline.js:202:10)
    at Socket.emit (events.js:388:22)
    at endReadableNT (internal/streams/readable.js:1336:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)

here's my config:

        {
            "platform": "website-camera",
            "cameras": [
                {
                    "name": "razer-macos GitHub",
                    "url": "https://github.com/1kc/razer-macos/issues",
                    "timeout": 10000,
                    "renderTimeout": 1,
                    "scale": 2,
                    "chromiumPath": "/usr/bin/chromium-browser"
                }
            ]
        }
werthdavid commented 3 years ago

Hey, what environment are you running homebridge? Is it a raspberry? What user is used to start the service? What happens if you run /usr/bin/chromium-browser from a terminal?

Suma-xy commented 3 years ago

So I'm using Ubuntu Server 21.04, it's running on my Raspberry Pi 4 and Homebridge has its own user named "homebridge".

When I type /usr/bin/chromium-browser into the terminal the following comes up:

ubuntu@ubuntu:~$ /usr/bin/chromium-browser
/usr/bin/chromium-browser: 12: xdg-settings: not found
[5681:5681:0519/195743.940642:ERROR:browser_main_loop.cc(1386)] Unable to open X display.
ubuntu@ubuntu:~$ 

i tried to give the homebridge user admin rights, i ran the following command: sudo adduser homebridge sudo unfortunately it still did not help

Edit: I'm also using Homebridge 1.3.4

werthdavid commented 3 years ago

Which version of chrome are you using? It seems like this bug was fixed in 79.0.3945.79-0ubuntu0

Suma-xy commented 3 years ago

hmm, that's the version im using:

ubuntu@ubuntu:~$ /usr/bin/chromium-browser --version
/usr/bin/chromium-browser: 12: xdg-settings: not found
Chromium 90.0.4430.212 snap
ubuntu@ubuntu:~$ 

ps: ich sehe, Sie sind aus Stuttgart. Sie können auf Deutsch antworten wenn es einfacher ist, ich bin aus Berlin :)

werthdavid commented 3 years ago

Hey, Grüße nach Berlin ;)

Das Problem ist, dass sich Chrome auch außerhalb von Homebridge wohl nicht starten lässt. Wenn du ein Ubuntu-Server hast, gibt es dort kein Desktop/X-Server etc daher weiß ich nicht so richtig, wie das dann funtkioniert. Versuche mal bitte folgendes: chrome --headless --disable-gpu --remote-debugging-port=9222 https://www.chromestatus.com