goldingn / versions

Query and Install Specific Versions of Packages on CRAN
Other
24 stars 7 forks source link

Not processing MRAN redirect #18

Closed shalgrim closed 6 years ago

shalgrim commented 6 years ago

When I try to install.versions now it doesn't download the MRAN index appropriately. Probably because there's a redirect at that server now?

It should be going to https://cran.microsoft.com/snapshot/ now I think..

Here's where my debugging got me. Note that url.lines returns nothing like what is at the new URL (and also complains about an incomplete final line):

debugging in: scrape.index.dates(url)
debug: {
    lines <- url.lines(url)
    lines <- lines[grep("^<a href=\"*", lines)]
    lines <- gsub(".*href=\"([^\"]+)\".*", "\\1", lines)
    lines <- gsub("/$", "", lines)
    lines <- lines[nchar(lines) == 10]
    return(rev(lines))
}
Browse[2]>
debug: lines <- url.lines(url)
Browse[2]>
debug: lines <- lines[grep("^<a href=\"*", lines)]
Browse[2]> lines
[1] "<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><title>Home</title><base href=\"/\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"assets/img/favicon.png\"/><!-- Google Webfonts --><link href=\"assets/fonts/googleapis.css\" rel=\"stylesheet\" type=\"text/css\"/><!-- Glyphicons --><link href=\"assets/glyphicons/glyphicons-css/glyphicons.css\" rel=\"stylesheet\"/><link href=\"assets/glyphicons/glyphicons-css/social.css\" rel=\"stylesheet\"/><link href=\"styles.27a8256437ca377e8a7b.bundle.css\" rel=\"stylesheet\"/></head><body><my-app></my-app><!--<div data-uv-embed=\"post_idea\"></div>--><script type=\"text/javascript\" src=\"inline.496a82eba2769f023ed5.bundle.js\"></script><script type=\"text/javascript\" src=\"polyfills.649e24d2385c777caa70.bundle.js\"></script><script type=\"text/javascript\" src=\"scripts.da6de8bbb6199d9ca04b.bundle.js\"></script><script type=\"text/javascript\" src=\"vendor.fece4bac559864930f79.bundle.js\"></script><script type=\"text/javascript\" src=\"main.b8e959ca419d895af7d9.bundle.js\"></script></body></html><!--User Voice Widget Integration--><!--<script src=\"assets/scripts/user-voice-widget.js\"></script>-->"
Warning message:
In readLines(file, encoding = "UTF-8") :
  incomplete final line found on '/tmp/RtmpFJetTE/file22336f89299b'
goldingn commented 6 years ago

Thanks @shalgrim!

I can't replicate this though. I'm not sure what command you issued, but I just tried:

versions::install.versions("glue", "1.1.1")

and it installed the old version just fine.

It looks like the old MRAN.revolutionanalytics.com is being redirected to cran.microsoft.com (for now at least) and on my system (macOS 10.12.6, R 3.4.1) it isn't causing a conflict. It could be that they didn't have the redirect up correctly when you posted this, or it could be that different OSs and versions of R handle redirects differently (I know recent R versions have changed usage of libcurl).

Could you please check whether this is still failing, post the failing install.versions() command, and post the output of sessionInfo() so I can try to debug?

I should change the URL anyway, I'll open that as an issue for now until we can work out what's up with this error.

shalgrim commented 6 years ago

Thanks @goldingn!

This actually started working again later the same day I posted it. I should have updated that here.

Thanks for opening the other issue.