I'm currently unable to install R github packages using devtools. I get the same error no matter which github package I try to install. Here's one example.
devtools::install_github("clauswilke/ggtextures")
Error in curl::curl_fetch_memory(url, handle = h) : Timeout was reached: Resolving timed out after 10000 milliseconds
Is this an issue with R or my local home WiFi? Local home WiFi has been acting weird although I am able to post this and watch YouTube videos. If I type in a new website address Chrome sometimes takes 5-10 seconds before the site appears. Then it's blazing fast from that point on. Strange.
This sounds like a DNS issue? Maybe? Something else? Where do I even begin?
[EDIT] I'm trying @hrbrmstr suggestion which is shown below. So do I juat change to OpenDNS to solve this issue? If that's the best solution I will and report back. Thank you for the help and I think it will educate some on more of R's tool. Definite upvote from me.
OS = Ubuntu 18.04
# docall(...)
host user.self sys.self elapsed user.child sys.child result
2 github.com 0.004 0.004 15.007 0 0 192.30.253.112
21 stackoverflow.com 0.003 0.000 5.005 0 0 151.101.193.69
3 google.com 0.000 0.000 0.040 0 0 172.217.15.78
4 yahoo.com 0.001 0.000 0.040 0 0 72.30.35.10
5 www.this-wont-resolve.com 0.003 0.001 0.267 0 0 Error
6 cisco.com 0.001 0.000 0.041 0 0 72.163.4.185
7 bankofamerica.com 0.002 0.000 5.005 0 0 171.159.228.150
8 apple.com 0.000 0.003 5.005 0 0 17.142.160.59
9 microsoft.com 0.001 0.001 5.003 0 0 40.76.4.15
10 curl.haxx.se 0.001 0.000 0.061 0 0 151.101.250.49
.
# pingr::ping(...)
ping: bad linger time.
[,1] [,2] [,3]
github.com NA NA NA
stackoverflow.com NA NA NA
google.com NA NA NA
yahoo.com NA NA NA
cisco.com NA NA NA
time.apple.com NA NA NA
.
# install.packages("speedtest")
Warning in install.packages :
package ‘speedtest’ is not available (for R version 3.5.1)
(This won't solve your problem so it technically isn't an answer but it's also too long for a comment…SO pedants can feel free to downvote)
While SO is not an internet connection tech support forum, we can give you some R tools to triage your connection.
I know have the curl
package installed since you are trying to use devtools
so give this a go:
do.call(
rbind.data.frame,
lapply(
c(
"github.com", "stackoverflow.com", "google.com", "yahoo.com",
"www.this-wont-resolve.com", "cisco.com", "bankofamerica.com",
"apple.com", "microsoft.com", "curl.haxx.se"
),
function(x) {
clock <- system.time(res <- try(curl::nslookup(x), silent = TRUE), gcFirst = FALSE)
clock <- as.list(clock)
clock <- c(host = x, clock, result = if (inherits(res, "character")) res else "Error")
clock
}
)
)
On my system ^^ produces:
## host user.self sys.self elapsed user.child sys.child result
## 2 github.com 0.000 0.000 0.001 0 0 192.30.253.113
## 21 stackoverflow.com 0.001 0.000 0.001 0 0 151.101.65.69
## 3 google.com 0.000 0.000 0.001 0 0 172.217.10.142
## 4 yahoo.com 0.000 0.001 0.001 0 0 72.30.35.9
## 5 www.this-wont-resolve.com 0.071 0.002 0.073 0 0 Error
## 6 cisco.com 0.000 0.000 0.001 0 0 72.163.4.185
## 7 bankofamerica.com 0.001 0.000 0.000 0 0 171.159.228.150
## 8 apple.com 0.000 0.001 0.001 0 0 17.142.160.59
## 9 microsoft.com 0.001 0.000 0.001 0 0 40.113.200.201
## 10 curl.haxx.se 0.000 0.000 0.001 0 0 151.101.118.49
What it is doing is using your operating system's resolver libraries to make DNS lookups the way curl
does (and hence httr
/rvest
and the devtools
network-based installers). You can get timings and also see if there are errors. There is a deliberate host that doesn't resolve in the provided list. Feel free to add more.
That should give you an idea of whether there are issues with resolving in general.
If you have pingr
installed, you can do:
t(sapply(
c(
"github.com", "stackoverflow.com", "google.com",
"yahoo.com", "cisco.com", "time.apple.com"
),
function(x) {
res <- try(pingr::ping(destination = x, count = 3, timeout = 5))
}
))
which, on my system, returns:
## [,1] [,2] [,3]
## github.com 30.095 23.964 31.652
## stackoverflow.com 16.524 13.529 20.790
## google.com 30.743 22.004 22.333
## yahoo.com 34.450 33.070 40.198
## cisco.com 67.215 74.290 96.568
## time.apple.com 110.832 88.482 87.582
That should give you a basic idea of how well basic network ops to the internet are going. Super high values are bad.
If you have speedtest
installed, you can do:
speedtest::spd_test()
from an R console or:
Rscript -e 'speedtest::spd_test()'
from a command-line/terminal prompt and it'll give you output like:
## Gathering test configuration information...
## Gathering server list...
## Determining best server...
## Initiating test from Comcast Cable (###.###.###.###) to Otelco (Portland, ME)
##
## Analyzing download speed..........
## Download: 166 Mbit/s
##
## Analyzing upload speed......
## Upload: 7 Mbit/s
(yes, we have horribad internet in rural Maine)
I can post some more troubleshooting info later. Knowing what OS you use would be helpful.
NOTE: that some of the behvaviour you're describing is indicative of numerous malware strains that hijack DNS on systems (which is another reason I'm trying to help).