git2r icon indicating copy to clipboard operation
git2r copied to clipboard

Failure to resolve server name or address error message

Open imanuelcostigan opened this issue 9 years ago • 5 comments

I am trying to fetch a remote repository from behind a proxy with NTLM auth. I also have the HTTP_PROXY and HTTPS_PROXY environment variables set and have no problems cloning or perform other Git actions using the Github Desktop application or Github supplied bash shell. But I cannot perform these actions through git2r. The outcome does not change if I also set the .gitconfig file to include entries for http.proxy and https.proxy.

path <- tempfile(pattern="git2r-")
dir.create(path)
repo <- git2r::init(path)
git2r::config(repo) # This reflects what I have in my gitconfig file 
git2r::remote_add(repo, "github", "https://github.com/imanuelcostigan/fmdates")
git2r::fetch(repo, "github")

#Error in git2r::fetch(repo, "github") : 
#  Error in 'git2r_remote_fetch': failed to send request: The server name or address could not be resolved

imanuelcostigan avatar Jan 08 '17 02:01 imanuelcostigan

Here is my devtools::session_info()

Session info ------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.3.2 (2016-10-31)
 system   x86_64, mingw32             
 ui       RStudio (1.0.44)            
 language (EN)                        
 collate  English_Australia.1252      
 tz       Australia/Sydney            
 date     2017-01-08                  

Packages ----------------------------------------------------------------------------------------
 package  * version date       source        
 devtools * 1.12.0  2016-06-24 CRAN (R 3.3.1)
 digest     0.6.10  2016-08-02 CRAN (R 3.3.1)
 memoise    1.0.0   2016-01-29 CRAN (R 3.3.1)
 withr      1.0.2   2016-06-20 CRAN (R 3.3.1)

imanuelcostigan avatar Jan 08 '17 02:01 imanuelcostigan

Is this related to #85 ?

imanuelcostigan avatar Jan 25 '17 05:01 imanuelcostigan

No, it's not related to #85. It's not yet implemented in git2r, I think the git_proxy_options data structure must be configured in the call to git_remote_fetch for this to work.

stewid avatar Jan 25 '17 19:01 stewid

Hello, Is there a workaround ? From what I understand I could have a similar problem with a git2r_push failing due to my institution's proxy (see #278)

gse-cc-git avatar Apr 07 '17 09:04 gse-cc-git

I have the same failure behind (corporate) proxy and success from home. I have other R packages working and respecting HTTP_PROXY/HTTPS_PROXY settings from environment variables, but as @stewid wrote the issue is due to not having git_proxy_options being setup and passed to git_remote_fetch in the C call to libgit2.

Interfacing C to R is not in my skill set, otherwise I would really like to help.

I am surprised so few have (found and) commented this issue...it looks quite a general limitation/bug...

Anybody able to help? How can I help more?

espinielli avatar Aug 02 '19 15:08 espinielli