Skip to content

Can't get repos on R 4.5 if Bioconductor is unreachable #131

@krlmlr

Description

@krlmlr

In a situation where Bioconductor can't be reached and pkgcache doesn't know about the default Bioconductor version (R 4.5 at the time of writing), pak can't be used at all, even with Bioconductor turned off.

Sys.setenv("http_proxy" = "0.0.0.0:9")
Sys.setenv("https_proxy" = "0.0.0.0:9")

pkgcache::repo_get(bioc = FALSE)
#> Error in download.file(url, tmp, quiet = TRUE): cannot open URL 'http://bioconductor.org/config.yaml'

Created on 2025-08-31 with reprex v2.1.1

I can work around by setting R_BIOC_VERSION to 3.21 -- the reprex works, pak works. With R < 4.5, the problem doesn't occur because this code path isn't hit:

Sys.setenv("http_proxy" = "0.0.0.0:9")
Sys.setenv("https_proxy" = "0.0.0.0:9")
Sys.setenv("R_BIOC_VERSION" = 3.21)

pkgcache::repo_get(bioc = FALSE)
#> # A data frame: 1 × 5
#>   name  url                         type  r_version bioc_version
#> * <chr> <chr>                       <chr> <chr>     <chr>       
#> 1 CRAN  https://p3m.dev/cran/latest cran  *         <NA>

Created on 2025-08-31 with reprex v2.1.1

Is this one of the rare cases where a warning is appropriate? The bioc_names in cmc__get_repos() is for information only.

Also, should the failure to retrieve BioConductor's config be recorded so that it's not retried again? In my case, the proxy comes back only after 10 seconds.

Code reference:

bioc_names <- bioconductor$get_repos()

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