Jenkins pipeline error timeout after 10 minutes

How to fix Error fetching remote repository ‘origin’ from Jenkins build jobs. In this tutorial, I will be fixing the Jenkins pipeline error timeout after 10 minutes.

Jenkins build job error code as below

ERROR: Timeout after 10 minutes
ERROR: Error fetching remote repo 'origin'
Caused by: hudson.plugins.git.GitException: Command "/usr/local/git/bin/git fetch --tags --progress https://gitlab.com/devopsroles.git +refs/heads/*:refs/remotes/origin/*" returned status code 143:

Cause by

  1. incorrect credentials were provided with the Jenkins job definition.
  2. The repository is so large that it takes more than 10 minutes to clone.
  3. Bandwidth to the git server is slow enough that it takes more than 10 minutes to clone.

How to fix it

stage('Getsource') { // for display purposes
    // Get some code from a GitHub repository
    checkout([$class: 'GitSCM',
        branches: [[name: "${TARGET_BRANCH}"]],
        extensions: [[$class: 'CloneOption', timeout: 120]],
        gitTool: 'Default', 
        userRemoteConfigs: [[credentialsId: 'w55f8df9-0183-4b80-96d8-917ccccccccccc', url: 'https://gitlab.com/devopsroles.git']]
    ])
}

In my example, I will Increase timeout is 120 minutes for Git checkout source from the repository.

Conclusion

Thought the article, you have solved problem Jenkins pipeline error timeout after 10 minutes as above. I hope will this your helpful.

, ,

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created DevopsRoles.com site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment moderation is enabled. Your comment may take some time to appear.

This site uses Akismet to reduce spam. Learn how your comment data is processed.