Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

renv::restore() ignores repositories set per package in the .lock file on a Linux VM #2081

Closed
Monkjj opened this issue Jan 28, 2025 · 2 comments

Comments

@Monkjj
Copy link

Monkjj commented Jan 28, 2025

When I use renv::restore() on my Linux VM (Ubuntu 24.04, R 4.3.3, renv 1.0.10), the program goes through all repositories set in the .lock file for each package that is recorded, ignoring the value set for repository at each package element. The .lock file looks like this (truncated):

{
  "R": {
    "Version": "4.3.3",
    "Repositories": [
      {
        "Name": "BioCsoft",
        "URL": "https://bioconductor.org/packages/3.18/bioc"
      },
      {
        "Name": "BioCann",
        "URL": "https://bioconductor.org/packages/3.18/data/annotation"
      },
      {
        "Name": "BioCexp",
        "URL": "https://bioconductor.org/packages/3.18/data/experiment"
      },
      {
        "Name": "BioCworkflows",
        "URL": "https://bioconductor.org/packages/3.18/workflows"
      },
      {
        "Name": "BioCbooks",
        "URL": "https://bioconductor.org/packages/3.18/books"
      },
      {
        "Name": "CRAN",
        "URL": "https://cloud.r-project.org"
      }
    ]
  },
  "Bioconductor": {
    "Version": "3.18"
  },
  "Packages": {
    "boot": {
      "Package": "boot",
      "Version": "1.3-29",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "graphics",
        "stats"
      ],
      "Hash": "a0cb8a465a115fd8460cab1a5b18a5f3"
    },
    "AnnotationDbi": {
      "Package": "AnnotationDbi",
      "Version": "1.64.1",
      "Source": "Bioconductor",
      "Requirements": [
        "Biobase",
        "BiocGenerics",
        "DBI",
        "IRanges",
        "KEGGREST",
        "R",
        "RSQLite",
        "S4Vectors",
        "methods",
        "stats",
        "stats4"
      ],
      "Hash": "27587689922e22f60ec9ad0182a0a825"
    },
    "AnnotationHub": {
      "Package": "AnnotationHub",
      "Version": "3.10.1",
      "Source": "Bioconductor",
      "Repository": "Bioconductor 3.18",
      "Requirements": [
        "AnnotationDbi",
        "BiocFileCache",
        "BiocGenerics",
        "BiocManager",
        "BiocVersion",
        "RSQLite",
        "S4Vectors",
        "curl",
        "dplyr",
        "grDevices",
        "httr",
        "interactiveDisplayBase",
        "methods",
        "rappdirs",
        "utils",
        "yaml"
      ],
      "Hash": "07d1966e3ffc8c313410579f76b4718c"
    },
    "BH": {
      "Package": "BH",
      "Version": "1.84.0-0",
      "Source": "Repository",
      "Repository": "CRAN",
      "Hash": "a8235afbcd6316e6e91433ea47661013"
    },
    "Biobase": {
      "Package": "Biobase",
      "Version": "2.62.0",
      "Source": "Bioconductor",
      "Requirements": [
        "BiocGenerics",
        "R",
        "methods",
        "utils"
      ],
      "Hash": "38252a34e82d3ff6bb46b4e2252d2dce"
    },
    "BiocFileCache": {
      "Package": "BiocFileCache",
      "Version": "2.10.2",
      "Source": "Bioconductor",
      "Repository": "Bioconductor 3.18",
      "Requirements": [
        "DBI",
        "R",
        "RSQLite",
        "curl",
        "dbplyr",
        "dplyr",
        "filelock",
        "httr",
        "methods",
        "stats",
        "utils"
      ],
      "Hash": "d59a927de08cce606299009cc595b2cb"
    }
}

So for example, the package 'boot' has CRAN set as repository. However, when I call renv::restore(), I'm getting this output:

Downloading BiocManager from CRAN ... ERROR [cannot open URL 'https://bioconductor.org/packages/3.18/bioc/src/contrib/Archive/BiocManager/BiocManager_1.30.23.tar.gz']
Downloading BiocManager from CRAN ... ERROR [cannot open URL 'https://bioconductor.org/packages/3.18/data/annotation/src/contrib/Archive/BiocManager/BiocManager_1.30.23.tar.gz']
Downloading BiocManager from CRAN ... ERROR [cannot open URL 'https://bioconductor.org/packages/3.18/data/experiment/src/contrib/Archive/BiocManager/BiocManager_1.30.23.tar.gz']
Downloading BiocManager from CRAN ... ERROR [cannot open URL 'https://bioconductor.org/packages/3.18/workflows/src/contrib/Archive/BiocManager/BiocManager_1.30.23.tar.gz']
Downloading BiocManager from CRAN ... ERROR [cannot open URL 'https://bioconductor.org/packages/3.18/books/src/contrib/Archive/BiocManager/BiocManager_1.30.23.tar.gz']
Downloading BiocManager from CRAN ... OK [file is up to date]
Downloading boot from CRAN ... ERROR [cannot open URL 'https://bioconductor.org/packages/3.18/bioc/src/contrib/Archive/boot/boot_1.3-29.tar.gz']
Downloading boot from CRAN ... ERROR [cannot open URL 'https://bioconductor.org/packages/3.18/data/annotation/src/contrib/Archive/boot/boot_1.3-29.tar.gz']
Downloading boot from CRAN ... ERROR [cannot open URL 'https://bioconductor.org/packages/3.18/data/experiment/src/contrib/Archive/boot/boot_1.3-29.tar.gz']
Downloading boot from CRAN ... ERROR [cannot open URL 'https://bioconductor.org/packages/3.18/workflows/src/contrib/Archive/boot/boot_1.3-29.tar.gz']
Downloading boot from CRAN ... ERROR [cannot open URL 'https://bioconductor.org/packages/3.18/books/src/contrib/Archive/boot/boot_1.3-29.tar.gz']
Downloading boot from CRAN ... OK [file is up to date]

That means instead of trying CRAN first, which is set for the package as repository, the program iterates all the repositories from first to last until it finds the right one. I don't think this is the desired behaviour, especially since I don't have any problems with the exact same .lock file on a Mac.

This is the output of renv::diagnostics():

Diagnostics Report [renv 1.0.10]
================================

# /etc/lsb-release -----------------------------------------------------------
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"

# /etc/os-release ------------------------------------------------------------
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo


# Session Info ---------------------------------------------------------------
R version 4.3.3 (2024-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 24.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.12.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C

time zone: Etc/UTC
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base

loaded via a namespace (and not attached):
[1] BiocManager_1.30.25 compiler_4.3.3      tools_4.3.3
[4] renv_1.0.10

# Project --------------------------------------------------------------------
Project path: "..."

# Status ---------------------------------------------------------------------
The following package(s) are in an inconsistent state:

 package                installed recorded used
 abind                  n         y        ?
 ade4                   n         y        ?
 airr                   n         y        ?
 alakazam               n         y        ?
 annotate               n         y        ?
 AnnotationDbi          n         y        ?
 AnnotationHub          n         y        y
 ape                    n         y        ?
 aplot                  n         y        ?
 askpass                n         y        ?
 backports              n         y        ?
 base64enc              n         y        ?
 BH                     n         y        ?
 Biobase                n         y        ?
 BiocFileCache          n         y        ?
 BiocGenerics           n         y        ?
 BiocManager            y         y        ?
 BiocParallel           n         y        ?
 BiocVersion            n         y        ?
 Biostrings             n         y        ?
 bit                    n         y        ?
 bit64                  n         y        ?
 bitops                 n         y        ?
 blob                   n         y        ?
 boot                   y         y        ?
...

The following package(s) are out of sync [lockfile != library]:
# CRAN -----------------------------------------------------------------------
- BiocManager   [1.30.23 != 1.30.25]
- boot          [1.3-29 != 1.3-30]
- cli           [3.6.2 != 3.6.3]
- DBI           [1.2.2 != 1.2.3]

See `?renv::status` for advice on resolving these issues.

# Packages -------------------------------------------------------------------
                          Library Source    Lockfile            Source Path Dependency
AnnotationDbi                <NA>   <NA>      1.64.1      Bioconductor <NA>       <NA>
AnnotationHub                <NA>   <NA>      3.10.1 Bioconductor 3.18 <NA>     direct
BH                           <NA>   <NA>    1.84.0-0              CRAN <NA>       <NA>
Biobase                      <NA>   <NA>      2.62.0      Bioconductor <NA>       <NA>
BiocFileCache                <NA>   <NA>      2.10.2 Bioconductor 3.18 <NA>       <NA>
BiocGenerics                 <NA>   <NA>      0.48.1      Bioconductor <NA>       <NA>
BiocManager               1.30.25   CRAN     1.30.23              CRAN  [1]       <NA>
BiocParallel                 <NA>   <NA>      1.36.0      Bioconductor <NA>       <NA>
BiocVersion                  <NA>   <NA>      3.18.1      Bioconductor <NA>       <NA>
...
boot                       1.3-30   CRAN      1.3-29              CRAN  [2]       <NA>
...

# ABI ------------------------------------------------------------------------
- No ABI problems were detected in the set of installed packages.

# User Profile ---------------------------------------------------------------
[no user profile detected]

# Settings -------------------------------------------------------------------
List of 13
 $ bioconductor.version     : chr "3.18"
 $ external.libraries       : chr(0)
 $ ignored.packages         : chr(0)
 $ package.dependency.fields: chr [1:3] "Imports" "Depends" "LinkingTo"
 $ ppm.enabled              : NULL
 $ ppm.ignored.urls         : chr(0)
 $ r.version                : NULL
 $ snapshot.type            : chr "implicit"
 $ use.cache                : logi TRUE
 $ vcs.ignore.cellar        : logi TRUE
 $ vcs.ignore.library       : logi TRUE
 $ vcs.ignore.local         : logi TRUE
 $ vcs.manage.ignores       : logi TRUE

# Options --------------------------------------------------------------------
List of 8
 $ defaultPackages                     : chr [1:6] "datasets" "utils" "grDevices" "graphics" ...
 $ download.file.method                : NULL
 $ download.file.extra                 : NULL
 $ install.packages.compile.from.source: NULL
 $ pkgType                             : chr "source"
 $ repos                               : Named chr [1:6] "https://bioconductor.org/packages/3.18/bioc" "https://bioconductor.org/packages/3.18/data/annotation" "https://bioconductor.org/packages/3.18/data/experiment" "https://bioconductor.org/packages/3.18/workflows" ...
  ..- attr(*, "names")= chr [1:6] "BioCsoft" "BioCann" "BioCexp" "BioCworkflows" ...
 $ renv.consent                        : logi TRUE
 $ renv.verbose                        : logi TRUE

# Environment Variables ------------------------------------------------------
HOME                        = /home/...
LANG                        = C.UTF-8
MAKE                        = make
R_LIBS                      = <NA>
R_LIBS_SITE                 = /usr/local/lib/R/site-library/:/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library
R_LIBS_USER                 = /home/...
RENV_DEFAULT_R_ENVIRON      = <NA>
RENV_DEFAULT_R_ENVIRON_USER = <NA>
RENV_DEFAULT_R_LIBS         = <NA>
RENV_DEFAULT_R_LIBS_SITE    = /usr/local/lib/R/site-library/:/usr/local/lib/R/site-library:/usr/lib/R/site-library:/usr/lib/R/library
RENV_DEFAULT_R_LIBS_USER    = /home/...
RENV_DEFAULT_R_PROFILE      = <NA>
RENV_DEFAULT_R_PROFILE_USER = <NA>
RENV_PATHS_LIBRARY_ROOT     = /home/...
RENV_PATHS_LOCKFILE         = envs/renv.lock
RENV_PROJECT                = /home/...

# PATH -----------------------------------------------------------------------
...

# Cache ----------------------------------------------------------------------
There are a total of 317 packages installed in the renv cache.
Cache path: "~/.cache/R/renv/cache/v5/R-4.3/x86_64-pc-linux-gnu"
@kevinushey
Copy link
Collaborator

Thanks for the bug report! I think this should be remedied via 2572f4b; can you let me know if it helps?

@Monkjj
Copy link
Author

Monkjj commented Jan 29, 2025

Installed 1.1.0 and it works like a charm! Thanks a lot for this quick fix!!

@Monkjj Monkjj closed this as completed Jan 29, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants