我正在尝试克隆来自Jenkins的git repo,它在以下异常时失败(如果我手动尝试它工作正常),我正在使用http(而不是https)。
stderr: error: Couldn't resolve host 'atlgit-01.us.manh.com' while accessing http://svadlamudi:Manh6999@atlgit-01.us.manh.com:7990/scm/rndwmar/te.git/info/refs?service=git-upload-pack
fatal: HTTP request failed
repo url:http://Svadlamudi@atlgit-01.us.manh.com:7990/scm/rndwmar/test.git
我正在使用GIT插件2.0,Git客户端插件1.4.6和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 http://cruise_control_user@atlgit-01.us.manh.com:7990/scm/rndwmar/te.git
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:310)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:828)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:861)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1387)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:676)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:581)
at hudson.model.Run.execute(Run.java:1593)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
Caused by: hudson.plugins.git.GitException: Failed to connect to http://cruise_control_user@atlgit-01.us.manh.com:7990/scm/rndwmar/te.git using credentials (status = 401)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1437)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1379)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:304)
... 10 more
答案 0 :(得分:0)
如果它是手动操作而不是Jenkins,这意味着Jenkins不会在shell会话中的Windows用户所在的位置查找凭据(用户名/密码)。
这些凭据应位于%HOME%_netrc file:
machine atlgit-01.us.manh.com
login cruise_control_user
password <password>
您需要确保Jenkins正在寻找相同的%HOME%
。