-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
port = 4567 is already in use #19
Comments
Thanks for opening this issue!
|
This is the culprit. https://github.com/yonicd/carbonate/blob/master/R/selenium_functions.R#L44 @ColinFay is there a way to find an open port? |
There is an internal function in shiny and markdown that does that. There are also a bunch of node js packages that do that so might be worth checking how they do it too. |
this commit bb0fd55 should solve the issue. ht to @dpastoor for pointing to how {fiery} finds a port. in practice the user wont feel the change, but there is now a random port being selected on a new one or a specific one can be reset using
|
You can also try with |
I mean, if the port is not available, switch to a random port (if 4567 is important, if it's not, default to |
Is there a way to release unused ports along same lines of gc()? Or does that happen anyways with RSelenium/wdman? |
Unfortunately it still doesn't work for me, see below : library(carbonate)
x <- carbon$new('x <- 1')
x$carbonate()
#> starting chrome session...
#> checking chromedriver versions:
#> BEGIN: PREDOWNLOAD
#> BEGIN: DOWNLOAD
#> BEGIN: POSTDOWNLOAD
#> Error in wdman::selenium(port = port, verbose = verbose, version = version, : Selenium server signals port = 25855 is already in use.
x$carbonate()
#> starting chrome session...
#> Error in wdman::selenium(port = port, verbose = verbose, version = version, : Selenium server signals port = 25855 is already in use.
x <- carbon$new('x <- 1')
x$carbonate()
#> starting chrome session...
#> checking chromedriver versions:
#> BEGIN: PREDOWNLOAD
#> BEGIN: DOWNLOAD
#> BEGIN: POSTDOWNLOAD
#> Error in wdman::selenium(port = port, verbose = verbose, version = version, : Selenium server signals port = 30318 is already in use. Created on 2020-02-24 by the reprex package (v0.3.0) |
thanks for the feedback. i'll try again :) interesting though that you are landing on unavailable ports that are chosen at random |
i thought it may be the reperex envir ... but it's not library(carbonate)
x <- carbon$new('x <- 1')
#> Set via '~/carbon.yml'
#> palette:
#> - 171.0
#> - 175.0
#> - 195.0
#> - 0.7
#> template: panda-syntax
#> font_family: Fira Code
#> padding_vertical: 11
#> padding_horizontal: 14
#> language: r
x$carbonate()
#> starting chrome session...
#> checking chromedriver versions:
#> BEGIN: PREDOWNLOAD
#> BEGIN: DOWNLOAD
#> BEGIN: POSTDOWNLOAD Created on 2020-02-24 by the reprex package (v0.3.0) |
i see that wdman is 0.2.4 for you, i am using 0.2.5. sessioninfo package * version date lib source
askpass 1.1 2019-01-13 [1] CRAN (R 3.6.0)
assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0)
binman 0.1.1 2018-07-18 [1] CRAN (R 3.6.0)
bitops 1.0-6 2013-08-17 [1] CRAN (R 3.6.0)
caTools 1.17.1.2 2019-03-06 [1] CRAN (R 3.6.0)
curl 4.3 2019-12-02 [1] CRAN (R 3.6.0)
httr 1.4.1 2019-08-05 [1] CRAN (R 3.6.0)
jsonlite 1.6.1 2020-02-02 [1] CRAN (R 3.6.0)
mime 0.9 2020-02-04 [1] CRAN (R 3.6.0)
openssl 1.4.1 2019-07-18 [1] CRAN (R 3.6.0)
processx 3.4.2 2020-02-09 [1] CRAN (R 3.6.1)
ps 1.3.2 2020-02-13 [1] CRAN (R 3.6.1)
R6 2.4.1 2019-11-12 [1] CRAN (R 3.6.0)
rappdirs 0.3.1 2016-03-28 [1] CRAN (R 3.6.0)
Rcpp 1.0.3 2019-11-08 [1] CRAN (R 3.6.1)
RSelenium 1.7.7 2020-02-03 [1] CRAN (R 3.6.1)
semver 0.2.0 2017-01-06 [1] CRAN (R 3.6.0)
sys 3.3 2019-08-21 [1] CRAN (R 3.6.1)
wdman 0.2.5 2020-01-31 [1] CRAN (R 3.6.0)
XML 3.98-1.20 2019-06-06 [1] CRAN (R 3.6.0)
xml2 1.2.2 2019-08-09 [1] CRAN (R 3.6.0)
yaml 2.2.1 2020-02-01 [1] CRAN (R 3.6.0)
[1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library
can you update and try again? |
After going through hell and back a handful of times I have R up to date with all latest package versions. An unfortunate difference is that I can't reprex anymore the example above from Rstudio, The call to reprex seems to complete but doesn't display anything, then any next instruction freezes forever and I have to kill RStudio. Apart from that I get same error message, I first had a different one though, which told me I had to update chrome to version 81. 81 is the beta version but updating to last available version was enough. From a clean Rgui session I get :
|
can you try this, just to see that the RSelenium wdman are connecting ok for you port <- httpuv::randomPort()
cDrv <- wdman::chrome(port = port)
rD <- RSelenium::rsDriver(
browser = "chrome",
verbose = TRUE,
chromever = 'latest',
port = port,
extraCapabilities = list(
chromeOptions = list(args = c("--disable-gpu", "--window-size=1280,800"),
prefs = list(
"profile.default_content_settings.popups" = 0L,
"download.prompt_for_download" = FALSE,
"download.directory_upgrade" = TRUE,
"safebrowsing.enabled" = TRUE,
"download.default_directory" = tempdir()
))
)
)
rD$client$navigate('https://github.com')
# to close the browser
rD$client$close()
# to close the server
rD$server$stop()
# stop the chrome process
cDrv$stop()
|
It fails :
|
ok. so this issue is for @juyeongkim at RSelenium issues https://github.com/ropensci/RSelenium/issues seems like the new version is not working well with winos. thanks for trying that script, hopefully he can help. |
Describe the bug
I get :
when running the simplest example
To Reproduce
contents of your _mrgconfig.yml file
Not sure where to find this
Expected behavior
open a browser to the carbon.js uri, create an image and download the file
Environment (please complete the following information):
Session Info
The text was updated successfully, but these errors were encountered: