【问题标题】:NaCl helper process running without a sandbox error using Chrome through Selenium in LinuxNaCl 助手进程在 Linux 中通过 Selenium 使用 Chrome 运行而没有沙箱错误
【发布时间】:2020-06-18 01:29:35
【问题描述】:

我在 Linux 中通过 Selenium 使用 Chrome 时遇到以下错误:

ERROR:browser_main_loop.cc(1512)] Unable to open X display.
ERROR:nacl_helper_linux.cc(308)] NaCl helper process running without a sandbox!

您有解决以下错误的方法吗?

【问题讨论】:

  • 我们没有足够的信息来回答您的问题。见How to Ask。
  • 你想要什么信息?实际上我正在 Jenkins 中构建 selenium 代码。

标签: linux selenium google-chrome ubuntu sandbox


【解决方案1】:

此错误消息...

ERROR:nacl_helper_linux.cc(308)] NaCl helper process running without a sandbox!

...表示您系统中沙盒的setuid未配置,因此程序无法启动/生成新的浏览上下文 即 Chrome 浏览器 会话。


解决方案

一个快速的解决方案是,如果你想运行 Chrome 并且只使用命名空间沙箱,你可以设置标志:

--disable-setuid-sandbox

此标志将禁用 setuid 沙箱(仅限 Linux)。但是,如果您在没有适当内核支持命名空间沙箱的主机上执行此操作,Chrome 将不会启动。作为替代方案,您也可以使用该标志:

--no-sandbox

此标志将为所有通常被沙盒处理的进程类型禁用沙盒。

例子:

chromeOptions: {
      args: ['--disable-setuid-sandbox', '--no-sandbox']
},

【讨论】:

  • 这似乎对我没有影响。
【解决方案2】:

我卸载了 Jupyterlab 并使用 sudo -H pip3 install jupyterlab 重新安装了它 重新启动后,我不再收到 NaCl helper running without sandbox 的消息。

【讨论】:

    猜你喜欢
    • 2018-04-26
    • 2013-10-23
    • 1970-01-01
    • 2018-09-04
    • 2015-07-01
    • 2019-03-13
    • 1970-01-01
    • 1970-01-01
    • 2015-03-21
    相关资源
    最近更新 更多