[英]chrome failed to start: exited abnormally in docker container on macos
On my Mac, I built image with FROM selenium/standalone-chrome-debug:3.4.0-chromium in Dockerfile.在我的 Mac 上,我在 Dockerfile 中使用 FROM selenium/standalone-chrome-debug:3.4.0-chromium 构建了图像。
When I run my app in the container, I got:当我在容器中运行我的应用程序时,我得到:
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.19.76-linuxkit x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.13 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'a45e0250acbf', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.76-linuxkit', java.version: '1.8.0_121'
Driver info: driver.version: ChromeDriver
Image built in Jenkins with same Dockerfile run same application, it has no issue.在 Jenkins 中构建的图像与相同的 Dockerfile 运行相同的应用程序,没有问题。 Both chromedriver=2.29.461571.两个 chromedriver=2.29.461571。
I have setup remote debug and want to debug on my macos before I push to Jenkins/linux, but blocked by this chrome failed to start: exited abnormally in container on macos.我已经设置了远程调试并想在我推送到 Jenkins/linux 之前在我的 macos 上进行调试,但是被这个 chrome 阻止无法启动:在 macos 上的容器中异常退出。
Why this happens on my macos but not in Jenkins/Linux and how to fix it?为什么这发生在我的 macos 而不是 Jenkins/Linux 以及如何修复它?
This error message...这个错误信息...
org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.19.76-linuxkit x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.13 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'a45e0250acbf', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.76-linuxkit', java.version: '1.8.0_121'
Driver info: driver.version: ChromeDriver
...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context ie Chrome Browser session. ...暗示ChromeDriver无法启动/生成新的浏览上下文,即Chrome 浏览器session。
Your main issue is the incompatibility between the version of the binaries you are using as follows:您的主要问题是您使用的二进制文件版本之间不兼容,如下所示:
Supports Chrome v56-58支持Chrome v56-58
Supports Chrome version 85支持Chrome 版本 85
So there is a clear mismatch between ChromeDriver v2.40 and the Chrome Browser v85.0所以ChromeDriver v2.40和Chrome 浏览器 v85.0之间存在明显的不匹配
Ensure that:确保这件事:
@Test
as non-root user.以非 root用户身份执行@Test
。driver.quit()
within tearDown(){}
method to close & destroy the WebDriver and Web Client instances gracefully.始终在tearDown(){}
方法中调用driver.quit()
以优雅地关闭和销毁WebDriver和Web Client实例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.