Skip to content
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

Pak not working with RStudio R-Universe #302

Closed
MilesMcBain opened this issue May 27, 2021 · 8 comments
Closed

Pak not working with RStudio R-Universe #302

MilesMcBain opened this issue May 27, 2021 · 8 comments

Comments

@MilesMcBain
Copy link

Originally raised as: r-universe-org/help#58

Compare these results:

> pak::pkg_install("bookdown")
v Loading global cached package metadata ... done

> Will update 1 package.
> Will download 1 package with unknown size.
+ bookdown 0.22 > 0.22.2 [dl]
? Do you want to continue (Y/n) Y
i Getting 1 pkg with unknown size
x Failed to download bookdown 0.22.2 (windows)
x Failed to download 1 package.
Error: Failed to download bookdown from `https://rstudio.r-universe.dev/bin/windows/contrib/4.0/bookdown_0.22.2.zip`.
Type .Last.error.trace to see where the error occurred


> install.packages('bookdown', repos = 'https://rstudio.r-universe.dev')
Installing package into 'C:/Users/msmcbain/libs/R'
(as 'lib' is unspecified)
trying URL 'https://rstudio.r-universe.dev/bin/windows/contrib/4.0/bookdown_0.22.3.zip'
Content type 'application/zip' length 1093613 bytes (1.0 MB)
downloaded 1.0 MB

package 'bookdown' successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\msmcbain\AppData\Local\Temp\Rtmp8uLg0e\downloaded_packages

For some reason pak is trying to download the zip file for the previous build (0.22.2) rather than latest (0.22.3)?

My repos config looks like this:

options(
  repos =
    c(
      CRAN = "https://cran.rstudio.com",
      rstudiopm = "https://packagemanager.rstudio.com/all/latest",
      ropensci = "https://ropensci.r-universe.dev",
      rlib = "https://r-lib.r-universe.dev",
      rstudio = "https://rstudio.r-universe.dev",
      tidyverse = "https://tidyverse.r-universe.dev"
    )
)
@MilesMcBain
Copy link
Author

Note that some packages in the universe seem to work. I also had the same issue with htmltools.

@gaborcsardi
Copy link
Member

You probably need to update the metadata cache:

pak::meta_update()

@jeroen
Copy link
Member

jeroen commented May 27, 2021

I have temporarily disabled caching of the PACKAGES file, until I figure out the proper solution. @MilesMcBain can you confirm the problem is now gone?

@MilesMcBain
Copy link
Author

Yep it seems to find the right zip file now. 👍

@gaborcsardi
Copy link
Member

@jeroen The web server could also emit a standard header to tell pak (pkgcache) not to cache the metadata. (If it doesn't already.)

@jeroen
Copy link
Member

jeroen commented May 28, 2021

I specifically wrote it so that it does do that, I think it is useful ;) But I understand now where the bug is. When a package in the database is updated to a new version, the creation timestamp of the original record is not changed, and I was using that as the etag. So I just need to fix that

@gaborcsardi
Copy link
Member

Right, there is a Cache-Control: no-cache there indeed. I'll need to update pkgcache to take that into account.

@gaborcsardi
Copy link
Member

Will be better with r-lib/pkgcache#63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants