首页 > 解决方案 > 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.

标签: r

解决方案


Two things you can check:

  1. 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.

  2. 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:

  1. vnc
  2. 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.


推荐阅读