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
- incorrect credentials were provided with the Jenkins job definition.
- The repository is so large that it takes more than 10 minutes to clone.
- 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.