Why can't renv find certain package versions?

86 Views Asked by At

I am trying out renv for the first time on a project. I set up the snapshot() locally just fine and now I'm building a docker image for the project and running into issues with a couple packages.

The project has a lot of dependencies, and almost all of them are installing without issue, but the particular version of data.table threw an error:

#19 379.3 - Downloading data.table from CRAN ...            ERROR [downloaded length 0 != reported length 166]
#19 380.5 Warning: failed to find source for 'data.table 1.14.6' in package repositories
#19 380.5 Warning: error downloading 'https://packagemanager.posit.co/cran/__linux__/jammy/latest/src/contrib/Archive/data.table/data.table_1.14.6.tar.gz' [downloaded length 0 != reported length 166]
#19 380.5 Error: failed to retrieve package '[email protected]'

The entry in the renv.lock file was:

     "data.table": {
       "Package": "data.table",
       "Version": "1.14.6",
       "Source": "Repository",
       "Repository": "CRAN",
       "Requirements": [
         "R",
         "methods"
       ],
      "Hash": "aecef50008ea7b57c76f1cb5c127fb02"
     },

Well, the current version of data.table is 1.14.10, so I updated and in the next build that went fine, but it has me a little concerned about the reliability of renv for old package versions. It defeats the purpose of a reproducible environment if specified package versions aren't available and must be updated. When I visit posit's package manager web client it lists data.table 1.14.6 in the archive, so why didn't it install?

Worth noting that I have not edited the renv.lock at all by hand. The current (working) entry is below. Are there particular items in this I should be checking? (Maybe the repository?)

"data.table": {
      "Package": "data.table",
      "Version": "1.14.10",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "methods"
      ],
      "Hash": "6ea17a32294d8ca00455825ab0cf71b9"
    },
0

There are 0 best solutions below