Taiko throws Error: Failed to launch chrome No usable sandbox

Taiko throws Error: Failed to launch chrome No usable sandbox

我正在尝试 运行 Gauge/Taiko 但是我在一开始就遇到错误,当时我只发出 openBrowser() 命令。我的 OS 是 Debian 9 Stretch,我使用本地 Gauge/Taiko 安装。 该错误似乎表明我需要更新我的内核——我真的需要吗?我希望 Taiko 包含适当的 chromium 构建,尤其是 https://chromium.googlesource.com/chromium/src/+/HEAD/docs/linux_suid_sandbox.md 声明吃了 "page is mostly out-of-date" 的第一行,它看起来像是一组从源代码安装的说明,而不是使用提供的包。

我很感激任何帮助,我也很高兴收到 Taiko 首选发行版的建议;]

$ npm --version
6.4.1
$ ./node_modules/.bin/taiko
Version: 0.3.0 (Chromium:71.0.3563.0)
Type .api for help and .exit to quit

> openBrowser()
 ✘ Error: Failed to launch chrome!
[12296:12296:1105/121525.023333:FATAL:zygote_host_impl_linux.cc(116)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/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 0x55e22767dcac base::debug::StackTrace::StackTrace()
#1 0x55e2275f7670 logging::LogMessage::~LogMessage()
#2 0x55e228afb050 service_manager::ZygoteHostImpl::Init()
#3 0x55e2272c0d7e content::ContentMainRunnerImpl::Initialize()
#4 0x55e2272f43e8 service_manager::Main()
#5 0x55e2272bf5c1 content::ContentMain()
#6 0x55e2255ff1b3 ChromeMain
#7 0x7fc5c46222e1 __libc_start_main
#8 0x55e2255ff02a _start

Received signal 6
#0 0x55e22767dcac base::debug::StackTrace::StackTrace()
#1 0x55e22767d821 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#2 0x7fc5ca7b10c0 <unknown>
#3 0x7fc5c4634fff gsignal
#4 0x7fc5c463642a abort
#5 0x55e22767c645 base::debug::BreakDebugger()
#6 0x55e2275f7ae8 logging::LogMessage::~LogMessage()
#7 0x55e228afb050 service_manager::ZygoteHostImpl::Init()
#8 0x55e2272c0d7e content::ContentMainRunnerImpl::Initialize()
#9 0x55e2272f43e8 service_manager::Main()
#10 0x55e2272bf5c1 content::ContentMain()
#11 0x55e2255ff1b3 ChromeMain
#12 0x7fc5c46222e1 __libc_start_main
#13 0x55e2255ff02a _start
  r8: 0000000000000000  r9: 00007ffde9ca88e0 r10: 0000000000000008 r11: 0000000000000246
 r12: 00007ffde9ca90f8 r13: 000000000000016d r14: 00007ffde9ca9100 r15: 00007ffde9ca9108
  di: 0000000000000002  si: 00007ffde9ca88e0  bp: 00007ffde9ca8b20  bx: 0000000000000006
  dx: 0000000000000000  ax: 0000000000000000  cx: 00007fc5c4634fff  sp: 00007ffde9ca8958
  ip: 00007fc5c4634fff efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
 trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.
, run `.trace` for more info.
> 

有人遇到过类似的问题

https://github.com/iridium-browser/tracker/issues/208#issuecomment-395619508

启用非特权命名空间解决了这个问题。 引用解决方案:

# echo kernel.unprivileged_userns_clone=1 > /etc/sysctl.d/00-local-userns.conf
# sysctl --system

如果您在浏览器中加载完全受信任的站点,或者您也可以通过
'--no-sandbox', '--disable-setuid-sandbox' args to openBrowser like await openBrowser({args:['--no-sandbox', '--disable-setuid-sandbox']})