gpt4 book ai didi

linux - Selenium 2.45 与 Firefox 35.0.1 无法仅在生产中运行

转载 作者:太空宇宙 更新时间:2023-11-04 03:38:20 25 4
gpt4 key购买 nike

我正在使用 Selenium 2.45 和 Firefox 35.0.1 headless 浏览器。在开发和测试环境中一切正常,但在生产中,我遇到了错误。

Driver info: driver.version: FirefoxDriver
org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/usr/bin/firefox) on port 7055; process output follows:
Xlib: extension "RANDR" missing on display ":1".
process 20275: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a backtrace
Xlib: extension "RANDR" missing on display ":1".
process 20300: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open "/var/lib/dbus/machine-id": No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a backtrace

Build info: version: '2.45.0', revision: '5017cb8e7ca8e37638dc3091b2440b90a1d8686f', time: '2015-02-27 09:10:26'
System info: host: 'prod', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-431.1.2.0.1.el6.x86_64', java.version: '1.7.0_65'

生产环境:

1) 下载firefox-35.0.1

[prod@prod ~]$ ls /usr/local/
bin etc firefox firefox-35.0.1.tar.bz2 games include lib lib64 libexec sbin share src

2) 软链接(soft link)到/usr/bin/firefox

[prod@prod ~]$ ll /usr/bin/firefox 
lrwxrwxrwx 1 root root 26 Jun 11 15:59 /usr/bin/firefox -> /usr/local/firefox/firefox
[prod@prod ~]$

3)冉Xvfb

[prod@prod ~]$ ps ax |grep Xvfb
15425 ? S 0:00 sudo Xvfb +extension RANDR :1 -screen 0 1024x768x24
15426 ? S 0:00 Xvfb +extension RANDR :1 -screen 0 1024x768x24
23102 pts/6 S+ 0:00 grep Xvfb

测试环境:

[root@vc-stage ~]# ll /usr/bin/firefox 
lrwxrwxrwx 1 root root 26 May 24 21:32 /usr/bin/firefox -> /usr/local/firefox/firefox
[root@stage ~]#
[root@stage ~]# ls /usr/local/
bin etc firefox firefox-35.0.1.tar.bz2 games include lib lib64 libexec sbin share src
[root@stage ~]#
[root@stage ~]# ps ax | grep Xvfb
3899 pts/5 S+ 0:00 grep Xvfb
27393 ? S 0:01 Xvfb +extension RANDR :1 -screen 0 1024x768x24
[root@stage ~]#

测试和产品之间的唯一区别是;在测试中,我从根用户运行所有内容。在产品中,我由 sudo 用户运行。

更新:错误消息已消失,没有任何更改,呃。现在,它根本不创建 firefox 驱动程序。

最佳答案

一切都很好。生产中缺少 1 个软件包 - “dbus”。安装并配置该包后,一切正常。

关于linux - Selenium 2.45 与 Firefox 35.0.1 无法仅在生产中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30779378/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com