2016-11-28 65 views
6

我配置了Jenkins來輪詢Git存儲庫,我使用的是https而不是ssh。以下URL已配置,我使用用戶名和密碼。git fetch --tags --progress在Jenkins中超時,在命令行上工作正常

https://[email protected]:8443/scm/ourrepo/ourrepo-ios.git 

當我運行構建時,它停頓了10分鐘並超時。當我複製行,其中超時並粘貼命令在同一臺機器上線運行詹金斯(MacOS的服務器),它的工作原理:

git fetch --tags --progress https://[email protected]:8443/scm/ourrepo/ourrepo-ios.git +refs/heads/*:refs/remotes/origin/* 

爲什麼堅持10分鐘?我試圖使用錯誤的憑據,並在一秒鐘內失敗。這不是一個巨大的回購。


日誌:

Started by user Jenkins Admin 
Building in workspace /Users/Shared/Jenkins/Home/workspace/Build and test new commits on develop 
> git rev-parse --is-inside-work-tree # timeout=10 
Fetching changes from the remote Git repository 
> git config remote.origin.url https://[email protected]:8443/scm/ourrepo/ourrepo-ios.git # timeout=10 
Fetching upstream changes from https://[email protected]:8443/scm/ourrepo/ourrepo-ios.git 
> git --version # timeout=10 
using GIT_ASKPASS to set credentials 
> git fetch --tags --progress https://[email protected]:8443/scm/ourrepo/ourrepo-ios.git +refs/heads/*:refs/remotes/origin/* 
ERROR: Timeout after 10 minutes 
ERROR: Error fetching remote repo 'origin' 
hudson.plugins.git.GitException: Failed to fetch from https://[email protected]:8443/scm/ourrepo/ourrepo-ios.git 
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:803) 
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1063) 
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094) 
    at hudson.scm.SCM.checkout(SCM.java:495) 
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1278) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604) 
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) 
    at hudson.model.Run.execute(Run.java:1728) 
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 
    at hudson.model.ResourceController.execute(ResourceController.java:98) 
    at hudson.model.Executor.run(Executor.java:404) 
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://[email protected]:8443/scm/ourrepo/ourrepo-ios.git +refs/heads/*:refs/remotes/origin/*" returned status code 143:stdout: 
stderr: 
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1745) 
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1489) 
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64) 
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315) 
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:801) 
    ... 11 more 
ERROR: null 
Finished: FAILURE 
+1

執行git的投票記錄顯示有用的東西? –

+1

你可以將詹金斯'建立的控制檯輸出'附加到你的原始文章? –

+0

我剛剛添加了它 –

回答

3

請檢查用戶是否存在jenkins您的操作系統,它有正確的權限。

如何設置jenkins用戶在Mac OS X:http://www.cimgf.com/2015/05/26/setting-up-jenkins-ci-on-a-mac-2/

+0

關於Windows上的相同錯誤的任何想法? – IronSean

+0

如果您的windows上的Jenkins從站作爲服務在用戶「本地服務」下運行,則可以將其更改爲另一個「真實」用戶。所以你可以用這個用戶登錄到Windows並檢查任何命令(即「git clone」)和任何權限 – Ivan

+0

請更新URL,它返回頁面未找到! –

相關問題