Jenkins 构建报错:index-pack died of signal 15
坦白背景
主要看到的报错内容是这一块
error: index-pack died of signal 15
11:18:19 fatal: index-pack failed
11:18:19
11:18:19 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2174)
11:18:19 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1866)
11:18:19 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:78)
11:18:19 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:547)
11:18:19 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:760)
11:18:19 at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1152)
11:18:19 at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1192)
11:18:19 at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:124)
11:18:19 at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
11:18:19 at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
11:18:19 at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
11:18:19 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
11:18:19 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
11:18:19 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
11:18:19 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
11:18:19 at java.lang.Thread.run(Thread.java:748)
11:18:19 [Pipeline] }
11:18:19 [Pipeline] // stage
11:18:19 [Pipeline] stage
11:18:19 [Pipeline] { (Deploy)
11:18:19 Stage "Deploy" skipped due to earlier failure(s)
11:18:19 [Pipeline] }
11:18:19 [Pipeline] // stage
11:18:19 [Pipeline] }
11:18:19 ERROR: Error cloning remote repo 'origin'
其实往上面翻一翻就可以看到精准的报错,是 clone 仓库的时候超时导致的
11:18:19 ERROR: Timeout after 10 minutes
11:18:19 ERROR: Error cloning remote repo 'origin'
去 gitlab 查看,发现这个仓库有 1.8G 那么大,git 和 jenkins 不在同一个公有云,带宽(只有1MB,实际均值在 500KiB/s)的限制,导致 10分钟根本拉不完
解决方案
方案一
让开发整理自己的 git 仓库,把仓库缩小
方案二
增加超时时间
pipeline - checkout scm
增加
extensions: [[$class: 'CloneOption', timeout: 60]]
指定超时时间,单位是分钟,默认是 10分钟
checkout scm: [$class: 'GitSCM', extensions: [[$class: 'CloneOption', timeout: 60]], userRemoteConfigs: [[credentialsId: 'deploy', url: "${GIT_URL}"]], branches: [[name: "${GIT_BRANCH}"]]], poll: false
页面配置
- jenkins项目 -> 配置(configure) -> git -> Additional Behaviours -> add -> advanced clone behaviours
分类:
CICD
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类
2021-04-23 Elasticsearch 7.12 启用 x-pack 组件