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

On Mon, Feb 20, 2017 at 2:48 AM Victor Martinez <
victormartinezru...@gmail.com> wrote:

> Hi,
>
> Default git checkout timeout is 10 minutes, you can tweak that value:
> -
> https://jenkins.io/doc/pipeline/steps/workflow-scm-step/#checkout-general-scm
>
> $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
> <https://issues.jenkins-ci.org/browse/JENKINS-11286>). Note that property
> should be set on both master and slave to have effect (see JENKINS-22547
> <https://issues.jenkins-ci.org/browse/JENKINS-22547>).
>
> Type: int
>
> Cheers
>
>
> On Monday, 20 February 2017 08:55:14 UTC, Ruchir Brahmbhatt wrote:
>
> 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.
>
> --
> 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-users+unsubscr...@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
> <https://groups.google.com/d/msgid/jenkinsci-users/394602bb-98d1-401e-a0fd-7e5957a4d7c0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtGaRi1V43xhvbZPme-HnycReJ3Tt8M4GEKBa7uAGErHhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to