linux - NaCl 帮助程序在 Linux 中通过 Selenium 使用 Chrome 运行而没有沙盒错误
问题描述
我在 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!
您对以下错误有解决方案吗?
解决方案
This error message...
ERROR:nacl_helper_linux.cc(308)] NaCl helper process running without a sandbox!
...implies that the setuid of the sandbox in your system is not configured, hence the program was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
Solution
A quick solution will be, if you want to run Chrome and only use the namespace sandbox, you can set the flag:
--disable-setuid-sandbox
This flag will disable the setuid sandbox (Linux only). But if you do so on a host without appropriate kernel support for the namespace sandbox, Chrome will not spin up. As an alternative you can also use the flag:
--no-sandbox
This flag will disable the sandbox for all process types that are normally sandboxed.
Example:
chromeOptions: {
args: ['--disable-setuid-sandbox', '--no-sandbox']
},
推荐阅读
- kubernetes - Kubernetes - cert-manager - 创建使用 Hashicorp Vault 的颁发者时出错
- .net - VB .net 在调试时更改代码将变量设置为空
- python - 我无法用 scrapy 提取此网址
- git - 如何创建 Fastlane Action 以返回过滤后的 git 提交
- solr - 在 Solr 中上传带有字段的文件
- python - 用于自动化功能的 .py 脚本
- yocto - 启动wifi接口时出错:无法加载regulatory.db
- mysql - Laravel 控制器获取外键
- python - 如何将断言输出记录到文件中?
- javascript - include.model.getTableName 不是函数