-
Notifications
You must be signed in to change notification settings - Fork 153
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
"cannot open URL" with remotes::install_github() #130
Comments
This is coming from Unfortunately there is not much we can do about it in remotes, other than maybe trying to a different download method, or try multiple methods. But for that we would need to be able to recreate your problem, so some questions:
|
Your intuition was right. It appears to be influenced by the 'method' parameter in
What would be helpful for me to do next? source_url <- "https://api.github.com/repos/yihui/testit/zipball/master"
capabilities("libcurl")
# libcurl
# TRUE
utils::download.file(source_url, destfile="aa.zip", method="libcurl")
# trying URL 'https://api.github.com/repos/yihui/testit/zipball/master'
# Content length 16294 bytes (15 KB)
# downloaded 15 KB 'method' values that failutils::download.file(source_url, destfile="aa.zip")
# trying URL 'https://api.github.com/repos/yihui/testit/zipball/master'
# Error in utils::download.file("https://api.github.com/repos/yihui/testit/zipball/master", :
# cannot open URL 'https://api.github.com/repos/yihui/testit/zipball/master'
# In addition: Warning message:
# In utils::download.file("https://api.github.com/repos/yihui/testit/zipball/master", :
# InternetOpenUrl failed: 'A connection with the server could not be established'
utils::download.file(source_url, destfile="aa.zip", method="wininet")
# trying URL 'https://api.github.com/repos/yihui/testit/zipball/master'
# Error in utils::download.file("https://api.github.com/repos/yihui/testit/zipball/master", :
# cannot open URL 'https://api.github.com/repos/yihui/testit/zipball/master'
# In addition: Warning message:
# In utils::download.file("https://api.github.com/repos/yihui/testit/zipball/master", :
# InternetOpenUrl failed: 'A connection with the server could not be established'
utils::download.file(source_url, destfile="aa.zip", method="internal")
# Error in utils::download.file("https://api.github.com/repos/yihui/testit/zipball/master", :
# scheme not supported in URL 'https://api.github.com/repos/yihui/testit/zipball/master'
utils::download.file(source_url, destfile="aa.zip", method="wget")
# Error in utils::download.file("https://api.github.com/repos/yihui/testit/zipball/master", :
# 'wget' call had nonzero exit status
# In addition: Warning message:
# running command 'wget "https://api.github.com/repos/yihui/testit/zipball/master" -O "aa.zip"' had status 127
utils::download.file(source_url, destfile="aa.zip", method="curl")
# Error in utils::download.file("https://api.github.com/repos/yihui/testit/zipball/master", :
# 'curl' call had nonzero exit status
# In addition: Warning message:
# running command 'curl "https://api.github.com/repos/yihui/testit/zipball/master" -o "aa.zip"' had status 127
utils::download.file(source_url, destfile="aa.zip", method="auto")
# trying URL 'https://api.github.com/repos/yihui/testit/zipball/master'
# Error in utils::download.file("https://api.github.com/repos/yihui/testit/zipball/master", :
# cannot open URL 'https://api.github.com/repos/yihui/testit/zipball/master'
# In addition: Warning message:
# In utils::download.file("https://api.github.com/repos/yihui/testit/zipball/master", :
# InternetOpenUrl failed: 'A connection with the server could not be established' |
In FWIW, I can't reproduce the issue on my windows computer, but I am on windows 10. Could it come from a different behaviour of wininet between different version of windows? One solution could be to check for libcurl availability by default but it was the previous behaviour that did not allowed windows proxy behavior offered by wininet. Reprexwith defaultstmp_zip <- tempfile(fileext = ".zip")
source_url <- "https://api.github.com/repos/yihui/testit/zipball/master"
utils::download.file(source_url, destfile=tmp_zip)
file.exists(tmp_zip)
#> [1] TRUE with wininet explicitlytmp_zip <- tempfile(fileext = ".zip")
source_url <- "https://api.github.com/repos/yihui/testit/zipball/master"
utils::download.file(source_url, destfile=tmp_zip, method = "wininet")
file.exists(tmp_zip)
#> [1] TRUE with auto from
|
@wibeasley I suspect that this is a TLS issue, GitHub does not support TLS v1 and v1.1 See e.g. https://githubengineering.com/crypto-deprecation-notice/ Older Windows systems only support TLS v1.x, so the system's builtin HTTP lib does not work with GitHub. It is possible that you can enable TLS v1.2 or you can download a patch from MS. E.g. https://cloudblogs.microsoft.com/microsoftsecure/2017/07/20/tls-1-2-support-added-to-windows-server-2008/ It depends on your windows version. To make this more robust, remotes could try a couple of methods, at least on windows trying |
I don't mind doing that or either of the two other solutions (eg, specifying "libcurl", or calling If you think I have a weird computer failing on a trivial issue, I'm happy to drop the issue. Or, if you think I have a canary in a coalmine, I'm happy to provide more info to help make In case this helps create a more dynamic/robust, here's info on the three machines. Notice the failing one isn't the oldest OS. I can't find a difference in these 'predictor' variables. Again, I don't care about this particular machine --but more about its value improving the robustness of Windows machine 1 (which fails):
Windows machine 2 (which works):
Windows machine 3 (which works):
Follow question:Ideas why I see a lot of Google hits for ""InternetOpenUrl failed: 'A connection with the server could not be established'". Is this why you guys avoided |
httr uses curl, which uses its own libcurl. I am pretty sure that this is the GH TLS issue. If you still have that problematic machine, can you please try to install TLS 1.2 support? Note that the next release of devtools will use remotes, so the devtools workaround will soon stop working. |
This guide recommended enabling TLS 1.2 in IE 10. That worked. But it's not very satisfying because when I then unchecked the box, it still worked. I'm guessing that checking the box the first time set something in the registry that helped I didn't see anything to install in that link above that applies to Windows 8. I think part of the complexity was that the machine can't be upgraded to Windows 8.1. This isn't my main computer, so again, I don't really care for my sake. But if there's something else I can run or do that might help you, please tell me. otherwise, I think this issue can be closed. |
Thanks! I don't think we can do much more here. |
Hi guys, if I can use utils::download.file(,method="libcurl") to download the file like wibeasley did, how can I install it? |
Worked... |
!!It's helped me a lot, thank you! xx !! |
cool ~ thank you very much |
Very cool ~ thanks |
just run: options(download.file.method = "libcurl") |
Hi! I think I'm having this same issue on Github Actions for my lares package, testing on ubuntu-16.04. When the action gets to the "Install system dependencies" section, this is the error I get:
|
Hi @laresbernardo, consider starting a new issue. The problem I encountered was closely related to how Windows supports/interacts with TLS. If you start a new issue, it won't have all the Windows-specific distractions. |
Sure @wibeasley |
I like this package. I was poking around from r-lib/remotes#130 (comment)
work for me |
I have a vanilla installation of Windows (no proxies or anything similar) where
remotes::install_github("yihui/testit")
won't work (it fails similarly for many other packages that do and don't require compilation). I've tried the two most recent patched versions of R (3.4.3 and 3.4.4) and both the CRAN and GitHub master version of remotes (the CRAN version predates the most recent changes to install-github.R). It's been throwing this error for at least a week.Furthermore, these same arrangements have been working fine on my other Windows machines. And working fine on this same machine with
devtools::install_github("yihui/testit")
. The error message isStepping through after declaring
debug(utils::download.file)
leads to the following misbehaving line, and I don't have the skills to debug once it cross the R-C boundary.I'm not seeing anything similar amoung the 18 SO hits. Is this something I should ask SO about instead? I'm not that worried for my own case, because I can keep using
devtools::install_github()
, but as more people migrate to remotes, this corner case might cause more problems.traceback
session info
The text was updated successfully, but these errors were encountered: