jenkinsci / jenkinsci/git-plugin

[JENKINS-70010] SCM 'hudson.scm.NullSCM' is not of type GitSCM

Open
#3,766 5 comments 0 reactions 0 assignees View on GitHub
component:git-forensics-plugin component:git-plugin component:gitlab-branch-source-plugin component:pipeline imported-jira-issue priority:critical resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

In my scripted multibranch pipeline (using GitLab branch source) I use something like

node(label: 'builder') {

checkout scm
...
}
node(label: 'test') {
 dir('src') {
checkout scm
  }
...
}


Sometimes, the second checkout does not work because

```
[GitCheckoutListener] SCM 'hudson.scm.NullSCM' is not of type GitSCM
```

No error is thrown, tough. The build continues and fails later because there are no files in "src". This happens only very occasionally, simply re-running the pipeline will work in most cases.

Any clue how "scm" can become a NullSCM during the build?

---
Originally reported by gordin, imported from: SCM 'hudson.scm.NullSCM' is not of type GitSCM


  • status: Open
  • priority: Critical
  • component(s): git-forensics-plugin, git-plugin, gitlab-branch-source-plugin, pipeline
  • resolution: Unresolved
  • votes: 0
  • watchers: 4
  • imported: 2025-12-02

Raw content of original issue

In my scripted multibranch pipeline (using GitLab branch source) I use something like



node(label: 'builder') {

checkout scm
...
}
node(label: 'test') {
 dir('src') {
checkout scm
  }
...
}



Sometimes, the second checkout does not work because



[GitCheckoutListener] SCM 'hudson.scm.NullSCM' is not of type GitSCM


No error is thrown, tough. The build continues and fails later because there are no files in "src". This happens only very occasionally, simply re-running the pipeline will work in most cases.

Any clue how "scm" can become a NullSCM during the build?

environment

```
Jenkins 2.346.1

GitLab Branch Source Version 630.v04ca_c57fa_880

Git Version 4.11.3

Git client Version 3.11.0
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.