ERROR: Timeout after 10 minutes

4,858 views
Skip to first unread message

Ruchir Brahmbhatt

unread,
Feb 20, 2017, 3:55:14 AM2/20/17
to Jenkins Users
Hi,

I have configured bitbucket team/project pipeline and using jenkinsfile. One of the repository is large and timing out during fetch as below.
ERROR: Timeout after 10 minutes
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://bitbucket.org/ecosmobteam/test-cawsup-awpbx-voip.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:806)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1066)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108)
at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:85)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:232)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://bitbucket.org/ecosmobteam/test-cawsup-awpbx-voip.git +refs/heads/master" returned status code 143:

I found links mentioning increasing timeout for git in jobs but didn't find way to do  it with bitbucket repo and jenkinsfile.

Victor Martinez

unread,
Feb 20, 2017, 4:48:54 AM2/20/17
to Jenkins Users
Hi,

Default git checkout timeout is 10 minutes, you can tweak that value:

$class: CheckoutOption timeout::::

+

Specify a timeout (in minutes) for checkout.
This option overrides the default timeout of 10 minutes.
You can change the global git timeout via the property org.jenkinsci.plugins.gitclient.Git.timeOut (see JENKINS-11286). Note that property should be set on both master and slave to have effect (see JENKINS-22547).

Type: int


Cheers

Mark Waite

unread,
Feb 20, 2017, 8:23:09 AM2/20/17
to Jenkins Users
A common source of timeout on fetch (clone) is incorrect or missing credentials.  If your repository is private and you have not assigned credentials during the checkout, the checkout may fail with a timeout rather than providing a clear error message that access was denied.

A less common source of timeout on fetch (clone) is embedding the username / password credentials directly into the https URL.  JENKINS-41066 describes that problem for Bitbucket, GitHub, and Visual Studio Online repositories.

Another less common source of timeout on fetch (clone) is using the wrong type of credential.  The git plugin supports username / password credentials with https URL's to the repository, and it supports private key credentials with ssh/scp URL's to the repository.  It does not support private key credentials with https URL's.  It does not support username / password credentials with ssh/scp URL's.

If you've verified that credentials are assigned to the pipeline checkout command correctly and are working as expected (for example, the log file includes progress indicators which show that it has started to read some of the repository, but then that operation is killed after 10 minutes), then you probably need to extend the timeout with the CloneOption rather than the CheckoutOption.

Use the "Pipeline Syntax" link on the job definition page, select "checkout: General SCM" from the drop down list, and select Git as the SCM.  It will allow you to add "Additional Behaviours" including "Advanced clone behaviours".  Within the "Advanced clone behaviours", you can define a reference repository (local pointer to a bare git repository which acts as a cache to reduce data transfer time) and you can define the timeout for clone.

If you have a slow local file system (SMB/CIFS, NFS, AFS, etc.) and a large repository, you may find that the checkout option also needs a timeout value set.  That is much less common, and usually means that you should improve the performance of your file systems rather than increase the timeout of the checkout.

Thanks,
Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/394602bb-98d1-401e-a0fd-7e5957a4d7c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruchir Brahmbhatt

unread,
Feb 21, 2017, 9:22:54 AM2/21/17
to Jenkins Users
Thanks Mark for comprehensive reply. Yes timeout is due to large repository. I can try the solution of generating custom command through pipeline syntax and creating reference repo but when I start the built, it will checkout automatically and that step will itself fail due to timeout so Jenkinsfile will never get chance to get executed.

Mark Waite

unread,
Feb 21, 2017, 9:37:25 AM2/21/17
to jenkins...@googlegroups.com
The reference repository and clone timeout can be set in the pipeline job definition as well, so long as you choose "Git" as the SCM source.  I don't think the same options are available if you choose another SCM source (like GitHub).

If you don't need the full history of the repository, then you can consider using a shallow clone.  That only copies the number of commits you specify.

If you don't need the full working directory tree of the repository, you can consider using a sparse checkout.  That only performs a checkout of the specific directories you specify.

If you'd like a video overview of some of the options available to better manage large git repositories, an online Jenkins Area Meetup (JAM) has some slides and commentary on managing large git repositories in the first 10 minutes of the video.  Refer to https://www.youtube.com/watch?v=TsWkZLLU-s4 

Mark Waite

Reply all
Reply to author
Forward
0 new messages