Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

renv::install/update() error "Retrieving 'https://cloud.r-project.org/src/contrib/NA'" #1045

Closed
adamaltmejd opened this issue Jul 16, 2022 · 5 comments

Comments

@adamaltmejd
Copy link

> renv::update("Rcpp")
* Checking for updated packages ... Done!
The following package(s) will be updated:

# CRAN ===============================
- Rcpp   [1.0.8.3 -> 1.0.9]

Do you want to proceed? [y/N]: y
Retrieving 'https://cloud.r-project.org/src/contrib/NA' ...
Error: failed to retrieve 'https://cloud.r-project.org/src/contrib/NA' [error code 22]
In addition: Warning message:
curl: (22) The requested URL returned error: 404 
Traceback (most recent calls last):
9: renv::update("Rcpp")
8: install(packages = updates, library = libpaths, rebuild = rebuild, 
       project = project)
7: retrieve(names(remotes))
6: handler(package, renv_retrieve_impl(package))
5: renv_retrieve_impl(package)
4: renv_retrieve_repos(record)
3: renv_retrieve_repos_impl(record)
2: renv_retrieve_package(record, url, path)
1: stop(status)
> renv::install("Rcpp")
Retrieving 'https://cloud.r-project.org/src/contrib/NA' ...
Error: failed to retrieve 'https://cloud.r-project.org/src/contrib/NA' [error code 22]
In addition: Warning message:
curl: (22) The requested URL returned error: 404 
Traceback (most recent calls last):
8: renv::install("Rcpp")
7: retrieve(names(remotes))
6: handler(package, renv_retrieve_impl(package))
5: renv_retrieve_impl(package)
4: renv_retrieve_repos(record)
3: renv_retrieve_repos_impl(record)
2: renv_retrieve_package(record, url, path)
1: stop(status)

install.packages("Rcpp") works as normal. Same error for lots of other packages, eg. stringi.

> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Monterey 12.4

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

loaded via a namespace (and not attached):
[1] compiler_4.2.1 cli_3.3.0      parallel_4.2.1 tools_4.2.1    jsonlite_1.8.0 renv_0.15.5-39 rlang_1.0.2   
@kevinushey
Copy link
Collaborator

Seems to be working for me:

> options(repos = c(CRAN = "https://cloud.r-project.org"))
> renv::install("Rcpp", rebuild = TRUE)
Retrieving 'https://cloud.r-project.org/bin/macosx/contrib/4.2/Rcpp_1.0.9.tgz' ...
        OK [file is up to date]
Installing Rcpp [1.0.9] ...
        OK [installed binary]
Copying Rcpp [1.0.9] into the cache ...
        OK [copied to cache in 0.33 seconds]
> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur ... 10.16

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

loaded via a namespace (and not attached):
[1] compiler_4.2.1 tools_4.2.1    renv_0.15.5-38

Can you provide any other details?

@adamaltmejd
Copy link
Author

Ok think i figured it out: seems to be a bug with having multiple repos set in option(repos).

❯ R
> getOption("repos")
                                     CRAN                                        DT
            "https://cloud.r-project.org" "https://Rdatatable.gitlab.io/data.table"
> renv::install("Rcpp")
Retrieving 'https://cloud.r-project.org/src/contrib/NA' ...
Error: failed to retrieve 'https://cloud.r-project.org/src/contrib/NA' [error code 22]
In addition: Warning messages:
1: could not retrieve available packages for url 'https://Rdatatable.gitlab.io/data.table/bin/macosx/big-sur-arm64/contrib/4.2'
2: curl: (22) The requested URL returned error: 404
3: curl: (22) The requested URL returned error: 404
Traceback (most recent calls last):
8: renv::install("Rcpp")
7: retrieve(names(remotes))
6: handler(package, renv_retrieve_impl(package))
5: renv_retrieve_impl(package)
4: renv_retrieve_repos(record)
3: renv_retrieve_repos_impl(record)
2: renv_retrieve_package(record, url, path)
1: stop(status)
> getOption("repos")
                                     CRAN                                        DT
            "https://cloud.r-project.org" "https://Rdatatable.gitlab.io/data.table"
> options(repos = c(CRAN = "https://cloud.r-project.org"))
> getOption("repos")
                         CRAN
"https://cloud.r-project.org"
> renv::install("Rcpp")
Retrieving 'https://cloud.r-project.org/src/contrib/Rcpp_1.0.9.tar.gz' ...
	OK [file is up to date]
Installing Rcpp [1.0.9] ...

@kevinushey
Copy link
Collaborator

Thanks, I can reproduce now:

> options(repos = c(
+   CRAN = "https://cran.rstudio.com",
+   DT = "https://Rdatatable.gitlab.io/data.table"
+ ))
> renv::install("Rcpp")
Warning: could not retrieve available packages for url 'https://Rdatatable.gitlab.io/data.table/bin/macosx/big-sur-arm64/contrib/4.2'
Retrieving 'https://cran.rstudio.com/src/contrib/NA' ...
Warning: curl: (22) The requested URL returned error: 404
Error: failed to retrieve 'https://cran.rstudio.com/src/contrib/NA' [error code 22]
Traceback (most recent calls last):
8: renv::install("Rcpp")
7: records <- retrieve(names(remotes)) at install.R#207
6: for (package in packages)
     handler(package, renv_retrieve_impl(package)) at retrieve.R#33
5: handler = handler %||% function(package, action) action, at restore.R#267
4: switch(source,
          bioconductor = renv_retrieve_bioconductor(record),
          bitbucket    = renv_retrieve_bitbucket(record),
          git          = renv_retrieve_git(record),
          github       = renv_retrieve_github(record),
          gitlab       = renv_retrieve_gitlab(record),
          repository   = renv_retrieve_repos(record),
          url          = renv_retrieve_url(record),
          renv_retrieve_unknown_source(record)
   ) at retrieve.R#184
3: if (all(c("type", "url") %in% names(attributes(record))))
     return(renv_retrieve_repos_impl(record)) at retrieve.R#527
2: renv_retrieve_package(record, url, path) at retrieve.R#821
1: if (inherits(status, "error"))
     stop(status) at retrieve.R#849

I'll take a look.

@kevinushey
Copy link
Collaborator

Should be fixed up in the development version; thanks for reporting!

@adamaltmejd
Copy link
Author

Thanks for an excellent package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants