ERROR: Timeout after 10 minutes

更多运维进阶知识请看:
​​https://edu.51cto.com/course/30254.html​​
​​https://edu.51cto.com/course/31241.html​

问题描述:

jenkins构建过程中,如果项目工程太大,构建很可能会耗时很长,而且最终可能会构建失败,提示:

........
using GIT_SSH to set credentials jenkinsdev_ssh
 > git fetch --tags --progress git@git.xxxxx.net:php/Code-Publish.git +refs/heads/*:refs/remotes/origin/*
ERROR: Timeout after 10 minutes
ERROR: Error fetching remote repo 'origin'
........

更多提示信息如下:

........
using GIT_SSH to set credentials jenkinsdev_ssh
 > git fetch --tags --progress git@git.xxxxx.net:php/Code-Publish.git +refs/heads/*:refs/remotes/origin/*
ERROR: Timeout after 10 minutes
ERROR: Error fetching remote repo 'origin'
..........
Receiving objects:  31% (900/2832), 538.87 MiB | 10.88 MiB/s   
Receiving objects:  32% (907/2832), 563.20 MiB | 14.53 MiB/s   
Receiving objects:  32% (916/2832), 587.15 MiB | 27.54 MiB/s   
Receiving objects:  32% (930/2832), 635.47 MiB | 48.01 MiB/s   
Receiving objects:  33% (935/2832), 635.47 MiB | 48.01 MiB/s   
Receiving objects:  34% (963/2832), 690.59 MiB | 49.73 MiB/s   
Receiving objects:  35% (992/2832), 690.59 MiB | 49.73 MiB/s   
Receiving objects:  35% (1003/2832), 690.59 MiB | 49.73 MiB/s   
Receiving objects:  35% (1009/2832), 722.67 MiB | 32.99 MiB/s   
Receiving objects:  35% (1013/2832), 733.82 MiB | 20.59 MiB/s   
Receiving objects:  36% (1020/2832), 733.82 MiB | 20.59 MiB/s   
Receiving objects:  36% (1020/2832), 744.97 MiB | 15.02 MiB/s   
Killed by signal 15.
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2016)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1735)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:72)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:420)
	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
	at hudson.remoting.UserRequest.perform(UserRequest.java:212)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:369)
	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
	Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to jenkins-slave-192.168.0.142
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
		at hudson.remoting.Channel.call(Channel.java:955)
		...........
问题原因:

项目工程太大,构建耗时太长,而Jenkins默认的构建超市时间是10min,当项目构建时间超过这个时间时,项目最终会构建失败

处理方法

处理方法之一:调整项目的构建超时时间,具体操作如下

选择构建超时的Jenkins任务,点 “配置” ,点 “源码管理” ,找到 “Additional Behaviours” , 点 “Add”,选择 “Advanced clone behaviours”

设置Timeout的时间(例如:30分钟)
在这里插入图片描述
以上配置好应用并保存之后,再次构建项目,成功!

当然这只是解决问题的方式之一,如果能尽量优化项目工程结构,缩小项目工程那是再好不过了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值