Looking at the code [1], IMO this is a likely a bug. This is indeed gonna
blow up each time the previous build will still be building, as
build.getResult() will by contract return null if currently building.

So, I think you should file an issue in the tracker about that. And if
possible the associated PR to higher your chances to get an official
release with that fix.

Cheers

[1]
https://github.com/jenkinsci/versionnumber-plugin/blob/master/src/main/java/org/jvnet/hudson/tools/versionnumber/VersionNumberBuilder.java#L262

2016-01-21 17:19 GMT+01:00 Andrew Novinger <anovin...@gmail.com>:

> I have a Jenkins job that is using the Version Number Plugin to change the
> build label in Jenkins to show the environment name and job number.
>
> This job is not throttle so it can run many times concurrently for
> different environments.
>
> The issue I am having is the first environment that is run, the label gets
> update and is correct, the next job that is running while the first job is
> running.  We get a null pointer exception thrown (see below), and the
> Jenkins label does not change.
>
> ERROR: java.lang.NullPointerExceptionjava.lang.NullPointerException 
> <http://stacktrace.jenkins-ci.org/search?query=java.lang.NullPointerException>
>     at 
> org.jvnet.hudson.tools.versionnumber.VersionNumberBuilder.incBuild(VersionNumberBuilder.java:262)
>  
> <http://stacktrace.jenkins-ci.org/search/?query=org.jvnet.hudson.tools.versionnumber.VersionNumberBuilder.incBuild&entity=method>
>       at 
> org.jvnet.hudson.tools.versionnumber.VersionNumberBuilder.setUp(VersionNumberBuilder.java:540)
>  
> <http://stacktrace.jenkins-ci.org/search/?query=org.jvnet.hudson.tools.versionnumber.VersionNumberBuilder.setUp&entity=method>
>       at hudson.model.Build$BuildExecution.doRun(Build.java:156) 
> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Build$BuildExecution.doRun&entity=method>
>       at 
> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) 
> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractBuildExecution.run&entity=method>
>       at hudson.model.Run.execute(Run.java:1738) 
> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Run.execute&entity=method>
>       at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 
> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.FreeStyleBuild.run&entity=method>
>       at hudson.model.ResourceController.execute(ResourceController.java:98) 
> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.ResourceController.execute&entity=method>
>       at hudson.model.Executor.run(Executor.java:410) 
> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Executor.run&entity=method>
>
> Any ideas on how to make this plugin work on a job that can run concurrently?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/41c4eebd-8df9-4af9-8ca3-67e042db0f7a%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/41c4eebd-8df9-4af9-8ca3-67e042db0f7a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS4ph_ou108H%3DSR2-_xNxbjak_-Kpo5Z5_h2M4OqOtckAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to