Discover how to fix Git cloning issues in Jenkins pipelines on Windows by adjusting pipeline settings for a smooth build experience.
---
This video is based on the question https://stackoverflow.com/q/69103349/ asked by the user 'Lieven Cardoen' ( https://stackoverflow.com/u/26521/ ) and on the answer https://stackoverflow.com/a/69179762/ provided by the user 'Lieven Cardoen' ( https://stackoverflow.com/u/26521/ ) at 'Stack Overflow' website. Thanks to these great users and Stackexchange community for their contributions.
Visit these links for original content and any more details, such as alternate solutions, latest updates/developments on topic, comments, revision history etc. For example, the original title of the Question was: Error cloning Git Repo on Jenkins Windows Slave
Also, Content (except music) licensed under CC BY-SA https://meta.stackexchange.com/help/l...
The original Question post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license, and the original Answer post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license.
If anything seems off to you, please feel free to write me at vlogize [AT] gmail [DOT] com.
---
Troubleshooting Git Cloning Issues in Jenkins on Windows
Running into issues while cloning a Git repository in Jenkins can be frustrating, especially when you're relying on automated builds for your development workflow. A common problem developers face is the error code 130 during cloning operations. Recently, a user encountered this exact issue while running a Jenkins pipeline on a Windows slave. In this post, we will explore this issue, what's causing it, and how to resolve it effectively.
Understanding the Problem
The user reported that their Jenkins pipeline—executed primarily on a Windows slave—suddenly started failing during the Git clone process, generating a status code of 130. Here are the specifics of the environment:
Git version on master: 2.21.0.windows.1
Git version on slave: 2.22.0.windows.1
Jenkins version: 2.289.2
After adjusting the timeout setting to a staggering 600 minutes, the expected improvement did not occur, suggesting that the issue might not be related to timeouts at all. Furthermore, the pipeline had been functioning without hiccups until recently, making the sudden failure all the more perplexing.
What Does Status Code 130 Mean?
Status code 130 typically indicates that a command was terminated due to an interrupt signal (like pressing CTRL+ C), suggesting that something stopped the Git process from completing.
Digging Deeper into the Solution
After investigating the problem, it was determined that the solution lay within Jenkins' job configuration settings. Here’s a step-by-step solution that resolved the user’s issue.
Step 1: Disable Lightweight Checkout
The primary solution was to uncheck the Lightweight checkout option in the Jenkins pipeline job configuration. Here's how you can do that:
Navigate to your Jenkins Pipeline job.
Click on Configure in the side menu.
Locate the Source Code Management section.
Find the option for Lightweight checkout and uncheck it.
Save your changes and run the pipeline again.
Why Did This Work?
Initially, the pipeline output indicated that lightweight checkout support was not available, which led to a fallback to a full checkout method. This fallback, however, did not provide the same result as when Lightweight checkout is unchecked, hence causing the issue. By properly configuring the pipeline to disable lightweight checkout, it ensured that the full checkout was executed without any interruptions.
Conclusion
If you encounter the error cloning Git repo issue and see status code 130 in Jenkins while running on Windows, consider trying the steps outlined above. Disabling the Lightweight checkout option is often a straightforward fix that can save you from hours of debugging.
By understanding the specifics of the problem and making small changes in the Jenkins configuration, you can restore your build pipeline's functionality. Remember to always check your job settings after any modifications to the environment or updates, as these can sometimes lead to unexpected issues.
If you have any questions or further issues, feel free to share your experience in the comments below!
Информация по комментариям в разработке