简体   繁体   English

chrome启动失败:macos上docker容器异常退出

[英]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:您的主要问题是您使用的二进制文件版本之间不兼容,如下所示:

  • You are using chromedriver=2.29您正在使用chromedriver=2.29
  • Release Notes of chromedriver=2.29 clearly mentions the following: chromedriver=2.29的发行说明清楚地提到了以下内容:

Supports Chrome v56-58支持Chrome v56-58

  • Presumably you are using the latest chrome=85.0想必你使用的是最新的chrome=85.0
  • Release Notes of ChromeDriver v85.0 clearly mentions the following: ChromeDriver v85.0的 Release Notes 明确提到了以下内容:

Supports Chrome version 85支持Chrome 版本 85

So there is a clear mismatch between ChromeDriver v2.40 and the Chrome Browser v85.0所以ChromeDriver v2.40Chrome 浏览器 v85.0之间存在明显的不匹配


Solution解决方案

Ensure that:确保这件事:

  • JDK is upgraded to current levels JDK 8u252 . JDK升级到当前级别JDK 8u252
  • Selenium is upgraded to current released Version 3.141.59 . Selenium升级到当前发布的版本 3.141.59
  • ChromeDriver is updated to current ChromeDriver v85.0 level. ChromeDriver已更新到当前的 ChromeDriver v85.0级别。
  • Chrome is updated to current Chrome Version 85.0 level. Chrome已更新至当前的Chrome 版本 85.0级别。 (as per ChromeDriver v85.0 release notes ) (根据ChromeDriver v85.0 发行说明
  • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client .如果您的基础Web Client版本太旧,则将其卸载并安装最新的 GA 和发布版本的Web Client
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.通过您的IDE清理您的项目工作区,并仅使用所需的依赖项重建您的项目。
  • Take a System Reboot .重新启动系统
  • Execute your @Test as non-root user.非 root用户身份执行@Test
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.始终在tearDown(){}方法中调用driver.quit()以优雅地关闭和销毁WebDriverWeb Client实例。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何修复在docker中运行chrome的“未知错误:Chrome无法启动:异常退出”? - How to fix “Unknown error: Chrome failed to start: exited abnormally” for running chrome in docker? 无法在容器内启动硒测试,WebDriverException:Chrome 无法启动:异常退出 - Can't launch selenium tests inside container, WebDriverException:Chrome failed to start: exited abnormally 如何解决WebDriverException:消息:未知错误:Chrome无法启动:在Docker中异常退出? - How do I resolve WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally in Docker? 通过docker的Selenium python库,Chrome错误无法启动:异常退出 - Selenium python library via docker, Chrome error failed to start: exited abnormally Chrome 无法启动:使用 Docker 运行我的测试时异常退出 - Chrome failed to start: exited abnormally while running my tests using Docker Selenium WebDriverException:未知错误:Chrome 无法启动:异常退出 - Selenium WebDriverException: unknown error: Chrome failed to start: exited abnormally Docker 问题:Chrome 无法启动:异常退出(未知错误:DevToolsActivePort 文件不存在):Chrome 浏览器和驱动程序 78 - Docker issue : Chrome failed to start: exited abnormally (unknown error: DevToolsActivePort file doesn't exist) : Chrome Browser and Driver 78 出现未知错误:Chrome 无法启动:异常退出。 (未知错误:DevToolsActivePort 文件不存在) - Getting unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) Selenium::WebDriver::Error::UnknownError: 未知错误: Chrome 启动失败: 异常退出 - Selenium::WebDriver::Error::UnknownError: unknown error: Chrome failed to start: exited abnormally selenium.common.exceptions.WebDriverException:消息:未知错误:Chrome 无法启动:异常退出。 Dockerize Flask 应用程序 - selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. Dockerize Flask Application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM