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

remotes::install_github('rstudio/[email protected]') fails for renv >= 1.0.0 "Error cannot open URL...", on linux, works for renv <= 0.17.3 #785

Closed
cpenaloza opened this issue Mar 2, 2024 · 4 comments

Comments

@cpenaloza
Copy link

cpenaloza commented Mar 2, 2024

On a linux machine, I'm trying to build a docker image with a specific version of renv but remotes::install_github() fails for any version of renv >= 1.0.0.

This is what I run in my dockerfile:

FROM r-base:4.3.1

RUN apt-get update --fix-missing -y && apt-get install -y libcurl4-openssl-dev libssl-dev
RUN apt-get install -y libxml2-dev libpq-dev
ENV RENV_VERSION 1.0.0
ENV RENV_ACTIVATE_PROJECT 0

RUN R -e "install.packages('remotes', repos = c(CRAN = 'https://cloud.r-project.org'))"
RUN R -e "remotes::install_github('rstudio/renv@${RENV_VERSION}')"

and this is what I've been running in my R-console to "debug"

install.packages('remotes', repos = c(CRAN = 'https://cloud.r-project.org'))
remotes::install_github('rstudio/[email protected]')

Which returns:

Downloading GitHub repo rstudio/[email protected]
Error in utils::download.file(url, path, method = method, quiet = quiet,  : 
  cannot open URL 'https://api.github.com/repos/rstudio/renv/tarball/1.0.0'

If I run the following, it installs no problem

> remotes::install_github('rstudio/[email protected]')
Downloading GitHub repo rstudio/[email protected]
Running `R CMD build`...
* checking for file ‘/tmp/RtmpSHDb9O/remotes74747c132063/rstudio-renv-f13c476/DESCRIPTION’ ... OK
* preparing ‘renv’:
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
Removed empty directory ‘renv/tests/testthat/resources/dummy.Rmd’
* building ‘renv_0.17.3.tar.gz’
Installing package into ‘/home/uia96863/corepredictor_industrialization/renv/library/R-4.3/x86_64-pc-linux-gnu’
(as ‘lib’ is unspecified)
* installing *source* package ‘renv’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (renv)

I'm at a loss, no idea what is going on here. Any help greatly appreciated!

@cpenaloza cpenaloza changed the title remotes::install_github('rstudio/[email protected]') fails for renv >= 1.0.0 "Error cannot open URL...", on linux, works for renv <= 0.17.3 remotes::install_github('rstudio/[email protected]') fails for renv >= 1.0.0 "Error cannot open URL...", on linux, works for renv <= 0.17.3 Mar 2, 2024
@cpenaloza cpenaloza changed the title remotes::install_github('rstudio/[email protected]') fails for renv >= 1.0.0 "Error cannot open URL...", on linux, works for renv <= 0.17.3 remotes::install_github('rstudio/[email protected]') fails for renv >= 1.0.0 "Error cannot open URL...", on linux, works for renv <= 0.17.3 Mar 2, 2024
@gaborcsardi
Copy link
Member

You need to use a GitHub personal access token for reliable installation from GitHub.
And/or consider using the pak package instead of remotes.

@cpenaloza
Copy link
Author

Will do. I had run into that before but personal access tokens would expire before than expected and I ended up creating one almost every time I built a new Docker image. I figured I was doing something else wrong too.

I'll have a look at pak. Thank you!

@tspen
Copy link

tspen commented Mar 16, 2024

If anyone else finds this, you need to add a v for versions of renv > 1.0.0.

e.g.

install.packages('remotes', repos = c(CRAN = 'https://cloud.r-project.org')) remotes::install_github('rstudio/[email protected]')

@cpenaloza
Copy link
Author

Thank you @tspen! I fumbled my way to adding the "v" in pak::pkg_install('rstudio/[email protected]'), but didn't retry with remotes.

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

3 participants