jenkinsci / jenkinsci/git-plugin

[JENKINS-31678] NullPointerException when using GitPublisher in release post build actions

Open
#2,763 1 comment 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

Configure a job to use the Jenkins release plugin and use the Git publisher as release step after a successful release build. Tick the checkbox "Push only If Build Succeeds". Then a release build failes with the following NullPointerException:

FATAL: null

java.lang.NullPointerException

at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:203)

at hudson.plugins.release.ReleaseWrapper.executeBuildSteps(ReleaseWrapper.java:423)

at hudson.plugins.release.ReleaseWrapper.access$300(ReleaseWrapper.java:99)

at hudson.plugins.release.ReleaseWrapper$4.tearDown(ReleaseWrapper.java:370)

at hudson.model.Build$BuildExecution.doRun(Build.java:173)

at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)

at hudson.model.Run.execute(Run.java:1738)

at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)

at hudson.model.ResourceController.execute(ResourceController.java:98)

at hudson.model.Executor.run(Executor.java:410)

This is caused by the null derefenced buildResult of AbstractBuild.getResult().

---
Originally reported by kleini, imported from: NullPointerException when using GitPublisher in release post build actions


  • status: Open
  • priority: Major
  • component(s): git-plugin
  • label(s): exception, git, plugin
  • resolution: Unresolved
  • votes: 2
  • watchers: 4
  • imported: 2025-12-02

Raw content of original issue

Configure a job to use the Jenkins release plugin and use the Git publisher as release step after a successful release build. Tick the checkbox "Push only If Build Succeeds". Then a release build failes with the following NullPointerException:

FATAL: null
java.lang.NullPointerException
at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:203)
at hudson.plugins.release.ReleaseWrapper.executeBuildSteps(ReleaseWrapper.java:423)
at hudson.plugins.release.ReleaseWrapper.access$300(ReleaseWrapper.java:99)
at hudson.plugins.release.ReleaseWrapper$4.tearDown(ReleaseWrapper.java:370)
at hudson.model.Build$BuildExecution.doRun(Build.java:173)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1738)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)

This is caused by the null derefenced buildResult of AbstractBuild.getResult().

  • environment: Debian Wheezy running Jenkins 1.638 with git-plugin 2.4.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.