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.
Table of Contents
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.
Jenkins pipeline error timeout after 10 minutes fixed
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 the timeout is 120 minutes for the Git checkout source from the repository.
Conclusion
Through the article, you have solved the problem of Jenkins pipeline error timeout after 10 minutes as above. I hope will this your helpful.
Thank you for reading the DevopsRoles page!