jenkinsci / jenkinsci/git-plugin

Null pointer exception when processing notifyCommit

Open
#3,940 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

### Jenkins and plugins versions report

Environment

As described in my [docker-lfs repository](https://github.com/MarkEWaite/docker-lfs/blob/0bcb702b873ac56487438965fdb3de0e4ab721fe/plugins.txt#L57)

```text
Jenkins: 2.541.3
OS: Linux - 6.8.0-106-generic
Java: 25.0.2 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
PrioritySorter:936.v2c01c6b_84449
adoptopenjdk:146.v1898676a_f04e
analysis-model-api:13.21.0-945.va_f5a_0b_c1404b_
ant:520.vd082ecfb_16a_9
antisamy-markup-formatter:173.v680e3a_b_69ff3
apache-httpcomponents-client-4-api:4.5.14-269.vfa_2321039a_83
apache-httpcomponents-client-5-api:5.6-191.vb_47e2b_41c698
asm-api:9.9.1-189.vb_5ef2964da_91
authentication-tokens:1.144.v5ff4a_5ec5c33
badge:2.562.vc3c0b_6925377
basic-branch-build-strategies:317.v85b_331d6cc42
bootstrap5-api:5.3.8-895.v4d0d8e47fea_d
bouncycastle-api:2.30.1.83-289.v8426fcd19371
branch-api:2.1280.v0d4e5b_b_460ef
build-name-setter:2.5.1
build-timeout:1.40
caffeine-api:3.2.3-194.v31a_b_f7a_b_5a_81
checks-api:402.vca_263b_f200e3
cloud-stats:377.vd8a_6c953e98e
cloudbees-bitbucket-branch-source:937.2.5
cloudbees-folder:6.1079.vc0975c2de294
command-launcher:123.v37cfdc92ef67
commons-collections4-api:4.5.0-8.va_d5448ef9011
commons-compress-api:1.28.0-3
commons-lang3-api:3.20.0-109.ve43756e2d2b_4
commons-text-api:1.15.0-218.va_61573470393
conditional-buildstep:1.5.0
config-file-provider:1006.vc7366c201f57
configuration-as-code:2053.vb_0da_47381a_25
coverage:2.3139.v731d2e83ea_8a_
coverage-badges-extension:197.vb_390173d00ec
credentials:1495.v2cc3d2266b_75
credentials-binding:717.v951d49b_5f3a_a_
dark-theme:574.va_19f05d54df5
data-tables-api:2.3.7-1534.v539d4edf109d
description-setter:264.v1957f215dcd5
display-url-api:2.217.va_6b_de84cc74b_
docker-commons:457.v0f62a_94f11a_3
docker-java-api:3.7.0-133.v93b_8fb_c17a_77
docker-plugin:1316.v75635a_002b_0a_
docker-workflow:634.vedc7242b_eda_7
durable-task:664.v2b_e7a_dfff66c
echarts-api:6.0.0-1247.vf3e35a_c1813f
eddsa-api:0.3.0.1-29.v67e9a_1c969b_b_
elastic-axis:615.vb_f7c20ec040e
embeddable-build-status:637.vd878e68178f8
emoji-symbols-api:17.0-57.v8d44b_9a_b_d5ea_
envinject:2.934.vc674e76cf954
envinject-api:1.237.v82803a_511906
font-awesome-api:7.2.0-965.ve3840b_696418
forensics-api:3.1832.va_1179842528b_
git:5.10.1-SNAPSHOT (private-58c6c2f5-mwaite)
git-client:6.6.0-rc3865.b_182d0ccd56c
git-forensics:3.2274.v3dc0fd546572
git-parameter:462.vdcf3df2ed2ca_
git-server:137.ve0060b_432302
git-version-monitor:41.v0cfdf922b_b_0c
gitea:273.vb_78d13f6d9a_d
github:1.46.0
github-api:1.330-492.v3941a_032db_2a_
github-branch-source:1967.vdea_d580c1a_b_a_
github-scm-filter-aged-refs:59.vc6b_39c26988c
gitlab-api:6.2.0-111.vf174d6b_8c12e
gitlab-branch-source:740.v04f287f9194d
groovy-postbuild:300.va_253b_2988cb_1
gson-api:2.13.2-173.va_a_092315913c
handy-uri-templates-2-api:2.1.8-38.vcea_5d521d5f3
http_request:1.24
ignore-committer-strategy:57.v0756db_b_f6926
implied-labels:439.v4900744249a_3
instance-identity:203.v15e81a_1b_7a_38
ionicons-api:94.vcc3065403257
jackson2-api:2.21.1-428.vf8dd988fa_d8d
jackson3-api:3.1.0-64.v37e742c35905
jakarta-activation-api:2.1.4-1
jakarta-mail-api:2.1.5-1
jakarta-xml-bind-api:4.0.6-12.vb_1833c1231d3
javadoc:354.vee1a_660b_4990
javax-activation-api:1.2.0-8
javax-mail-api:1.6.2-11
jaxb:2.3.9-143.v5979df3304e6
jdk-tool:83.v417146707a_3d
jersey2-api:2.47-165.ve7809a_3e87e0
jersey3-api:3.1.11-4.v77818819c2e1
jjwt-api:0.11.5-120.v0268cf544b_89
job-dsl:3654.vdf58f53e2d15
joda-time-api:2.14.1-187.vdf2def02b_8a_1
jquery3-api:3.7.1-619.vdb_10e002501a_
jsch:0.2.16-95.v3eecb_55fa_b_78
json-api:20251224-185.v0cc18490c62c
json-path-api:3.0.0-218.vcd4dd1355de2
jsoup:1.22.1-76.v9cdb_2456c0e3
jspecify-api:1.0.0-1.ve7231e6d0d15
junit:1403.vd9d1413fd205
junit-attachments:367.v30757752b_2b_f
junit-realtime-test-reporter:195.v25b_5f237c6b_4
label-verifier:116.vb_845759df630
mailer:525.v2458b_d8a_1a_71
markdown-formatter:331.vf411395008f9
matrix-project:870.v9db_fcfc2f45b_
maven-plugin:3.27
metrics:4.2.37-494.v06f9a_939d33a_
mina-sshd-api-common:2.16.0-167.va_269f38cc024
mina-sshd-api-core:2.16.0-167.va_269f38cc024
monitoring:2.6.0
naginator:1.556.v14d723a_109a_c
nodelabelparameter:851.vd94e5048d321
okhttp-api:5.3.2-200.vedb_720a_cf1f8
oss-symbols-api:442.v99039087229b_
parallel-test-executor:611.va_92b_d1852e52
parameterized-trigger:890.vc240a_a_e1217f
pipeline-build-step:584.vdb_a_2cc3a_d07a_
pipeline-github:2.8-162.382498405fdc
pipeline-github-lib:65.v203688e7727e
pipeline-graph-analysis:254.v0f63a_a_447dca_
pipeline-graph-view:803.vb_88f7a_a_1cb_47
pipeline-groovy-lib:787.ve2fef0efdca_6
pipeline-input-step:540.v14b_100d754dd
pipeline-maven:1672.v1b_d4c0435b_20
pipeline-maven-api:1672.v1b_d4c0435b_20
pipeline-milestone-step:138.v78ca_76831a_43
pipeline-model-api:2.2277.v00573e73ddf1
pipeline-model-definition:2.2277.v00573e73ddf1
pipeline-model-extensions:2.2277.v00573e73ddf1
pipeline-stage-step:322.vecffa_99f371c
pipeline-stage-tags-metadata:2.2277.v00573e73ddf1
pipeline-utility-steps:2.20.0
plain-credentials:199.v9f8e1f741799
platformlabeler:3198.v06b_04fa_fea_6e
plot:2.4.0
plugin-util-api:6.1192.v30fe6e2837ff
pollscm:1.9
preSCMbuildstep:115.vf9808414429d
prism-api:1.30.0-703.v116fb_3b_5b_b_a_a_
promoted-builds:992.va_00888f21b_74
resource-disposer:0.25
run-condition:276.v97298f3a_cd51
scm-api:728.vc30dcf7a_0df5
script-security:1399.ve6a_66547f6e1
snakeyaml-api:2.5-149.v72471e9c6371
snakeyaml-engine-api:3.0.1-5.vd98ea_ff3b_92e
ssh-agent:386.v36cc0c7582f0
ssh-credentials:361.vb_f6760818e8c
ssh-slaves:3.1097.v868116049892
sshd:3.384.vc89b_5e138cf9
structs:362.va_b_695ef4fdf9
swarm:3.51
testng-plugin:981.v1dc64d227855
text-finder:1.33
theme-manager:344.vd7b_e20e046dc
throttle-concurrents:625.vc8b_e469e9a_b_c
timestamper:1.30
token-macro:477.vd4f0dc3cb_cf1
trilead-api:2.284.v1974ea_324382
variant:70.va_d9f17f859e0
versioncolumn:400.v3c5c3004f31d
view-job-filters:406.va_0ec67147ee2
warnings-ng:12.10012.v753ff0d0363a_
workflow-aggregator:608.v67378e9d3db_1
workflow-api:1398.v67030756d3fb_
workflow-basic-steps:1098.v808b_fd7f8cf4
workflow-cps:4259.vf653c2b_8a_b_69
workflow-durable-task-step:1464.v2d3f5c68f84c
workflow-job:1571.vb_423c255d6d9
workflow-multibranch:821.vc3b_4ea_780798
workflow-scm-step:466.va_d69e602552b_
workflow-step-api:710.v3e456cc85233
workflow-support:1015.v785e5a_b_b_8b_22
ws-cleanup:0.49
xshell:325.v3fda_132b_2641
```

### What Operating System are you using (both controller, and any agents involved in the problem)?

Ubuntu 22.04 Linux with most recent patches and Eclipse Temurin Java 25.0.2.

### Reproduction steps

1. Run the container image and login to the image from a web browser (like http://jenkins.example.com:8080)
2. Create a notifyCommit token from the "Manage Jenkins" / "Security" page
3. Paste http://jenkins.example.com:8080/git/notifyCommit?url=https://github.com/MarkEWaite/implied-labels-plugin&token=your-notifyCommit-token and note that the response is an exception. Read the Jenkins log where it shows:
```
2026-03-21 14:08:55.980+0000 [id=7741] WARNING h.i.i.InstallUncaughtExceptionHandler#handleException: Caught unhandled exception with ID ea95c198-73bb-4718-8a87-abaacdf4a308
java.lang.NullPointerException: Cannot invoke "hudson.scm.SCM.getKey()" because "scm" is null
at PluginClassLoader for workflow-job//org.jenkinsci.plugins.workflow.job.WorkflowJob.getSCMs(WorkflowJob.java:554)
at PluginClassLoader for git//hudson.plugins.git.GitStatus$JenkinsAbstractProjectListener.onNotifyCommit(GitStatus.java:389)
at PluginClassLoader for git//hudson.plugins.git.GitStatus.doNotifyCommit(GitStatus.java:178)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:735)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:484)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:497)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:218)
at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:140)
at org.kohsuke.stapler.MetaClass$12.doDispatch(MetaClass.java:686)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:61)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:800)
Caused: jakarta.servlet.ServletException
```

### Expected Results

The notifyCommit request should be processed

### Actual Results

Null pointer exception is reported in the log and the notifyCommit is not processed

### Anything else?

_No response_

### Are you interested in contributing a fix?

Yes

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.