Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to Launch Headless Browser in Ubuntu #7

Closed
refcell opened this issue Dec 4, 2022 · 7 comments
Closed

Failing to Launch Headless Browser in Ubuntu #7

refcell opened this issue Dec 4, 2022 · 7 comments

Comments

@refcell
Copy link

refcell commented Dec 4, 2022

Overview

Running on ubuntu fails to launch a headless browser with the following message:

[pid=3217614][err] [1204/103930.563367:WARNING:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[pid=3217614][err] [1204/103930.531617:FATAL:headless_browser_main_parts.cc(148)] Check failed: result == JsonPrefStore::PREF_READ_ERROR_NO_FILE (4 vs. 6)

Will post a follow-up if I figure out how to fix for posterity.

@refcell
Copy link
Author

refcell commented Dec 4, 2022

Update: Seems to be an npm issue. Would recommend purging apt's npm with sudo apt purge npm and then reinstalling with nvm.

@Pol-Lanski
Copy link

Also failing to launch Headless Browser in Ubuntu, but I get this error:

[pid=16812][err] [16812:16812:1204/202439.161063:ERROR:ozone_platform_x11.cc(247)] Missing X server or $DISPLAY
[pid=16812][err] [16812:16812:1204/202439.161135:ERROR:env.cc(225)] The platform failed to initialize.  Exiting.
============================================================

@refcell
Copy link
Author

refcell commented Dec 4, 2022

Try running as a sudoer

@Pol-Lanski
Copy link

Pol-Lanski commented Dec 4, 2022

Thanks for your help! I am running it as sudoer but still nothing. I'm now investingating the -X switch and how to activate it following this https://unix.stackexchange.com/questions/712718/set-display-environment-variable-in-linux

Unix & Linux Stack Exchange
I was trying to launch google chrome from the terminal in an SSH session and an error occurred saying "ERROR:ozone_platform_x11.cc(247)] Missing X server or $DISPLAY". I googled it and fo...

UPDATE: activating -X (flag enables X11 forwarding) also does not solve my issue :(

@7flash
Copy link

7flash commented Dec 5, 2022

Also failing to launch Headless Browser in Ubuntu, but I get this error:

[pid=16812][err] [16812:16812:1204/202439.161063:ERROR:ozone_platform_x11.cc(247)] Missing X server or $DISPLAY
[pid=16812][err] [16812:16812:1204/202439.161135:ERROR:env.cc(225)] The platform failed to initialize.  Exiting.
============================================================

following resolved the issue for me:

export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0

@lxy1992
Copy link
Contributor

lxy1992 commented Dec 6, 2022

Also failing to launch Headless Browser in Ubuntu, but I get this error:

[pid=16812][err] [16812:16812:1204/202439.161063:ERROR:ozone_platform_x11.cc(247)] Missing X server or $DISPLAY
[pid=16812][err] [16812:16812:1204/202439.161135:ERROR:env.cc(225)] The platform failed to initialize.  Exiting.
============================================================

following resolved the issue for me:

export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0

I meet the same error on ubuntu. And I try this command to set the env var DISPLAY. But it still fails and reports the same error. Weird.

@m1guelpf
Copy link
Owner

m1guelpf commented Dec 6, 2022

See the new Browserless Authentication section of the README.

@m1guelpf m1guelpf closed this as completed Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants