2013-11-27 76 views
1

時解析主機'gitserver.us.manh.com'我試圖從Jenkins克隆一個git回購,這與以下異常失敗(如果我嘗試手動它工作正常),我使用http(不是https)。Jenkins-git克隆失敗無法在訪問http://

stderr: error: Couldn't resolve host 'atlgit-01.us.manh.com' while accessing http://svadlamudi:[email protected]:7990/scm/rndwmar/te.git/info/refs?service=git-upload-pack 
fatal: HTTP request failed 

repo url:http://[email protected]:7990/scm/rndwmar/test.git 

我使用GIT插件2.0,Git的客戶端插件1.4.6和詹金斯:1.523

Full stack trace: 
Cloning the remote Git repository 
Cloning repository http://[email protected]: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://[email protected]: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://[email protected]: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

如果手動,而不是可與詹金斯,這意味着詹金斯沒有按」在shell會話中查找與Windows用戶相同位置的憑據(用戶名/密碼)。

這些憑據應在%HOME%_netrc file

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

你需要確保詹金斯尋找同樣%HOME%

+0

感謝您的回覆,但我看到了user.home C:\ Users \ cruise_control_user @ Jenkins。即使我嘗試通過「credentials」選項提供用戶憑據。 – vasu

+0

我試圖刪除.netrc frm%HOME%,然後它拋出錯誤「在org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1437)」,這意味着它正在提取用戶憑證更早... – vasu

+0

@vasu您可以在您的用戶帳戶homedir中使用相同的'.netrc'文件嗎? (即在Jenkins之外進行手動推送時)。這將是檢查其內容是否準確,並提供有效的憑據。 – VonC