[JIRA] [build-name-setter-plugin] (JENKINS-34181) NullPointerException in BuildNameSetter.setup

2 views
Skip to first unread message

cody.s.lee@gmail.com (JIRA)

unread,
Apr 12, 2016, 1:59:01 PM4/12/16
to jenkinsc...@googlegroups.com
Cody Lee created an issue
 
Jenkins / Bug JENKINS-34181
NullPointerException in BuildNameSetter.setup
Issue Type: Bug Bug
Assignee: Lev Mishin
Components: build-name-setter-plugin
Created: 2016/Apr/12 5:58 PM
Environment: Jenkins 1.642.4, build-name-setter 1.6.0
Priority: Minor Minor
Reporter: Cody Lee

Similar NPE on all of our jobs using build name setter:

{{
ERROR: Processing failed due to a bug in the code. Please report this to jenkins...@googlegroups.com
java.lang.NullPointerException
at org.jenkinsci.plugins.buildnamesetter.BuildNameSetter.setUp(BuildNameSetter.java:41)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:655)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1738)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
project=hudson.maven.MavenModuleSet@19c9e8a[player-services-test]
project.getModules()=[hudson.maven.MavenModule@1209012[player-services-test/com.sonos.services:player-services-test][player-services-test/com.sonos.services:player-services-test][relativePath:], hudson.maven.MavenModule@23fe5f[player-services-test/com.sonos.services:sonos-test][player-services-test/com.sonos.services:sonos-test][relativePath:sonos-test], hudson.maven.MavenModule@89efd9[player-services-test/com.sonos.services:sonos-test-dependencies][player-services-test/com.sonos.services:sonos-test-dependencies][relativePath:sonos-test-dependencies]]
project.getRootModule()=hudson.maven.MavenModule@1209012[player-services-test/com.sonos.services:player-services-test][player-services-test/com.sonos.services:player-services-test][relativePath:]
FATAL: null
java.lang.NullPointerException
at org.jenkinsci.plugins.buildnamesetter.BuildNameSetter.setUp(BuildNameSetter.java:41)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:655)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1738)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
}}

Build Name: {{#$

{BUILD_NUMBER}

-$

{ENV,var="STREAM"}

}}

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

cody.s.lee@gmail.com (JIRA)

unread,
Apr 12, 2016, 2:00:02 PM4/12/16
to jenkinsc...@googlegroups.com

cody.s.lee@gmail.com (JIRA)

unread,
Apr 12, 2016, 2:00:03 PM4/12/16
to jenkinsc...@googlegroups.com

cody.s.lee@gmail.com (JIRA)

unread,
Apr 12, 2016, 2:01:01 PM4/12/16
to jenkinsc...@googlegroups.com

cody.s.lee@gmail.com (JIRA)

unread,
Apr 12, 2016, 2:20:01 PM4/12/16
to jenkinsc...@googlegroups.com
Cody Lee commented on Bug JENKINS-34181
 
Re: NullPointerException in BuildNameSetter.setup

Update: The NPE comes from setting the build name before the build starts and using environment variables that are set as a part of the build name.

jeysaba@gmail.com (JIRA)

unread,
Apr 12, 2016, 5:13:01 PM4/12/16
to jenkinsc...@googlegroups.com
Jey Saba commented on Bug JENKINS-34181
 
Re: NullPointerException in BuildNameSetter.setup

I'm also seeing this issue. The problem is fixed only when an existing job is re-saved. When this happens, the job's config XML adds the runAtStart and runAtEnd elements:

<org.jenkinsci.plugins.buildnamesetter.BuildNameSetter plugin="build-na...@1.6.0">
...
    <runAtStart>true</runAtStart>
    <runAtEnd>true</runAtEnd>
</org.jenkinsci.plugins.buildnamesetter.BuildNameSetter>

I think the plugin should assume these defaults if they are not defined in the job.

dweomer5@gmail.com (JIRA)

unread,
Apr 13, 2016, 4:34:02 PM4/13/16
to jenkinsc...@googlegroups.com
Jacob Blain Christen commented on Bug JENKINS-34181
 
Re: NullPointerException in BuildNameSetter.setup

When 1.6 was installed, I re-saved the config for one job via the UI and was still encountering the error. Going back and explicitly setting runAtStart to false had it "working" in that if no longer threw the NPE but now the job name isn't updated until the tail end of execution whereas the prior behavior of setting when the envvars became available was more desirable.

mark.eijsermans@gmail.com (JIRA)

unread,
Apr 13, 2016, 9:46:05 PM4/13/16
to jenkinsc...@googlegroups.com
Mark Eijsermans commented on Bug JENKINS-34181
 
Re: NullPointerException in BuildNameSetter.setup

Getting this error when useing GIT_COMMIT env var. Eg:

${BUILD_NUMBER}-${GIT_REVISION,length=7}

mark.eijsermans@gmail.com (JIRA)

unread,
Apr 13, 2016, 9:46:08 PM4/13/16
to jenkinsc...@googlegroups.com
Getting this error when useing {{GIT_COMMIT}} env var. Eg:

{code}
${BUILD_NUMBER}-${
GIT_REVISION GIT_COMMIT ,length=7}
{code}

leomichine@gmail.com (JIRA)

unread,
Apr 14, 2016, 12:55:02 AM4/14/16
to jenkinsc...@googlegroups.com
Lev Mishin updated an issue
Change By: Lev Mishin
Priority: Minor Critical

leomichine@gmail.com (JIRA)

unread,
Apr 14, 2016, 12:57:02 AM4/14/16
to jenkinsc...@googlegroups.com
Lev Mishin commented on Bug JENKINS-34181
 
Re: NullPointerException in BuildNameSetter.setup

I'm working on it and will check the fix today

leomichine@gmail.com (JIRA)

unread,
Apr 14, 2016, 1:09:03 AM4/14/16
to jenkinsc...@googlegroups.com
Lev Mishin updated an issue
Change By: Lev Mishin
Priority: Critical Blocker

scm_issue_link@java.net (JIRA)

unread,
Apr 14, 2016, 9:49:02 AM4/14/16
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon commented on Bug JENKINS-34181
 
Re: NullPointerException in BuildNameSetter.setup

Code changed in jenkins
User: Leo
Path:
src/main/java/org/jenkinsci/plugins/buildnamesetter/BuildNameSetter.java
http://jenkins-ci.org/commit/build-name-setter-plugin/d91a0d6661d3b37dd4f33c2480e39a328d9db77d
Log:
Fix for bug JENKINS-34181 NPE after plugin update

https://issues.jenkins-ci.org/browse/JENKINS-34181

scm_issue_link@java.net (JIRA)

unread,
Apr 14, 2016, 10:06:02 AM4/14/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Leo
Path:
src/main/java/org/jenkinsci/plugins/buildnamesetter/BuildNameSetter.java

http://jenkins-ci.org/commit/build-name-setter-plugin/2234e39acdf918ea1124322bf758e3d3dd09fffb
Log:
Merge pull request #10 from jenkinsci/Le0Michine-fix-for-bug-34181

Fix for bug JENKINS-34181 NPE after plugin update

leomichine@gmail.com (JIRA)

unread,
Apr 14, 2016, 10:50:02 AM4/14/16
to jenkinsc...@googlegroups.com
Lev Mishin commented on Bug JENKINS-34181
 
Re: NullPointerException in BuildNameSetter.setup

Bug should be fixed in version 1.6.1 it should be available soon

wulf-thilo.schreiter@bild.de (JIRA)

unread,
Apr 15, 2016, 6:34:01 AM4/15/16
to jenkinsc...@googlegroups.com
Wulf-Thilo Schreiter commented on Bug JENKINS-34181
 
Re: NullPointerException in BuildNameSetter.setup

The NPE is still in version 1.6.1

I've created a pull request to have the auto unboxing NULL save.

https://github.com/jenkinsci/build-name-setter-plugin/pull/11

leomichine@gmail.com (JIRA)

unread,
Apr 15, 2016, 6:40:05 AM4/15/16
to jenkinsc...@googlegroups.com
Lev Mishin commented on Bug JENKINS-34181
 
Re: NullPointerException in BuildNameSetter.setup

Thanks a lot! I just forgot about constructor parameters since on my PC all work fine

leomichine@gmail.com (JIRA)

unread,
Apr 15, 2016, 8:27:02 AM4/15/16
to jenkinsc...@googlegroups.com
 
Re: NullPointerException in BuildNameSetter.setup

PR is merged, new release is created, new version will be 1.6.2

leomichine@gmail.com (JIRA)

unread,
Apr 18, 2016, 1:29:02 AM4/18/16
to jenkinsc...@googlegroups.com
Lev Mishin edited a comment on Bug JENKINS-34181
 
Re: NullPointerException in BuildNameSetter.setup
PR is merged, new release is created, new version will be 1.6. 2 3

dbeck@cloudbees.com (JIRA)

unread,
Apr 18, 2016, 2:57:02 PM4/18/16
to jenkinsc...@googlegroups.com
Daniel Beck commented on Bug JENKINS-34181
 
Re: NullPointerException in BuildNameSetter.setup

Lev Mishin Deserializing job configurations does not call the constructor, so I'm surprised this change has an effect…

See also https://wiki.jenkins-ci.org/display/JENKINS/Hint+on+retaining+backward+compatibility

leomichine@gmail.com (JIRA)

unread,
Apr 18, 2016, 3:16:03 PM4/18/16
to jenkinsc...@googlegroups.com
Lev Mishin commented on Bug JENKINS-34181
 
Re: NullPointerException in BuildNameSetter.setup

New version of the plugin is available in alternative update center https://github.com/jucies/releases

leomichine@gmail.com (JIRA)

unread,
Apr 18, 2016, 3:18:02 PM4/18/16
to jenkinsc...@googlegroups.com
 
Re: NullPointerException in BuildNameSetter.setup

Daniel Beck thanks for the link! It seems you are right

leomichine@gmail.com (JIRA)

unread,
Apr 18, 2016, 3:25:03 PM4/18/16
to jenkinsc...@googlegroups.com
Lev Mishin edited a comment on Bug JENKINS-34181
 
Re: NullPointerException in BuildNameSetter.setup
New version of the plugin is available in alternative update center [https://github.com/jucies/releases]
So I'm going to close the bug

leomichine@gmail.com (JIRA)

unread,
Apr 19, 2016, 10:21:02 AM4/19/16
to jenkinsc...@googlegroups.com
Lev Mishin resolved as Fixed
 

Fixed in version 1.6.3

Change By: Lev Mishin
Status: Open Resolved
Resolution: Fixed

jeysaba@gmail.com (JIRA)

unread,
Apr 23, 2016, 6:30:03 PM4/23/16
to jenkinsc...@googlegroups.com
Jey Saba commented on Bug JENKINS-34181
 
Re: NullPointerException in BuildNameSetter.setup

Lev Mishin, I tried upgrading to version 1.6.3, and it no longer sets the build name, either before or after the build. On upgrade, both runAtStart and runAtEnd are set to false, so no build name is ever set.

We have over a hundred Jenkins jobs, so it's not feasible to manually set the flag for each job. I have to roll back to the earlier version, 1.5.1.

I also read the wiki that Daniel Beck mentioned above w.r.t. adding a new field. Here are my thoughts on this issue:

  1. On upgrade, the plugin should preserve the existing behaviour (i.e., set the name at start).
  2. Right now, there are two check boxes for start and end. Wouldn't it make more sense for it to be a choice between start OR end (i.e., a radio button)?
  3. Why not remove the first option and only keep the one for "Set build name after build ends" instead of at the start?

Just have one flag that's set to false on upgrade, and persisted only if the user actively sets it to true. It preserves the existing behaviour, works within the recommended guidelines for adding a new field, and introduces the new advanced feature that you wrote to set the name at the end of a build.

leomichine@gmail.com (JIRA)

unread,
Apr 24, 2016, 1:56:02 AM4/24/16
to jenkinsc...@googlegroups.com
Lev Mishin commented on Bug JENKINS-34181
 
Re: NullPointerException in BuildNameSetter.setup

Jey Saba default behaviour of this plugin was to set build name at the start and at the and. I created a new bug
https://issues.jenkins-ci.org/browse/JENKINS-34415 and I'll fix it asap (PR is already created)

leomichine@gmail.com (JIRA)

unread,
May 10, 2016, 2:16:05 PM5/10/16
to jenkinsc...@googlegroups.com
Lev Mishin closed an issue as Fixed
Change By: Lev Mishin
Status: Resolved Closed
Reply all
Reply to author
Forward
0 new messages