since the last update of jenkins and the git plugin the http auth via .netrc does not work anymore. I really checked many many threads about this issue.
I tried to use also the variant http://user:[email protected]/repo.git which works. But internally we are providing a vm which contains all needed jobs for development. Before the update we just edited the .netrc file in jenkins home folder and jenkins works perfectly.
I also tried already via console git clone http://url.tld/repo.git which works fine, even on the jenkins user.
Here are some details:
- Jenkins: v1.536
- GIT Plugin: v2.0
- GIT client plugin: v1.4.5
- GIT: 1.8.4.GIT
- Centos: 6.4
- Java: 1.6.0
The .netrc
machine url
login user
password pass
Here the error of jenkins in the configuration mask: Failed to connect to repository : Failed to connect to http:// ....git (status = 401)
Would be fine if someone has an idea.
This issue was initially detected with the Git client plugin 1.4.3, and supposed to be fixed in 1.4.4 by Nicolas De Loof:
See issue 20175.
Try and downgrade the git client plugin to 1.4.4.
If 1.4.5 introduced a regression, then re-open issue 20175.
Florian's answer (upvoted) suggest a possible cause for git client plugin to 1.4.5, regarding the
.netrc
format.(one line only, instead of several lines)
Florian insists in the comments about the presence of some bugs:
He mentions the presence of a jenkinsci/git-client-plugin patch on GitHub.