R - package otpr - no trip found - r

Using R and the package otpr I am trying to run the example
library(otpr)
otpcon <- otp_connect()
otp_get_distance(
otpcon,
fromPlace = c(53.48805,-2.24258),
toPlace = c(53.36484,-2.27108)
)
but i get the error
$errorId
[1] 404
$errorMessage
[1] "No trip found. There may be no transit service within the maximum specified distance or at the specified time, or your start or end point might not be safely accessible."
$query
[1] "http://localhost:8080/otp/routers/default/plan?fromPlace=53.48805,-2.24258&toPlace=53.36484,-2.27108&mode=CAR"
the example I am trying to run is take from here:
https://cran.r-project.org/web/packages/otpr/readme/README.html
Does anyone have an idea about what could be going wrong?
Tried deinsalling an reinstalling all java. Then i get the error
Fejl i otp_connect() :
Router http://localhost:8080/otp/routers/default does not exist. Error code Error in curl::curl_fetch_memory(make_url(x)) :
Failed to connect to localhost port 8080: Connection refused

Related

devtools::install_github error: SEC_E_UNTRUSTED_ROOT - The certification chain was issued by an entity that is unreliable

I am trying to install an package from behind a corporate (fire)wall using devtools:
library(devtools)
devtools::install_github("aryoda/tryCatchLog")
I get an error message:
Error: Failed to install 'unknown package' from GitHub: schannel:
next InitializeSecurityContext failed: SEC_E_UNTRUSTED_ROOT (0x80090325)
- The certification chain was issued by an entity that is unreliable.
The reason seems to be the used curl package which produces the same error with:
library(curl)
curl::curl_fetch_memory("https://httpbin.org/get")
How can I fix this?
PS: I am using MS Windows 10
I have found the solution:
The internet connection does only work within curl if you set the correct HTTPS_PROXY:
# insert your correct domain name and IP port here
Sys.setenv(https_proxy = "http://httpproxy.mycompany.com:1234")
This devtools issue comment did help me:
https://github.com/r-lib/devtools/issues/1610#issuecomment-333344548
Update 1:
This is a generic solution to set the HTTP(S)_PROXY in R:
requires(curl)
requires(devtools)
proxy <- curl::ie_get_proxy_for_url("https://www.qwant.com/")
Sys.setenv(https_proxy=proxy)
# Sys.setenv(http_proxy=proxy) # you could also set an HTTP proxy
devtools::install_github("aryoda/tryCatchLog") # should work now
You could add this line to your Rprofile.site file (in R/etc folder)

HOW TO FIX Error in .Hub("AnnotationHub", hub, cache, proxy, localHub, ...)

I am using REMP package in R to find methylation in repetitive elements. I have stumbled upon the function initREMP, which is giving me the error:
remparcel <- initREMP(arrayType = "EPIC", REtype = "Alu", ncore = 1)
Start Alu annotation data initialization ... (0 sec.)
Illumina platform: EPIC
Error in .Hub("AnnotationHub", hub, cache, proxy, localHub, ...) :
Local database does not exist.
Repeat call with 'localHub=FALSE'
I installed annotationhub package from the bioconductor and tried the function again. Still the error remains.
Finally I got the answer.If you are working behind a proxy server getAnnotationHub function will not be able to make connection with the URL.Therefor we have to set the proxy using
library(AnnotationHub) setAnnotationHubOption("PROXY","https://username:password#proxy:port")
then try the
AnnotationHub( hub=getAnnotationHubOption("URL"),
cache=getAnnotationHubOption("CACHE"),
proxy=getAnnotationHubOption("PROXY"),
localHub=FALSE)

Unable to establish connection to http:/controller:8774/v2.1/flavors/detail

Openstack version - pike
Installation process - multinode kolla
I am observing an error as Unable to establish connection to http://controller:8774/v2.1/flavors/detail. Also, it gives error as " keystoneauth1.exceptions.connection.ConnectFailure" However, this error is not regular and that is why I am not finding an exact solution. Can anybody help what can be the issue?
I tried changing the timeout values but still observing the errors.

Problems with connecting to local postgres database from R through RPostgreSQL

I have to following code
drv <- RPostgreSQL::PostgreSQL()
con <- DBI::dbConnect(drv, dbname = 'dbname', user = 'user',
host = 'host.name', port = 5432, password = 'password')
When I run it on server (Ubuntu server 16.04 with latest updates) running the database I get the following error:
Error in .valueClassTest(ans, "data.frame", "dbGetQuery") :
invalid value from generic function ‘dbGetQuery’, class “NULL”, expected “data.frame”
But when I run R from commandline with sudo, it works, when I run it from different my laptop connecting to the DB on the server it also works. So it shouldn't be connection problem. I am thinking about problem with access rights to some libraries/executables/configs on the system? Any help will be appreciated.
When I run the dbConnect multiple times and it ends with the error, when I run drv_info <- RPostgreSQL::dbGetInfo(drv), I still get multiple connectionIds in the drv_info:
drv_info <- RPostgreSQL::dbGetInfo(drv)
> drv_info
$drvName
[1] "PostgreSQL"
$connectionIds
$connectionIds[[1]]
<PostgreSQLConnection>
$connectionIds[[2]]
<PostgreSQLConnection>
$fetch_default_rec
[1] 500
$managerId
<PostgreSQLDriver>
$length
[1] 16
$num_con
[1] 2
$counter
[1] 2
Found a source of confusion, but not necessarily the root problem. (I was assuming RPostgres, while you are using RPostgreSQL (github mirror).)
If you check the source, you'll find that the method is calling postgresqlNewConnection, which includes a call to dbGetQuery. The problem you're seeing is that your call to dbConnect is failing (my guess is at line 100) and returns something unexpected, but postgresqlNewConnection continues.
I see three options for you:
try calling dbConnect(..., forceISOdate=FALSE) to bypass that one call to dbGetQuery (note that this doesn't fix the connection problem, but it at least will not give you the unexpected query error on connection attempt);
raise an issue for the package maintainers; or
switch to using RPostgres, still DBI-based and actively developed (it looks like RPostgreSQL has not had significant commits in the last few years, not sure if that's a sign of good code stability or development stagnation)
One lesson you may take from this is that you should check the value returned from dbConnect; if is.null(con), something is wrong. (Again, this does not solve the connection problem.)

Error in Curl when using geojson_read command in R

My situation is I wrote an R script using a university windows computer and emailed the file to myself. The first and second time I ran the script it was working perfectly, however, I started having the following error on the third run.
I figured out the line causing the problem and the error message:
> mapdt <-
> geojson_read("http://maperic.clst.org/wupl/Stuff/gz_2010_us_040_00_500k.json",
> what = "sp")
Error in curl::curl_fetch_disk(url, x$path, handle = handle) :
Timeout was reached
I have tried http_proxy method in this link, and it was not working properly. I have the same problem in two different network environment.
Thank you.

Resources