pak icon indicating copy to clipboard operation
pak copied to clipboard

error with bioconductor URL

Open usrbinr opened this issue 1 year ago • 5 comments

Hi,

I get the following error when I try to use pak::pak(). It occured after I upgraded to R 4.4 and its for package that I try to download

I'm not trying to use bioconductor as my repo and not sure why it is looking for it

! error in pak subprocess
Caused by error in `download.file(url, tmp, quiet = TRUE)`:
! cannot open URL 'http://bioconductor.org/config.yaml'

session info below

R version 4.4.0 (2024-04-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8 LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

time zone: America/Chicago
tzcode source: internal

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

other attached packages:
 [1] marquee_0.1.0   lubridate_1.9.3 forcats_1.0.0   stringr_1.5.1   dplyr_1.1.4     purrr_1.0.2     readr_2.1.5     tidyr_1.3.1     tibble_3.2.1    ggplot2_3.5.1   tidyverse_2.0.0

loaded via a namespace (and not attached):
 [1] gtable_0.3.5      compiler_4.4.0    tidyselect_1.2.1  systemfonts_1.1.0 scales_1.3.0      textshaping_0.4.0 R6_2.5.1          pak_0.7.2         labeling_0.4.3    generics_0.1.3    munsell_0.5.1     pillar_1.9.0     
[13] tzdb_0.4.0        rlang_1.1.4       utf8_1.2.4        stringi_1.8.4     timechange_0.3.0  cli_3.6.2         withr_3.0.0       magrittr_2.0.3    grid_4.4.0        rstudioapi_0.16.0 hms_1.1.3         lifecycle_1.0.4  
[25] vctrs_0.6.5       glue_1.7.0        farver_2.1.2      fansi_1.0.6       colorspace_2.1-0  tools_4.4.0       pkgconfig_2.0.3  

usrbinr avatar Jun 12 '24 21:06 usrbinr

Can you access that URL from R?

gaborcsardi avatar Jun 13 '24 08:06 gaborcsardi

Looks likely to be the same issue as #295

wurli avatar Jun 19 '24 10:06 wurli

Can you access that URL from R?

Sorry for delay.

When I use the httr package I get the below screen shot results image

usrbinr avatar Aug 14 '24 18:08 usrbinr

I'm facing the same issue.

While there may be more to this, I think the issue might be that:

  • the bioconductor URL in pak uses http instead of https.
  • some (enterprise) networks may filter out requests to URLs that use http

In any case, I notice that pak fails when corporate VPN is enabled and succeeds when VPN is disabled.

#> r$> pak::pak("gt")
Error:
! error in pak subprocess
Caused by error in `download.file(url, tmp, quiet = TRUE)`:
! cannot open URL 'http://bioconductor.org/config.yaml'
Type .Last.error to see the more details.

#> r$> .Last.error
<callr_error/rlib_error_3_0/rlib_error/error>
Error:
! error in pak subprocess
Caused by error in `download.file(url, tmp, quiet = TRUE)`:
! cannot open URL 'http://bioconductor.org/config.yaml'
---
Backtrace:
1. pak::pak("gt")
2. pak::pkg_install(pkg, ...)
3. pak:::remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...), ..4. err$throw(res$error)
---
Subprocess backtrace:
 1. base::withCallingHandlers(cli_message = function(msg) { ...
 2. get("pkg_install_make_plan", asNamespace("pak"))(...)
 3. pkgdepends::new_pkg_installation_proposal(pkg, config = list(library = lib, ...
 4. pkg_installation_proposal$new(refs, config = config, ...)
 5. local initialize(...)
 6. pkg_plan$new(refs, config = config, library = config$library, ...
 7. local initialize(...)
 8. pkgdepends:::pkgplan_init(self, private, refs, config, library, remote_types, ...
 9. pkgcache::cranlike_metadata_cache$new(replica_path = private$config$get("metada...
10. local initialize(...)
11. pkgcache:::cmc_init(self, private, primary_path, replica_path, platforms, ...
12. pkgcache:::cmc__get_repos(repos, bioc, cran_mirror, r_version)
13. bioconductor$get_repos()
14. local get_bioc_version(getRversion(), forget)
15. local get_matching_bioc_version(r_version, forget = forget)
16. local get_version_map(forget = forget)
17. local get_yaml_config(forget)
18. base::stop(new)
19. global (function (e) ...

#> r$> # disabling VPN, which filters out requests to sites with http

#> r$> pak::pak("gt")
✔ Updated metadata database: 1.42 MB in 2 files.                          
✔ Updating metadata database ... done

When I try the bioconductor URL in the web browser (even while VPN is enabled)--that is, copy-paste the bioconductor URL from the pak error message--I seem to get redirected to the bioconductor URL that uses https. I'm guessing that the request sent through pak doesn't follow redirects.

image

arthur-shaw avatar Aug 15 '24 21:08 arthur-shaw

I am also getting this error with pak::local_install(), when building a package. It seems to be random, and usually works when I build the package again a few seconds later. Could it be the bioconductor server that is unstable? I have no dependencies from bioconductor.

Why does pak::local_install() even try to access the bioconductor server?

pak::local_install(upgrade = FALSE)
Error: 
! error in pak subprocess
Caused by error in `download.file(url, tmp, quiet = TRUE)`:
! cannot open URL 'http://bioconductor.org/config.yaml'
---
Backtrace:
1. pak::local_install(upgrade = FALSE)
2. pak:::remote(function(...) get("local_install_make_plan", asNamespace("pak"))(...…
3. err$throw(res$error)
---
Subprocess backtrace:
 1. base::withCallingHandlers(cli_message = function(msg) { …
 2. get("local_install_make_plan", asNamespace("pak"))(...)
 3. pak:::pkg_install_make_plan(pkg, lib, upgrade, ask, start, dependencies, …
 4. pkgdepends::new_pkg_installation_proposal(pkg, config = list(library = lib,…
 5. pkg_installation_proposal$new(refs, config = config, ...)
 6. local initialize(...)
 7. pkg_plan$new(refs, config = config, library = config$library, …
 8. local initialize(...)
 9. pkgdepends:::pkgplan_init(self, private, refs, config, library, remote_types, …
10. pkgcache::cranlike_metadata_cache$new(replica_path = private$config$get("me…
11. local initialize(...)
12. pkgcache:::cmc_init(self, private, primary_path, replica_path, platforms, …
13. pkgcache:::cmc__get_repos(repos, bioc, cran_mirror, r_version, auth = FALSE)
14. bioconductor$get_repos()
15. local get_bioc_version(getRversion(), forget)
16. local get_matching_bioc_version(r_version, forget = forget)
17. local get_version_map(forget = forget)
18. local get_yaml_config(forget)
19. base::stop(new)
20. global (function (e) …
Execution halted

JohannesNE avatar Jun 12 '25 11:06 JohannesNE