Build plan fails with NullPointerException
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
The following error is presented when attempting to run a build through the Run > Run plan
button in Bamboo:
Site homepage
A system error has occurred - our apologies!
Version: 5.10.3
Build: 51020
Build Date: 14 Mar 2016
Request information:
Request URL: https://webserver.bamboo/builds/build/admin/triggerManualBuild.action
Scheme: https
Server: webserver.bamboo
Port: 443
URI: /builds/build/admin/triggerManualBuild.action
Context path: /builds
Servlet path: /build/admin/triggerManualBuild.action
Path info:
Query string: buildKey=GIT-BIT&buildKey=GIT-BIT
Stack Trace:
java.lang.NullPointerException
at com.atlassian.bamboo.plan.TriggerableInternalKeyImpl.<init>(TriggerableInternalKeyImpl.java:46)
at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.startManualBuild(PlanExecutionManagerImpl.java:387)
at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.start(PlanExecutionManagerImpl.java:570)
at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$1.call(PlanExecutionManagerImpl.java:296)
at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$1.call(PlanExecutionManagerImpl.java:292)
at com.atlassian.bamboo.util.CacheAwareness.withValuesOlderThanTimestampReloaded(CacheAwareness.java:163)
at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.startManualExecution(PlanExecutionManagerImpl.java:300)
at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.startManualExecution(PlanExecutionManagerImpl.java:233)
at com.atlassian.bamboo.plan.DelegatingPlanExecutionManager.startManualExecution(DelegatingPlanExecutionManager.java:146)
at com.atlassian.bamboo.v2.ww2.build.TriggerManualBuild.doExecute(TriggerManualBuild.java:47)
at com.atlassian.bamboo.ww2.BambooActionSupport.execute(BambooActionSupport.java:1194)
at sun.reflect.GeneratedMethodAccessor2770.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
...
Diagnosis
Environment
- Bamboo using Netflix Zuul as the proxy implementation.
Diagnostic Steps
At the end of the request we can see that the buildKey parameter is showing up twice. This is also observed from the Query String information in the stack trace above. This causes the entire
triggerManualBuild
request to look like this:https://webserver.bamboo/builds/build/admin/triggerManualBuild.action?buildKey=GIT-BIT&buildKey=GIT-BIT
Cause
Zuul pulls the Query String from the URL and from the body and joins them, thus creating duplicate parameters: https://github.com/spring-cloud/spring-cloud-netflix/issues/1080.
Resolution
This problem has been fixed in version 1.1.4 of Spring Cloud Netflix.
https://github.com/spring-cloud/spring-cloud-netflix/commit/0da6f27aacd07a2ac76be487bf3d252b900f48e6
Upgrade to resolve the issue.