我在为Nightly build构建Jenkins时遇到了这个问题.请注意,存储库项目"project1"很大,大约为900MB.请让我知道如何解决这个问题.
Started by user anonymous
Building in workspace C:\Users\user1\.jenkins\jobs\Nightly Build\workspace
Fetching changes from the remote Git repository
Fetching upstream changes from git@github.com:MyOrg/projectgroup/project1
ERROR: Timeout after 10 minutes
FATAL: Failed to fetch from git@github.com:MyOrg/projectgroup/project1
hudson.plugins.git.GitException: Failed to fetch from git@github.com:MyOrg/projectgroup/project1
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:612)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:836)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:861)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1412)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:652)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:557)
at hudson.model.Run.execute(Run.java:1679)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:509)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:230)
Caused by: hudson.plugins.git.GitException: Command "fetch -t git@github.com:MyOrg/projectgroup/project1 +refs/heads/*:refs/remotes/origin/*" returned status code -1:
stdout:
stderr:
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:981)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:920)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.fetch(CliGitAPIImpl.java:187)
at hudson.plugins.git.GitAPI.fetch(GitAPI.java:229)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:610)
... 10 more
Run Code Online (Sandbox Code Playgroud)
boi*_*ged 27
我即将使用Workaround#2,但它看起来像git插件2.0.3现在可以在UI中配置,虽然它有点隐藏并且是每个项目.
转到项目的配置屏幕,源代码管理部分,Git,附加行为,添加,高级克隆行为,克隆和获取操作的超时(以分钟为单位).
如果你想要一个全局设置,我会使用DevHopeful_2012建议的解决方法#2.
kev*_*nmm 18
看起来这是一个已知问题.参见JENKINS-20445,JENKINS-20387以及其他几个似乎突然爆发的问题.
根据这些错误报告,这只发生在较新版本的Git插件中,因此您可以降级或尝试一些解决方法:
解决方法#1 -创建一个本地裸露参考克隆减少的时候,如前所述这里.
如果从Jenkins到git存储库只有30 kb/s的吞吐量,您应该考虑将存储库的裸副本克隆到Jenkins服务器上的中心位置,然后使用"高级克隆行为"执行克隆以使用引用库.这将显着减少从git服务器传输到Jenkins的数据量.
在我的Debian Jenkins机器上,我这样做:
Run Code Online (Sandbox Code Playgroud)$ sudo mkdir -p /var/cache/git/mwaite $ sudo chown mwaite.mwaite /var/cache/git/mwaite $ cd /var/cache/git/mwaite $ git clone --bare https://github.com/jenkinsci/jenkins.git在Jenkins机器上提供裸克隆之后,将该高级行为添加到作业,它应该执行得更好.
解决方法#2 - 使用Git.timeOut属性增加超时以允许完成长初始克隆过程:
java -Dorg.jenkinsci.plugins.gitclient.Git.timeOut=60 -jar jenkins.war
Run Code Online (Sandbox Code Playgroud)
这个SO问题是如何为Jenkins服务设置属性的一个很好的例子.另请注意,此值以分钟为单位,而不是秒.这种解决方法是大卫的礼貌.
后一种解决方法对我有用.虽然,我必须承认我更喜欢使用引用仓库,但我不相信它适用于多配置工作,例如我的工作.并且,预先警告为每个从节点设置属性然后在内部记录我们必须在所有节点上使用大型Git repos进行设置,这是令人惊讶的痛苦.
Fac*_*alm 12
仅限WINDOWS
您的ssh连接可能未正确配置.如果未建立与git存储库的ssh连接,则Jenkins构建可能看起来好像挂起并最终超时.
默认情况下,Jenkins安装程序将Jenkins设置为作为服务运行,该服务作为"本地系统帐户"运行,而不是您的用户帐户.由于"本地系统帐户"没有设置SSH密钥或known_hosts,"git clone"将失败.
您只需将C:\ Program Files(x86)\ Git\.ssh复制到C:\ Windows\SysWOW64\config\systemprofile\.ssh("本地系统帐户"主页)
也,
重要提示:确保您的ssh密钥没有密码!在克隆存储库时Jenkins似乎会挂起,但实际上它是在后台阻止你输入密码的ssh阻塞.
http://computercamp-cdwilson-us.tumblr.com/post/48589650930/jenkins-git-clone-via-ssh-on-windows-7-x64中的详细步骤
| 归档时间: |
|
| 查看次数: |
26743 次 |
| 最近记录: |