On building jenkins project timeout after 10 minute error happens

GitJenkins

Git Problem Overview


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.

Git Solutions


Solution 1 - Git

Edit your job configuration, and under git plugin section:

  • 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.

Solution 2 - Git

I have also face the same error while click on Build Now Button in 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.

Solution steps:

  1. To 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 behaviors.
  3. 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 fixed the error.

Cheers :)

Solution 3 - Git

As @edison-medina mentions, increasing the timeout may help but in my case the shallow clone was a better option. The shallow clone will dramatically reduce the time needed to clone a repo, specially one that has been growing for some time and may have hundreds or thousands of commits per file, because you'll only fetch the file version history indicated by the "depth" parameter on the clone command. For most CI use-cases, using "1" is the best option since only the latest version of a file is needed to complete a build.

To set this up in Jenkins, you'll need to open your project's configuration screen and find the section on Git, click the "Add" button under "Additional Behaviors", and select "Advanced clone behaviors". Check the "Shallow clone" option and set the depth to "1".

You'll need to do this for each project in Jenkins. I haven't seen a way to do this globally for all projects.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTony DavisView Question on Stackoverflow
Solution 1 - GitEdson MedinaView Answer on Stackoverflow
Solution 2 - GitNaren-MehtaView Answer on Stackoverflow
Solution 3 - GitsherbView Answer on Stackoverflow