Skip to content

Pak not working with RStudio R-Universe #302

Closed

Description

@MilesMcBain

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"
    )
)

Activity

  1. MilesMcBain commented on May 27, 2021

    @MilesMcBain
    Author

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

  2. gaborcsardi commented on May 27, 2021

    @gaborcsardi
    Member

    You probably need to update the metadata cache:

    pak::meta_update()
    
  3. jeroen commented on May 27, 2021

    @jeroen
    Member

    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?

  4. MilesMcBain commented on May 27, 2021

    @MilesMcBain
    Author

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

  5. gaborcsardi commented on May 28, 2021

    @gaborcsardi
    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.)

  6. jeroen commented on May 28, 2021

    @jeroen
    Member

    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

  7. gaborcsardi commented on May 28, 2021

    @gaborcsardi
    Member

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

  8. gaborcsardi commented on May 28, 2021

    @gaborcsardi
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions