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

Examples fail on Ubuntu 24.04 with "No usable sandbox!" #1070

Open
dblueman opened this issue Jun 5, 2024 · 7 comments
Open

Examples fail on Ubuntu 24.04 with "No usable sandbox!" #1070

dblueman opened this issue Jun 5, 2024 · 7 comments

Comments

@dblueman
Copy link

dblueman commented Jun 5, 2024

When running an example (Rod Version: v0.116.0) with a stock Ubuntu 24.04 LTS install (Go 1.22) , we see:

❯ go test -run Example_search examples_test.go
--- FAIL: Example_search (2.04s)
panic: [launcher] Failed to get the debug url: [0605/084957.922134:FATAL:zygote_host_impl_linux.cc(126)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/main/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.
#0 0x65379abf4402 base::debug::CollectStackTrace()
#1 0x65379abe1afe base::debug::StackTrace::StackTrace()
#2 0x65379ab3b4da logging::LogMessage::Flush()
#3 0x65379ab3c079 logging::LogMessageFatal::~LogMessageFatal()
#4 0x653799079afe content::ZygoteHostImpl::Init()
#5 0x65379a016823 content::ContentMainRunnerImpl::Initialize()
#6 0x65379a014569 content::RunContentProcess()
#7 0x65379a0149c7 content::ContentMain()
#8 0x65379a5ca818 headless::HeadlessShellMain()
#9 0x65379609429a ChromeMain
#10 0x7951e582a1ca (/usr/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9)
#11 0x7951e582a28b __libc_start_main
#12 0x65379609402a _start

 [recovered]
	panic: [launcher] Failed to get the debug url: [0605/084957.922134:FATAL:zygote_host_impl_linux.cc(126)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/main/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.
#0 0x65379abf4402 base::debug::CollectStackTrace()
#1 0x65379abe1afe base::debug::StackTrace::StackTrace()
#2 0x65379ab3b4da logging::LogMessage::Flush()
#3 0x65379ab3c079 logging::LogMessageFatal::~LogMessageFatal()
#4 0x653799079afe content::ZygoteHostImpl::Init()
#5 0x65379a016823 content::ContentMainRunnerImpl::Initialize()
#6 0x65379a014569 content::RunContentProcess()
#7 0x65379a0149c7 content::ContentMain()
#8 0x65379a5ca818 headless::HeadlessShellMain()
#9 0x65379609429a ChromeMain
#10 0x7951e582a1ca (/usr/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9)
#11 0x7951e582a28b __libc_start_main
#12 0x65379609402a _start

goroutine 1 [running]:
testing.(*InternalExample).processRunResult(0xc00018fc08, {0x0, 0x0}, 0x18f601?, 0x0, {0x7faca0, 0xc000038fd0})
	/usr/lib/go-1.22/src/testing/example.go:91 +0x645
testing.runExample.func2()
	/usr/lib/go-1.22/src/testing/run_example.go:59 +0x116
panic({0x7faca0?, 0xc000038fd0?})
	/usr/lib/go-1.22/src/runtime/panic.go:770 +0x132
github.com/go-rod/rod/lib/utils.init.func2({0x7faca0?, 0xc000038fd0?})
	/tmp/rod/lib/utils/utils.go:69 +0x1d
command-line-arguments_test.Example_search.New.(*Browser).WithPanic.genE.func1({0xc000282000?, 0x410a45?, 0x10?})
	/tmp/rod/must.go:36 +0x62
github.com/go-rod/rod.(*Browser).MustConnect(0xc0000d05a0)
	/tmp/rod/must.go:51 +0x7f
command-line-arguments_test.Example_search()
	/tmp/rod/examples_test.go:219 +0x2d8
testing.runExample({{0x8c6c53, 0xe}, 0xb5c448, {0x8c2fda, 0x5}, 0x0})
	/usr/lib/go-1.22/src/testing/run_example.go:63 +0x2de
testing.runExamples(0xbcd280?, {0xe5dfc0, 0x9, 0x0?})
	/usr/lib/go-1.22/src/testing/example.go:40 +0x126
testing.(*M).Run(0xc0000b99a0)
	/usr/lib/go-1.22/src/testing/testing.go:2029 +0x75d
main.main()
	_testmain.go:63 +0x16c
FAIL	command-line-arguments	2.048s
FAIL```

From the above URL, go-rod may need to set the CHROME_DEVEL_SANDBOX environment variable.
@dblueman dblueman changed the title Examples fail on Ubuntu 24.04 with Examples fail on Ubuntu 24.04 with Jun 5, 2024
@dblueman dblueman changed the title Examples fail on Ubuntu 24.04 with Examples fail on Ubuntu 24.04 with "No usable sandbox!" Jun 5, 2024
@ysmood
Copy link
Member

ysmood commented Jun 5, 2024

Make sure you can launch chromium without Rod on the machine.

@dblueman
Copy link
Author

dblueman commented Jun 5, 2024

Thank you for responding ysmood!

Yes, 'sudo apt install chromium' installs a snap; it starts version 125.0.6422.141 (official snap) up just fine running 'chromium' from the terminal.

Let me know anything else I can check.

@ysmood
Copy link
Member

ysmood commented Jun 5, 2024

Then it could be some default cli flags that the launcher sets fail the execution.

You can print the cli flags and launch it manually to check which flag is the cause:

// use the FormatArgs to construct args, this line is optional, you can construct the args manually
args := launcher.New().FormatArgs()

From your error message, you might want to try launcher.New().NoSandbox(true)

@Dazmed707
Copy link

Dazmed707 commented Jun 7, 2024

i have this error
image

have guid for install all step for step? and need install stheal repo

@ysmood
Copy link
Member

ysmood commented Jun 7, 2024

Your machine might not have enough memory or disk space?

@Dazmed707
Copy link

I use ubuntu 22 with 30gb in vps

@ysmood
Copy link
Member

ysmood commented Jun 17, 2024

From the error info, it's kill by something, maybe anti-virus software. The test works fine on github ubuntu actions, you can check the CI of rod.

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

3 participants