CasperJS 和 Slimerjs - Xlib:在显示器“:99”上缺少扩展名“RANDR”

6

我正在尝试使用Slimerjs运行Casperjs。

  • 我已经安装了SlimerJS 0.10.2
  • 我已经安装了Mozilla Firefox 45.5.1(也尝试过50)
  • 我已经安装了CasperJS 1.1.3
  • 我已经安装了xvfb 1.17.4

在Centos 6.8上运行时,当我尝试从php运行casperjs+slimerjs时,出现以下情况:

Gecko error: it seems /usr/bin/firefox is not compatible with SlimerJS.
See Gecko version compatibility. If version is correct, launch slimerjs
with --debug=true to see Firefox error message

当我尝试使用debug=true从控制台运行脚本,如下所示: /usr/local/bin/casperjs /tmp/casperjs-5cn484 --debug=true --engine=slimerjs (我也尝试过使用xvfb-run
我得到了以下错误信息:
Xlib:  extension "RANDR" missing on display ":99".
process 5588: 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
Redirecting call to abort() to mozalloc_abort

/usr/lib/node_modules/slimerjs/src/slimerjs: line 167:  5588 Segmentation fault      "$SLIMERJSLAUNCHER" -app "$SLIMERDIR/application.ini" $PROFILE -no-remote "$@"

如果我运行slimerjs --debug=true,会得到以下错误信息: Error: cannot open display: :1.1 Gecko error: it seems /usr/bin/firefox is not compatible with SlimerJS. See Gecko version compatibility. If version is correct, launch slimerjs with --debug=true to see Firefox error message 我已经尝试了很多解决方案,例如:
  • 尝试: Xvfb :1 -screen 0 1024x768x24 +extension RANDR &export DISPLAY=:1(也用了:99)
  • 尝试 export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
  • 升级、降级Firefox版本
  • 检查是否存在字体,有一个,所以没有问题
我不知道我还在尝试什么,有什么建议吗?:)

pkill [X,x]vfb; pkill nw; Xvfb :1 -screen 1 1440x900x24 >/dev/null 2>&1 & - user4535610
export DISPLAY=:1.1 - user4535610
1
看起来这样做可以解决问题,但实际上并没有。还有其他建议吗?带更多细节的编辑后再次提交。 - Apoleo
2个回答

0

-1

你看到了这个问题吗?显然你应该:

更改src/application.ini中的最大版本 MaxVersion=45.*

我不确定xrandr错误,但它似乎与此无关。可能是实验或误导。

还有一个DBUS错误可能会导致后续的分段错误。

我建议你逐步检查它:

  • 确保Firefox正在工作
    • X forwarding可能会有所帮助,它会在本地显示远程Firefox窗口
  • 确保Firefox在无头模式下工作
  • 使用slimerjs检查
  • 使用你的PHP包装脚本检查

我已经检查了版本问题,它非常老旧,现在默认值已经是50.*。 - Apoleo

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接