I have set up an instance to use as a redis worker. All ports are open. When i issue
library("doRedis")
redisWorker(host="ZZZ-23-20-XXX-XXX.compute-1.amazonaws.com", queue="jobs")
i get the error
Error in socketConnection(host, port, open = "a+b", blocking = TRUE, timeout = timeout) :
cannot open the connection
In addition: Warning message:
In socketConnection(host, port, open = "a+b", blocking = TRUE, timeout = timeout) :
ZZZ-23-20-XXX-XXX.compute-1.amazonaws.com:6379 cannot be opened
Any ideas what could be going on? I have also used the inernal EC2 IP (10.XXX.XXX.ZZZ) still get the same error. The server is up, running and pingable
I am running latest and greatest of R, doRedis,Ubuntu 12.04 all fully updated. This has been discussed before but no solution found. doRedis with strange socket connection error in Ubuntu Linux, R, and RStudio
I have had similar issues although with registerDoRedis() as you cannot set a timeout and I believe the problem is with the timeout value used in the function 'redisConnect'.
In R if you run fix(redisConnect) and you can see the default for timeout is as follows:
redisConnect <- function (host = "localhost", port = 6379, returnRef = FALSE,
timeout = 2147483647L)
It seems this huge timeout value is causing the issue. To check change it on the line it is used from this:
con <- socketConnection(host, port, open = "a+b", blocking = TRUE,
timeout = timeout)
To this:
con <- socketConnection(host, port, open = "a+b", blocking = TRUE,
timeout = 30)
I find that works although as soon as you reload the package the change gets wiped. I just found this today so will submit a bug to the developer. I'm running R 2.15 on OSX by the way.
The function you are using should default to timeout 30, or you can try setting it on the function call to be sure rather than fix()'ing the underlying code.
Related
I'm trying to run a package in R that requires parallel processing (using xcms). I come across this error, which I am aware of other people experiencing (
Errors in makeCluster(multicore): cannot open the connection,
Error in parallel processing: port cannot be open,
Error in socketConnection(master, port = port, blocking = TRUE, open = "a+b", : cannot open the connection in Stan (from R) (the one most similar to mine that doesn't utilize a cluster/Linux and had no answer 7 years ago)
Error in socketConnection(port = port, server = TRUE, blocking = TRUE, : cannot open the connection
The only way I can get the code to run is through disabling parallel processing through
register(SerialParam())
I am using a Windows computer with 11 available cores. Any advice would be appreciated.
I am trying to connect to shinyapps via Rstudio using the setAccountInfo function in the rsconnect package:
rsconnect::setAccountInfo(name='MYACCOUNTNAME',
token='TOKEN',
secret='<SECRET>')
But I am getting the following error:
Error in function (type, msg, asError = TRUE) :
Failed to connect to api.shinyapps.io port 443: Timed out
I am in my office PC and one of the more likely problems would be the firewall of the enterprise, so my questions would be:
Is there a way to workaround this problem and connect anyway?
If not, what would be the instruction I would have to give the IT department to be capable of connecting?
The following options should help you see whats happening:
library(rsconnect)
options(rsconnect.http.trace = TRUE, rsconnect.error.trace = TRUE, rsconnect.http.verbose = TRUE)
rsconnect::setAccountInfo(name='MYACCOUNTNAME',
token='TOKEN',
secret='<SECRET>')
By running this you should see what IP addresses rsconnect is trying to use. Try adding this to a whitelist for your firewall.
If this doesn't work it may be a proxy issue. Issue setting up my shinyapps.io + AUTHORIZE ACCOUNT + time out port 443 This should help set up a proxy in rStudio.
I am trying to connect Rstudio to Presto connectivity and am
receiving the error below. Please help me with support on this issue.
Error in curl::curl_fetch_memory(url, handle = handle) :
Empty reply from server
I am using the below steps, submitting the code to an Rstudio application:
library(RPresto)
library(dbConnect)
conn <- dbConnect(Presto(), catalog = 'ares', schema = 'default',
user = 'onur', host = 'localhost', port = 443,
session.timezone='US/Eastern')
dbListTables(conn, '%_iris')
dbDisconnect(conn)
I am totally new to Redis and relatively new to R. I need to do an assignment, where I first need to connect to a socket (it streams key-values for stocks).
I installed Redis in my mac using homebrew, and then the package rredis in R.
Everytime I try to connect to local host I get the following error:
redisConnect()
Warning message:
In .openConnection(host = host, port = port, nodelay = nodelay, :
Unable to set nodelay.
If I set nodelay = F
I get connected
Now, I am trying to connect to a specific socket (ip: 88.99.38.191, port:1337)
I get this
redisConnect(host = "88.99.38.191", port = 1337)
Error: Error in doTryCatch(return(expr), name, parentenv, handler):
Unknown message type
Warning message:
In .openConnection(host = host, port = port, nodelay = nodelay, :
Unable to set nodelay.
and if I try to set nodelay = F :
> redisConnect(host = "88.99.38.191", port = 1337, nodelay = F)
Error: Error in doTryCatch(return(expr), name, parentenv, handler): Unknown message type
Warning messages:
1: closing unused connection 12 (->localhost:6379)
2: closing unused connection 11 (->localhost:6379)
3: closing unused connection 10 (->localhost:6379)
4: closing unused connection 9 (->localhost:6379)
Does anyone have anyidea what I do wrong? All guides/ tutorials that I have seen in the web have no problem in default settings of nodelay = T
ps: Please forgive my ignorance, or I there is anysimilar post, I didn't manage to find any.
For those interested the connection to socket is established like this
con <- socketConnection(host="88.99.38.191", port = 1337, blocking=T,
server=FALSE, open="r+")
it has nothing to do with redis. Redis is listening to a local ip, while redisConnect is used in order to connect to remote redis server.
Additional info can be found here.
Currently following instructions from rblpapi-intro.Rmd (version date: 2015-08-13) I am wondering why:
library(Rblpapi)
blpConnect()
returns:
17FEB2016_14:27:17.296 7432:8884 ERROR
blpapi_platformtransporttcp.cpp:671 blpapi.session.transporttcp.{3}.
<localhost:8194> Connection failed
17FEB2016_14:27:17.296 7432:8884 WARN blpapi_platformcontroller.cpp:371
blpapi.session.platformcontroller.{3} Platform: 0 failed 1 consecutive
connect attempts, stopped trying to reconnect.
Error: Failed to start session.
given the below default values:
ip: 127.0.0.1
port: 8194
Factually, there is nothing wrong with those values as I've used them in Matlab using con=blp(port,ip2,time) and the connection succeeds perfectly.
EDIT:
The below function has finally worked! a bit weird, as I override the default ip value from blpConnect() by the same value.
blpConnect(host = getOption("blpHost", "127.0.0.1"),
port = getOption("blpPort", 8194L), default = TRUE)
Thus it looks like blpConnect() did'nt pointed to the default ip and port values for some reasons.