1

I am trying to clone a git repo from Jenkins, which is failing with below exception (if I try manually it works fine), I am using http (not https).

stderr: error: Couldn't resolve host 'atlgit-01.us.manh.com' while accessing http://asdasd@server:7990/scm/asd/ab.git/info/refs?service=git-upload-pack 
fatal: HTTP request failed

repo url:http://asdasd@server/scm//test.git

I am using GIT plug-in 2.0, Git client plug-in 1.4.6 and Jenkins:1.523

Full stack trace:
Cloning the remote Git repository
Cloning repository http://cruise_control_user@atlgit-01.us.manh.com:7990/scm/rndwmar/te.git
git --version
git version 1.8.3.msysgit.0
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Could not clone 
vasu
  • 97
  • 10

1 Answers1

0

If it works manually and not with Jenkins, that means that Jenkins doesn't look for the credentials (username/password) at the same place than the Windows user in a shell session.

Those credentials should be in a %HOME%_netrc file:

machine  atlgit-01.us.manh.com
login cruise_control_user
password <password>

You need to make sure Jenkins is looking for the same %HOME%.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for the reply, but i see user.home C:\Users\cruise_control_user @Jenkins.Even i tried providing user credentials through "credentials" option. – vasu Nov 28 '13 at 01:52
  • i tried removing .netrc frm %HOME%, then it was throwing error "at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1437)", it means it is picking up user credentials earlier ... – vasu Nov 28 '13 at 01:57
  • @vasu can you use that same `.netrc` file in your user account homedir? (ie. when doing a push manually, outside of Jenkins). That would be to check if its content is accurate and does provide valid credentials. – VonC Nov 28 '13 at 06:15