Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Could not parse key 'null'

Hello, I am trying to create a Plan in Bamboo using specs but I everytime get the following error message:


[ERROR] Failed to execute goal com.atlassian.bamboo:bamboo-specs-runner:6.1.1:run (default-cli) on project bamboo-specs-tutorial: Execution default-cli of goal com.atlassian.bamboo:bamboo-specs-runner:6.1.1:run failed: java.lang.reflect.InvocationTargetException: An error occurred while publishing plan DEVOPS-TST: Could not parse key 'null' -> [Help 1]


and here the snippet of code:


public static void main(final String[] args) throws Exception {
BambooServer bambooServer = new BambooServer("");
Plan plan = new PlanSpec().createPlan();

Project project() {
return new Project().key("DEVOPS");

Plan createPlan() {
return new Plan(
.description("Plan created from (enter repository url of your plan)");

Activating some TRACE logs I see the post that is

2017-10-23 11:44:34,425 INFO [BambooServer] Publishing plan DEVOPS-TST
2017-10-23 11:44:34,533 TRACE [RestHelper] Sending the following content to via POST:
--- !!com.atlassian.bamboo.specs.util.BambooSpecProperties
rootEntity: !!com.atlassian.bamboo.specs.api.model.plan.PlanProperties
description: Plan created from (enter repository url of your plan)
enabled: true
key: TST
oid: null
pluginConfigurations: []
childPlans: []
blockingStrategy: NONE
enabledForBranches: true
requireAllStagesPassing: false
notifications: []
enabled: false
gatekeeper: false
integrationBranch: null
pushOn: false
matchingPattern: null
trigger: MANUAL
removeDeletedFromRepository: false
removeDeletedFromRepositoryPeriod: !!java.time.Duration 'PT0S'
removeInactiveInRepository: false
removeInactiveInRepositoryPeriod: !!java.time.Duration 'PT0S'
issueLinkingEnabled: true
notificationStrategy: NONE
triggeringOption: INHERITED
description: null
name: null
oid: null
repositories: []
repositoryStoredSpecsData: null
stages: []
triggers: []
variables: []
specModelVersion: 6.1.1 

Am I missing anything here?

1 answer

0 votes

In general, the best idea is to define a plan in Bamboo UI and then export it to Bamboo Specs source code in Actions -> Configure Plan -> View plan as Bamboo Specs as described here.

Hope you have figured out the issue by now.


I'm seeing an equally vague error when I take a job spec from a bamboo server and run the code. 

2018-09-26 15:24:58,704 INFO [BambooServer] Publishing plan CT-ING
2018-09-26 15:24:59,621 INFO [BambooServer] An error occurred while publishing plan CT-ING: Could not parse key 'null'
2018-09-26 15:24:59,621 DEBUG [BambooServer] {"message":"Could not parse key 'null'","status-code":400}
Exception in thread "main" com.atlassian.bamboo.specs.api.exceptions.BambooSpecsPublishingException: An error occurred while publishing plan CT-ING: Could not parse key 'null'
at com.atlassian.bamboo.specs.util.BambooServer.translateRestException(
at com.atlassian.bamboo.specs.util.BambooServer.translateException(
at com.atlassian.bamboo.specs.util.BambooServer.publish(
at org.iop.iopsci.bamboo.MyPlanSpec.main(
Caused by: com.atlassian.bamboo.specs.exceptions.BambooSpecsRestRequestException: Could not parse key 'null'
at com.atlassian.bamboo.specs.util.RestHelper.lambda$sendRequest$2(
at org.apache.http.impl.client.CloseableHttpClient.execute(
at org.apache.http.impl.client.CloseableHttpClient.execute(
at org.apache.http.impl.client.CloseableHttpClient.execute(
at com.atlassian.bamboo.specs.util.RestHelper.sendRequest(
at com.atlassian.bamboo.specs.util.SendQueue$

 The server doesn't seem to produce much useful logging:

2018-09-26 15:27:52,463 INFO [http-nio-8085-exec-24] [BambooAuthenticator] Finished doing authentication checks for user, took 100.4 ms

2018-09-26 15:27:52,469 INFO [http-nio-8085-exec-24] [AccessLogFilter] user POST 415220kb

2018-09-26 15:27:52,597 INFO [http-nio-8085-exec-24] [HungBuildPlanConfigurationPlugin] setting default values for edit page.

 Is there any way of getting the server to produce detailed output to help pin down the issue?

Could this be a bug in Bamboo 6.6.2?

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events