r - Chrome debugging port not open after 10 seconds
问题描述
I am using following code: It works good on local system and one unix server, but fails on another server. Any idea what I might need to do
> library(chromote)
> set_default_chromote_object(
Chromote$new(browser = Chrome$new(args = "--no-sandbox"))
and I am getting following error:
Chrome debugging port not open after 10 seconds.
解决方案
Two things you can check:
On the server in question, start chrome and go to
chrome://version/
. Search the Command Line: section and make sure--enable-logging
is in there.Strat R on the server in question, and do:
library(chromote)
debug(chromote:::launch_chrome)
Now run that R-code in as normal and when it stops and waits for input, hit n
and then enter and repeat hitting enter until you get to the lines you link to on github. After line 87
when output gets defined, type output
on the terinal and hit enter. Inspect the output and make sure that it actually conatins the lines DevTools listening on ws://
. If it does not, see if there are other ways that logging text identifies the port it listens to. If so, I would git clone that package, go in and change the way it discovers the port number and modify the package that runs for that server.
Running Chrome without X server
There are two viable options here:
- vnc
- X.org dummy driver
Here is the VNC recipe:
1: VNC
a. sudo dnf install tigervnc-server
(for centos 8), sudo yum install tigervnc-server
(for centos 7)
b. vncserver :1 (or some other suitable number)
c. DISPLAY=:1 R # and run R code to launch chrome etc.
Now you can connect from your client and see that chrome runs as it should:
vncviewer centos.ip.address:1
2: X.org dummy
I have never done this myself, but in theory it should be straight forward if you read docs and follow a tutorial.
推荐阅读
- reactjs - 如何在单个二进制文件中使用 ReactJS GUI 构建 Go 应用程序?
- ssis - 跨域访问共享文件夹时,SSIS 包无法使用 SQL 作业执行
- excel - 如何引用旧版本的 VBA 库?
- java - 骆驼:ClassCastException:DefaultMessage 无法转换为类 SnmpMessage
- angular - 使用 Firebase 将子集合查询到文档中
- python - 如何将数据从字典检索到表?
- javascript - 这个结构有名字吗?它是否一直被支持?
- php - sFetch 以指定字段为实体的数据
- android - 请解释FirebaseRecyclerOption的用法
- http - Jmeter HTTP 示例 HTML 报告生成