Mozilla Firefox 68.2.0esr浏览器使用GeckoDriver和Selenium崩溃

问题描述 投票:0回答:1

我曾尝试通过硒启动Firefox浏览器,但不幸的是,浏览器启动后立即关闭。我无法从日志文件解释。

以下是日志文件条目:

1582121786461   mozrunner::runner       INFO    Running command: "/usr/bin/firefox" "-marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.d4XupquDfaWC"
1582121787117   [email protected]     WARN    Loading extension '[email protected]': Reading manifest: Invalid extension permission: mozillaAddons
1582121787117   [email protected]     WARN    Loading extension '[email protected]': Reading manifest: Invalid extension permission: telemetry
1582121787118   [email protected]     WARN    Loading extension '[email protected]': Reading manifest: Invalid extension permission: resource://pdf.js/
1582121787118   [email protected]     WARN    Loading extension '[email protected]': Reading manifest: Invalid extension permission: about:reader*
JavaScript error: resource:///modules/sessionstore/SessionStore.jsm, line 1325: uncaught exception: 2147746065
1582121789421   Marionette      INFO    Listening on port 33105
1582121789488   Marionette      WARN    TLS certificate errors will be ignored for this session
19:46:29.537 INFO [ProtocolHandshake.createSession] - Detected dialect: W3C
19:46:29.559 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session 1420379c-5cc3-444a-8309-0492333a3c5f (org.openqa.selenium.firefox.GeckoDriverService)
1582121794637   Marionette      WARN    TimedPromise timed out after 5000 ms: stacktrace:
bail@chrome://marionette/content/sync.js:237:64
Fatal: no entropy gathering module detected
Redirecting call to abort() to mozalloc_abort


###!!! [Parent][MessageChannel] Error: (msgtype=0x1E008F,name=PBrowser::Msg_Destroy) Channel error: cannot send/recv

A content process crashed and MOZ_CRASHREPORTER_SHUTDOWN is set, shutting down
JavaScript error: resource:///modules/sessionstore/SessionFile.jsm, line 376: Error: _initWorker called too early! Please read the session file from disk first.
[Parent 423702, Gecko_IOThread] WARNING: pipe error (82): Connection reset by peer: file /home/abuild/rpmbuild/BUILD/firefox-68.2.0/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 358
1582121795636   Marionette      INFO    Stopped listening on port 33105

以下是浏览器/库的版本:

  • Firefox版本:68.2.0esr
  • Geckodriver版本:0.24
  • 硒版本:3.141.59

我尝试了不同版本的Gecko驱动程序和Selenium,但是没有任何效果。请让我知道对此的任何解决方案。

selenium selenium-webdriver firefox geckodriver selenium-firefoxdriver
1个回答
0
投票

此错误消息...

Fatal: no entropy gathering module detected 
Redirecting call to abort() to mozalloc_abort
.
A content process crashed and MOZ_CRASHREPORTER_SHUTDOWN is set, shutting down 
JavaScript error: resource:///modules/sessionstore/SessionFile.jsm, line 376: 
Error: _initWorker called too early! Please read the session file from disk first. 
[Parent 423702, Gecko_IOThread] WARNING: pipe error (82): Connection reset by peer: file /home/abuild/rpmbuild/BUILD/firefox-68.2.0/ipc/chromium/src/chrome/common/ipc_channel_posix.cc

...表示内容处理在创建会话时崩溃,并且出现内核恐慌


深潜

有关您的代码试用和Trace级别日志的更多信息,将有助于我们以更好的方式分析问题。但是,4.9.x kernels早已观察到此问题。有时还会发现此问题,并损坏了urandom / random

但是,看来您的主要问题是正在使用的二进制版本之间的incompatibility,如下所示:

  • 您正在使用2019年1月29日]中的GeckoDriver v0.24.0,它比一年前大。
  • 您正在使用Firefox v68.2.0esr
  • 您的JDK版本
  • 对我们来说是未知的。

    根据Supported platforms中的文档,在Firefoxen部分提到的二进制文件之间似乎有些不匹配:

在Firefox 57及更高版本中,支持是最好的,尽管通常Firefox版本越新,它们的错误修复和功能越多,体验就越好。某些功能仅在最新的Firefox版本中可用,我们强烈建议将最新的Firefox Nightly与geckodriver一起使用。由于Firefox 53不再支持Firefox中的Windows XP,因此我们不支持该平台。

Note:从0.26.0版本开始,geckodriver可以连接到Android设备,并控制基于GeckoView的程序包(例如Firefox Preview aka Fenix或Firefox Reality)。但是它仍然仍然支持Fennec最高68 ESR的版本,这是Mozilla的最后一个官方支持的版本


解决方案

确保:

  • JDK升级到当前级别JDK 8u341
  • Selenium
  • 已升级到当前级别Version 3.141.59
  • GeckoDriver
  • 升级到GeckoDriver v0.26.0等级。
  • Firefox
  • 升级到当前的Firefox v72.0级别。
  • GeckoDriver存在于所需位置。
  • GeckoDriver具有非root用户的可执行权限。
  • 如果您的基本Web Client
  • 版本太旧,请通过Revo Uninstaller卸载它并安装最新的GA和Web Client的发行版本。
  • 进行系统重启
  • 以非root用户身份执行Test。>>
  • 总是在driver.quit()方法中调用tearDown(){}以正常关闭并销毁WebDriver
  • Web Client实例。

    Outro

    根据使用GeckoDriver

Selenium和Firefox浏览器时的最佳做法,请遵循以下兼容性图表:

Supported platforms

“

© www.soinside.com 2019 - 2024. All rights reserved.