简体   繁体   English

从Git获取代码时,Jenkins挂起

[英]Jenkins hangs when fetching code from Git

I setup a new Jenkins job to fetch source code from a local Git. 我设置了一个新的Jenkins作业来从本地Git获取源代码。 I can fetch from the server using git clone on cmd. 我可以在cmd上使用git clone从服务器上获取。 When I fetch source code using Jenkins job it hangs with the following message for 10 minutes before throws time-out error 当我使用Jenkins作业获取源代码时,它会在抛出超时错误之前挂起以下消息10分钟

Building remotely on Windows 2001 in workspace D:\\ASDF555\\Jenkins\\workspace\\TEST_JOB Fetching changes from the remote Git repository Fetching upstream changes from git@test.test.texas555:team888/product555.git 在工作空间D:\\ ASDF555 \\ Jenkins \\ workspace \\ TEST_JOB上远程构建Windows 2001从远程Git存储库获取更改从git@test.test.texas555获取上游更改:team888 / product555.git

I also configure path to use git.exe under cmd directory. 我还配置了在cmd目录下使用git.exe的路径。 How can I fix this problem? 我该如何解决这个问题?

Make sure your workspace is empty. 确保您的工作区为空。 I had this happen intermittently and then noticed it was only happening in one workspace. 我间歇性地发生了这种情况,然后注意到它只发生在一个工作空间中。 I ssh'ed into the jenkins server and manually deleted everything in the workspace. 我ssh'ed进入jenkins服务器并手动删除工作区中的所有内容。

Git no longer hangs. Git不再挂起。

Login into the jenkins servers as "jenkins" user if you aren't already and clone from the cmd. 如果您还没有登录jenkins服务器作为“jenkins”用户并从cmd克隆。 Check if it's successful? 检查一下是否成功? If it is, then try to run the job from GUI. 如果是,则尝试从GUI运行作业。

How long time does it usually take to make the clone from execute windows shell ? 从执行Windows shell制作克隆通常需要多长时间?

I had a similar problem and i had to start jenkins with this option on windows. 我遇到了类似的问题,我不得不在Windows上使用此选项启动jenkins。 Find the jenkins.xml file and edit the line with arguments for java. 找到jenkins.xml文件并使用java参数编辑该行。 you have to set the git timeout value to something higher than you have now. 你必须将git超时值设置为比现在更高的值。

<executable>java</executable>
<arguments>-Dorg.jenkinsci.plugins.gitclient.Git.timeOut=400 </arguments>

Save the file and restart jenkins 保存文件并重新启动jenkins

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM