404 error during devtools::check()

Hi,

I am still able to install binary packages from P3M using install.packages() but I'm getting this error when running devtools::check(). I've included some of my related settings below the check() results. I get the same error when running devtools::check() in base R and in Rstudio.

Error in output from devtools::check():

βœ”  checking package namespace information
─  checking package dependencies ...Warning in url(sprintf("%s/%s", cran, path), open = "rb") : (3s)
     cannot open URL 'https://packagemanager.posit.co/cran/__linux__/jammy/latest/web/packages/packages.rds': HTTP status was '404 Not Found'
   Error in url(sprintf("%s/%s", cran, path), open = "rb") : 
     cannot open the connection to 'https://packagemanager.posit.co/cran/__linux__/jammy/latest/web/packages/packages.rds'
   Execution halted
> getOption('HTTPUserAgent')
[1] "R/4.3.0 R (4.3.0 x86_64-pc-linux-gnu x86_64 linux-gnu)"
> getOption('repos')
                                                         CRAN 
"https://packagemanager.posit.co/cran/__linux__/jammy/latest" 
> sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 21.1

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

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: America/Los_Angeles
tzcode source: system (glibc)

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

loaded via a namespace (and not attached):
 [1] miniUI_0.1.1.1    compiler_4.3.0    crayon_1.5.2      promises_1.2.0.1  Rcpp_1.0.10       stringr_1.5.0     rcmdcheck_1.4.0  
 [8] callr_3.7.3       later_1.3.1       fastmap_1.1.1     mime_0.12         R6_2.5.1          curl_5.0.0        htmlwidgets_1.6.2
[15] tibble_3.2.1      desc_1.4.2        profvis_0.3.8     rprojroot_2.0.3   shiny_1.7.4       pillar_1.9.0      rlang_1.1.1      
[22] utf8_1.2.3        cachem_1.0.8      stringi_1.7.12    httpuv_1.6.11     fs_1.6.2          pkgload_1.3.2     memoise_2.0.1    
[29] cli_3.6.1         withr_2.5.0       magrittr_2.0.3    ps_1.7.5          digest_0.6.31     processx_3.8.1    rstudioapi_0.14  
[36] xtable_1.8-4      remotes_2.4.2     devtools_2.4.5    lifecycle_1.0.3   prettyunits_1.1.1 vctrs_0.6.2       glue_1.6.2       
[43] xopen_1.0.0       urlchecker_1.0.1  sessioninfo_1.2.2 pkgbuild_1.4.0    fansi_1.0.4       purrr_1.0.1       pkgconfig_2.0.3  
[50] usethis_2.1.6     tools_4.3.0       ellipsis_0.3.2    htmltools_0.5.5  

My .Rprofile file:

$ cat .Rprofile
options(repos = c(CRAN =
'https://packagemanager.posit.co/cran/__linux__/jammy/latest'))
options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(),
paste(getRversion(), R.version["platform"], R.version["arch"],
R.version["os"])))

I cannot reproduce this. The quoted URL does indeed produce a 404, but it is not requested in my tests. Does this happen with any R package or only specific ones? Can you provide the output of sessioninfo::session_info() or sessionInfo()?

Same error using a different package, here a git clone of tidyverse/magrittr:

R version 4.3.0 (2023-04-21) -- "Already Tomorrow"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> devtools::check()
══ Documenting ═════════════════════════════════════════════════════════════════════════════════════════════════════════
β„Ή Installed roxygen2 version (7.2.3) doesn't match required (7.1.2)
βœ– `check()` will not re-document this package
══ Building ════════════════════════════════════════════════════════════════════════════════════════════════════════════
Setting env vars:
β€’ CFLAGS    : -Wall -pedantic -fdiagnostics-color=always
β€’ CXXFLAGS  : -Wall -pedantic -fdiagnostics-color=always
β€’ CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always
β€’ CXX14FLAGS: -Wall -pedantic -fdiagnostics-color=always
β€’ CXX17FLAGS: -Wall -pedantic -fdiagnostics-color=always
β€’ CXX20FLAGS: -Wall -pedantic -fdiagnostics-color=always
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────────────────────
βœ”  checking for file β€˜/home/dave/Desktop/magrittr/DESCRIPTION’ ...
─  preparing β€˜magrittr’:
βœ”  checking DESCRIPTION meta-information ...
─  cleaning src
─  installing the package to build vignettes
βœ”  creating vignettes (4.4s)
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building β€˜magrittr_2.0.3.9000.tar.gz’
   
══ Checking ════════════════════════════════════════════════════════════════════════════════════════════════════════════
Setting env vars:
β€’ _R_CHECK_CRAN_INCOMING_USE_ASPELL_           : TRUE
β€’ _R_CHECK_CRAN_INCOMING_REMOTE_               : FALSE
β€’ _R_CHECK_CRAN_INCOMING_                      : FALSE
β€’ _R_CHECK_FORCE_SUGGESTS_                     : FALSE
β€’ _R_CHECK_PACKAGES_USED_IGNORE_UNUSED_IMPORTS_: FALSE
β€’ NOT_CRAN                                     : true
── R CMD check ─────────────────────────────────────────────────────────────────────────────────────────────────────────
─  using log directory β€˜/tmp/RtmpV0XWT5/file4e1c31d7c9f9/magrittr.Rcheck’
─  using R version 4.3.0 (2023-04-21)
─  using platform: x86_64-pc-linux-gnu (64-bit)
─  R was compiled by
       gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
       GNU Fortran (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
─  running under: Linux Mint 21.1
─  using session charset: UTF-8
─  using options β€˜--no-manual --as-cran’
βœ”  checking for file β€˜magrittr/DESCRIPTION’
─  checking extension type ... Package
─  this is package β€˜magrittr’ version β€˜2.0.3.9000’
─  package encoding: UTF-8
βœ”  checking package namespace information
─  checking package dependencies ...Warning in url(sprintf("%s/%s", cran, path), open = "rb") : (2.8s)
     cannot open URL 'https://packagemanager.posit.co/cran/__linux__/jammy/latest/web/packages/packages.rds': HTTP status was '404 Not Found'
   Error in url(sprintf("%s/%s", cran, path), open = "rb") : 
     cannot open the connection to 'https://packagemanager.posit.co/cran/__linux__/jammy/latest/web/packages/packages.rds'
   Execution halted
   
── R CMD check results ──────────────────────────────────────────────────────────────────────── magrittr 2.0.3.9000 ────
Duration: 3.8s

0 errors βœ” | 0 warnings βœ” | 0 notes βœ”

Re-including sessionInfo() here:

> sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 21.1

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

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: America/Los_Angeles
tzcode source: system (glibc)

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

loaded via a namespace (and not attached):
 [1] miniUI_0.1.1.1    compiler_4.3.0    crayon_1.5.2      promises_1.2.0.1  Rcpp_1.0.10       stringr_1.5.0    
 [7] rcmdcheck_1.4.0   callr_3.7.3       later_1.3.1       fastmap_1.1.1     mime_0.12         R6_2.5.1         
[13] curl_5.0.0        htmlwidgets_1.6.2 tibble_3.2.1      desc_1.4.2        profvis_0.3.8     rprojroot_2.0.3  
[19] shiny_1.7.4       pillar_1.9.0      rlang_1.1.1       utf8_1.2.3        cachem_1.0.8      stringi_1.7.12   
[25] httpuv_1.6.11     fs_1.6.2          pkgload_1.3.2     memoise_2.0.1     cli_3.6.1         withr_2.5.0      
[31] magrittr_2.0.3    ps_1.7.5          digest_0.6.31     processx_3.8.1    rstudioapi_0.14   xtable_1.8-4     
[37] remotes_2.4.2     devtools_2.4.5    lifecycle_1.0.3   prettyunits_1.1.1 vctrs_0.6.2       glue_1.6.2       
[43] xopen_1.0.0       urlchecker_1.0.1  sessioninfo_1.2.2 pkgbuild_1.4.0    fansi_1.0.4       purrr_1.0.1      
[49] pkgconfig_2.0.3   usethis_2.1.6     tools_4.3.0       ellipsis_0.3.2    htmltools_0.5.5  

Options being used for downloading R packages:

> options('repos')
$repos
                                                         CRAN 
"https://packagemanager.posit.co/cran/__linux__/jammy/latest" 

> options('HTTPUserAgent')
$HTTPUserAgent
[1] "R/4.3.0 R (4.3.0 x86_64-pc-linux-gnu x86_64 linux-gnu)"

Thanks much for any suggestions on debugging this issue. I'm getting the same error when I try checking a different package inside a singularity container based on rocker/geospatial:4.2.3, so I don't think it's specific to R 4.3.0 or to Linux Mint.

Hi,

My reply got spam-filtered by Akismet and may show back up eventually, but briefly yes ,this same error does occur with other packages (tested it also using tidyverse/magrittr). I also get the error when I attempt this inside a rocker/geospatial:4.2.3 container, so I don't think it's Linux Mint or R 4.3.0 specific. See the OP for sessionInfo() output.

I see that the same error is also mentioned on this rocker webpage, see section 4.1:

https://rocker-project.org/images/versioned/r-ver

A little more sleuthing turned up this:

I'm not sure if this is best seen as a bug or not, but it appears that binary package installs through P3M are not compatible with a devtools:check() development workflow.

The workaround given in the rocker issue, changing the repo to a traditional source CRAN url, does work in my case, but of course might be nicer if no workaround was needed.

thanks again,

Thanks for the tests. So far I cannot reproduce this. To narrow the search space: Does this also work with R CMD check, i.e.

R CMD build magrittr
R CMD check magrittr_2.0.3.9000.tar.gz 

In the directory where you checked out magrittr.

Yes.

dave@dave-linux-macbook:~/Desktop$ R CMD check magrittr_2.0.3.9000.tar.gz
* using log directory β€˜/home/dave/Desktop/magrittr.Rcheck’
* using R version 4.3.0 (2023-04-21)
* using platform: x86_64-pc-linux-gnu (64-bit)
* R was compiled by
    gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
    GNU Fortran (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
* running under: Linux Mint 21.1
* using session charset: UTF-8
* checking for file β€˜magrittr/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package β€˜magrittr’ version β€˜2.0.3.9000’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK

...

OK, I think I have found the reason for this. I have installed R using GitHub - r-lib/rig: The R Installation Manager which sets:

> options("repos")
$repos
                                                         RSPM 
"https://packagemanager.posit.co/cran/__linux__/jammy/latest" 
                                                         CRAN 
                                "https://cloud.r-project.org" 

Internally, the check functions in R explicitly searches for "CRAN", so https://cloud.r-project.org is used to retrieve the file in question. However, normal calls to install.packages() go through the repository list one by one and use the first one that has the package available, which will be the binary packages from package manager.

I will ask internally if there is a possibility to also provide the web part of CRAN via package manager.

2 Likes