remotes::install_github working in R session but not in RStudio Server

When I try to install a package using remotes::install_github it does not work if I run the command from RStudio Server, but it works when I run it using a regular R connection through the linux terminal on the same server and project folder (packrat enabled).

This is the command I try to run:

remotes::install_github("traversc/qs", configure.args="--with-simd=AVX2")

This is the error in RStudio Server:

Downloading GitHub repo traversc/qs@master
Error in utils::download.file(url, path, method = download_method(), quiet = quiet,  : 
  cannot open URL 'https://api.github.com/repos/traversc/qs/zipball/master'

In a regular (outside RStudio) R session, same project, the previous command works fine.

The same situation happens when installing Bioconductor packages. From the terminal they install Ok, but not from RStudio Server.

System Information:

  • RStudio Edition: Server, in evaluation
  • RStudio Version: 1.1.463
  • OS Version: Ubuntu 18.04
  • R Version: 3.5.1

From Troubleshooting Guide: Using RStudio

for the purpose of debugging, does devtools::install_github work from R Studio?

The error seems to be related to a connectivity issue.

is the url accessible from Rstudio ? without using install_github ?

You could try something like

res <- httr::GET("https://api.github.com/repos/traversc/qs/zipball/master")
httr::status_code(res)

There may be some configuration not present in RStudio but active in terminal. Is the account exactly the same ? Do you have some configuration in bash profile ?

1 Like

Yes, this command works. I mean, I got a 200 HTTP status response.

> library(httr)
> res <- httr::GET("https://api.github.com/repos/traversc/qs/zipball/master")
> httr::status_code(res)
[1] 200

Yes, devtools::install_github works but remotes:: not. I can switch from remotes to devtoools, but still I have the same -or related- connection error with Bioconductor:

> BiocManager::install("CoverageView")
Error: Bioconductor version cannot be validated; no internet connection?

Which version of devtools and remotes do you have ?

Remotes 1.1.1 and Devtools 1.13.6

I really think this is a internet connection issue. It could depend on which method is used.
Can you tried

download.file("https://api.github.com/repos/traversc/qs/zipball/master", destfile = {a <- tempfile()})
unlink(a)

Does it work ?

That command works, maybe it is something that fails exclusively with remotes or Bioconductor. Perhaps an SSH certificate that doesn't work for them but it does for devtools/download.file. I think I can move forward given that is not all the time I am installing packages, and at any case I can use the R console also.

You could try checking the output of

options("download.file.method", "download.file.extra")

to see if R vs. RStudio is requesting a different download method; perhaps only one works in your particular environment.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.