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 fails to install from GitHub when using curl 8.7.1 #1869

Closed
jabenninghoff opened this issue Apr 5, 2024 · 3 comments
Closed
Labels
bug an unexpected problem or unintended behavior
Milestone

Comments

@jabenninghoff
Copy link

renv::install fails to install from GitHub when using curl 8.7.1 on macOS.

To reproduce, create a new project in RStudio on macOS in a new directory, selecting "Use renv with this project" and install the latest version of curl using brew install curl.

Running:

Sys.setenv(PATH = paste0("/opt/homebrew/opt/curl/bin:", Sys.getenv("PATH")))
renv::install("eddelbuettel/digest")

Will fail with an error:

Error: failed to resolve remote 'eddelbuettel/digest' -- error downloading 'https://api.github.com/repos/eddelbuettel/digest/contents/DESCRIPTION?ref=ebd25a4bd18f3c5ee786a463cb01d629162cc8f1' [error code 26]

A trace shows the call is failing on renv_remotes_resolve_github_description. Setting options(renv.download.trace = TRUE) fails to provide any additional information.

> traceback()
15: stop(simpleError(message = message, call = e$call))
14: h(simpleError(msg, call))
13: .handleSimpleError(function (e) 
    {
        fmt <- "failed to resolve remote '%s'"
        prefix <- sprintf(fmt, spec)
        message <- paste(prefix, e$message, sep = " -- ")
        stop(simpleError(message = message, call = e$call))
    }, "error downloading 'https://api.github.com/repos/eddelbuettel/digest/contents/DESCRIPTION?ref=ebd25a4bd18f3c5ee786a463cb01d629162cc8f1' [error code 26]", 
        base::quote(NULL))
12: stop(sprintf(fmt, ...), call. = call.)
11: stopf("error downloading '%s' [%s]", url, msg, call. = FALSE)
10: renv_download_error(url, "error code %i", status)
9: download(url, destfile = destfile, type = "github", quiet = TRUE, 
       headers = headers)
8: renv_remotes_resolve_github_description(url, host, user, repo, 
       subdir, sha)
7: renv_remotes_resolve_github(remote)
6: renv_remotes_resolve_impl(spec, latest)
5: withCallingHandlers(renv_remotes_resolve_impl(spec, latest), 
       error = error)
4: FUN(X[[i]], ...)
3: lapply(x, f, ...)
2: map(packages, renv_remotes_resolve)
1: renv::install("eddelbuettel/digest")

Notes:

  • The PATH command is for arm64 macs, the curl path will be different for x86_64.
  • I discovered this issue when GitHub Actions started failing after the release of macOS-12/20240329.1, which updates curl from 8.6.0 to 8.7.1
  • This will cause any GitHub Action that runs renv::install to fail, although renv::restore still works
  • On the Windows runner, which uses curl 8.4.0, renv::install succeeds
  • See Test renv jabenninghoff/jbplot#49 for more detail
@jabenninghoff
Copy link
Author

As a workaround for GitHub Actions, you can call Sys.setenv(RENV_DOWNLOAD_METHOD = "libcurl") before renv::install(), as shown in jabenninghoff/rtraining#98 (works on current Windows and macOS runners).

@kevinushey
Copy link
Collaborator

Thanks for the bug report. I believe this should be resolved by 565abf4 -- any chance you could take a look?

@jabenninghoff
Copy link
Author

Thanks! Installing from the latest commit (7f423f9) does resolve the issue, running:

renv::install("rstudio/renv")
# (restart R)
Sys.setenv(PATH = paste0("/opt/home brew/opt/curl/bin:", Sys.getenv("PATH")))
renv::install("eddelbuettel/digest")

is successful.

@kevinushey kevinushey added the bug an unexpected problem or unintended behavior label Apr 10, 2024
@kevinushey kevinushey added this to the 1.1.0 milestone Apr 10, 2024
lorenzwalthert added a commit to lorenzwalthert/precommit that referenced this issue Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants