启用checkout后Git LFS拉取,Jenkins Pipeline提示“该阶段无步骤”
I've hit a puzzling issue with my Jenkins Pipeline recently. After turning on the "Pull Git LFS After Checkout" feature, my pipeline starts displaying the message "No Steps in This Stage" for the checkout stage—even though the checkout process should be running as expected.
I've tested two different ways to enable this feature, and both lead to the same problem:
- Configuring it directly through the Jenkins multi-branch project settings
- Using a dedicated
Jenkinsfile_ios(we maintain separate files for iOS and Android builds)
I've spent hours searching through documentation and community threads but haven't found anyone reporting this exact issue. Right now, I suspect it might be a bug with the Git plugin, and I'm preparing to file an issue with Jenkins. But before I do that, I'm hoping to get some guidance or fixes from the community.
Environment Details
- OS: OS X High Sierra
- Jenkins Version: 2.89.2
- Relevant Plugin Versions:
- git: 3.7.0 (the issue also occurs with version 3.6.4)
- git-client: 2.7.0
- git-server: 1.7
- All Pipeline-related plugins are up to date
Potential Troubleshooting Steps & Workarounds
Explicitly Define the Checkout Step in Your Jenkinsfile
Instead of relying on the automatic checkout from multi-branch configurations, try adding an explicit checkout step with LFS pull enabled directly in your pipeline code. For example:stage('Checkout') { steps { checkout([ $class: 'GitSCM', branches: [[name: '*/main']], userRemoteConfigs: [[url: 'your-repo-url']], extensions: [[$class: 'GitLFSPull']] ]) } }This bypasses the automatic checkout setup and lets you control the LFS pull directly in your pipeline logic.
Verify Plugin Compatibility
Even with recent plugin versions, double-check for known compatibility conflicts between the git plugin, git-client plugin, and your Jenkins version. Older Jenkins releases can sometimes have unexpected clashes with newer plugin updates.Enable Debug Logging
Turn on debug logging for the Git and Pipeline plugins in Jenkins (via Manage Jenkins → System Log → Add new log recorder). This will generate detailed output about what's happening during the checkout stage, which might reveal why the steps are being skipped or unrecognized.Test with a Minimal Pipeline
Create a simplified Jenkinsfile that only includes the checkout step with LFS enabled, and run it in a fresh freestyle or pipeline project. This helps isolate whether the issue is specific to your multi-branch setup or the structure of your existing Jenkinsfile.
内容的提问来源于stack exchange,提问作者Yen

