7

Executive summary:

devtools::install_git with GitLab through a proxy throws an Installation failed: Error in 'git2r_clone': failed to send request: A connection with the server could not be established error.

Custom package (R default example):

To test my GitLab and GitHub workflow I have created a few repositories:

Git bash:

After setting up my company proxy settings in the .gitconfig file I am able to access them all over the https from the git bash console with e.g. the git fetch github_public master, where github_public is simply https://github.com/m-dz/md.test_public.git, etc.

R:

After setting up proxy (needed to use the devtools::install_github) with:

httr::set_config(
  httr::use_proxy(
    url = 'proxy_url',
    port = proxy_port,
    username = 'username',
    password = 'password'
  )
)

and updating both devtools and git2r to the development versions (just to be sure) with devtools::install_github I am able to use:

devtools::install_git('https://github.com/m-dz/md.test_public.git', quiet = FALSE)

to install the public repo from GitHub (but devtools::install_github('m-dz/md.test_public') is not always working, do not know why, seems to be a random behaviour...).

Unfortunately GitLab do not want to cooperate with me as:

devtools::install_git('https://gitlab.com/m-dz/md.test_public.git', quiet = FALSE)

throws and error mentioned in the summary, i.e.

Installation failed: Error in 'git2r_clone': failed to send request: A connection with the server could not be established.

Of course the private GitLab repo with either https://user:pass@... or credentials = git2r::cred_user_pass(...) behaves identically...

Question:

What can I do to debug this and hopefully be able to use GitLab from R (free private repos...).

m-dz
  • 2,342
  • 17
  • 29
  • You set up the proxy options in something called `httr`, does devtools know to pass that information down to libgit2? The error message seems to come down to libgit2 using WinHTTP and the error message suggests the network is blocking it. – Carlos Martín Nieto Dec 23 '16 at 13:43
  • Thank you Carlos for the comment. I am pretty sure `devtools` is picking up the proxy settings as without it even the `devtools::install_git` with a public repo is being blocked, and after setting them up with `httr` package it is working correctly. I am afraid this might be caused by the `libgit2` or some other library installed incorrectly. I will have another look at this after the festive break, thanks again! – m-dz Dec 23 '16 at 15:42

0 Answers0