git 在发生 10 分钟错误后构建 jenkins 项目超时

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22013217/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 17:47:18  来源:igfitidea点击:

On building jenkins project timeout after 10 minute error happens

gitjenkins

提问by Tony Davis

I am using jenkins to build my git remote project. The problem is log says 'timeout after 10 min'. Receiving object starts and at 56% something happens.

我正在使用 jenkins 来构建我的 git 远程项目。问题是日志显示“10 分钟后超时”。接收对象开始,并且在 56% 时发生了一些事情。

回答by Edson Medina

Edit your job configuration, and under git plugin section:

编辑您的作业配置,并在 git plugin 部分下:

  • Click "Add"
  • Click "Advanced clone behaviours"
  • Set the number of minutes you want in "Timeout (in minutes) for clone and fetch operation"
  • 点击“添加”
  • 单击“高级克隆行为”
  • 在“克隆和获取操作的超时(以分钟为单位)”中设置所需的分钟数

I recommend checking also the "shallow clone" option. It fetches only the last state of the repository (without the history), so it's much faster.

我建议还检查“浅克隆”选项。它仅获取存储库的最后状态(没有历史记录),因此速度要快得多。

回答by Naren-Mehta

I have also face the same error while click on Build Now Button in Jenkins.

单击 Jenkins 中的“立即构建”按钮时,我也遇到了同样的错误。

Why this error comes ? Ans: This error was coming because of low Internet connection or may be the size of you project in github is large, so jenkins not able load/cone that project from git server.

为什么会出现这个错误?Ans:这个错误是因为互联网连接低或者可能是你在 github 中的项目大小很大,所以 jenkins 无法从 git 服务器加载/锥化该项目。

Solution steps:

解决步骤:

  1. For resolve the problem we have to edit in Jenkins project configuration and find the "git".
  2. Then click on "Add" button and select "Advanced clone behaviours".
  3. Then in Timeout (in minutes) for clone and fetch operations box put any number which is more then 10, (I put 60 here).
  4. Apply and the save the configuration.
  5. Build Now again , It took some more time to build , but it will fixed this error.
  1. 为了解决这个问题,我们必须在 Jenkins 项目配置中进行编辑并找到“git”。
  2. 然后单击“添加”按钮并选择“高级克隆行为”。
  3. 然后在克隆和获取操作的超时(以分钟为单位)框中输入大于 10 的任何数字(我在此处输入 60)。
  4. 应用并保存配置。
  5. 现在再次构建,构建需要更多时间,但它会修复此错误。

Cheers :)

干杯:)