Bamboo specs YAML Error: Could not parse key 'null' plan key
Asked by Dorian Brim:

Hi  

For the past couple of days I have been working with bamboo specs in YAML and I'm getting this error message.  

```
17-Apr-2020 16:10:39	There was an error when processing yaml file "bamboo.yaml". File structure is correct, contact Atlassian Support for assistance on resolving this issue.17-Apr-2020 16:10:39	17-Apr-2020 16:10:39	Could not parse key 'null'17-Apr-2020 16:10:39	java.lang.IllegalArgumentException: Could not parse key 'null'17-Apr-2020 16:10:39		at com.atlassian.bamboo.plan.PlanKeys.getPlanKey(PlanKeys.java:245)
```

I'm not even remotely sure how I could receive such error unless there is something I'm missing, there isn't too much support for this and the documentation isn't the best, here is my YAML file.

```
---version: 2
plan:
     project-key: SBP 
     name: TA User Agents key: TAUA
triggers:
     - cron: 0 0 12 * * ?
stages: 
     - Build Application: 
          jobs:  
              - Build Application 
     - Static Testing: 
          jobs: 
              - TA Static Test 
     - Push to Test: 
          jobs: 
              - AWS Deploy
              - Push to Test 
     - Deploy to Docker Environment: 
          jobs: 
              - Deploy Docker 
     - Upload to Client BitBucket: 
          jobs: 
              - Upload Splunk App
Build Application: 
     key: BA 
     tasks: 
          - script: "scripts/BA_RemoveArtifacts.sh"
          - script: "scripts/BA_NPMBowerUpdates.sh" 
          - script: "scripts/BA_MoveLocalKnowlegdeObjects.sh"
          - script: "scripts/BA_CombineLocalCOnfigurations.sh"
          - script: "scripts/BA_GulpAgain.sh"
          - inject-variables: #Pull variables from the final gulp configuration 
              file: app_folder/appserver/build/build_variables.sh 
              scope: RESULT 
              namespace: gulp 
          - script: "scripts/BA_FinishCreation.sh"
          - script: "scripts/BA_AppCertificationsTasksChecks.sh"
          - script: "scripts/BA_IvanValidator.sh"
          - script: "scripts/BA_BuildSPL.sh"
          - script: "scripts/BA_PerformLocalizationTemplate.sh"

      requirements: 
          - AppInspect 
      artifacts: 
          - name: Add-Ons 
            pattern: "add-ons_to_main/*.spl" 
            shared: true
          - name: Additional App Inspect 
            pattern: "**/app_inspect_*"
            shared: true
          - name: AppInspect HTML Output 
            pattern: "**/*_app_certification*.html" 
            shared: true
          - name: AppValidation 
            pattern: "av.tar.gz" 
            shared: true
          - name: compiledSplunkApp 
            pattern: "*.spl" 
            shared: true
          - name: Full_Report 
            pattern: "**/*full_report*.html" 
            shared: true
          - name: KatalonTests. 
            pattern: "**/web_tests.tgz"
            shared: true
          - name: Localization 
            pattern: generated_messages.pot 
            shared: true
          - name: Plan Variables 
            pattern: "**/*build_variables.sh" 
            shared: true
          - name: Test App 
            pattern: "*-test.tar.gz" 
            shared: true
TA Static Test: 
     key: TAST 
     tasks:  
          - inject-variables: #Pull variables from the final gulp configuration 
              file: "app_validation/appserver/tests/build_variables.sh"    
              scope: RESULT 
              namespace: gulp
          - script: "scripts/TAST_RunSplunkAppInspectTests.sh"  
          - test-parser: #Validate App Results 
              type: junit 
              test-results: "**/pyunit_app_inspect_app_certification_ta.xml" 
     requirements: 
          - AppInspect
AWS Deploy: 
     key: AWS 
     tasks: 
          - script: "scripts/AWSD_UploadBitBucket.sh"
Push to Test: 
     key: PTT 
     tasks: 
           - inject-variables: #Inject Variables 
               file: "app_validation/appserver/tests/build_variables.sh" 
               scope: RESULT 
               namespace: gulp  
           - script: "scripts/PTT_PushTest.sh" 
Deploy Docker: 
     key: DD 
     tasks: 
           - script: "scripts/DD_CreateVariablesFile.sh"  
           - inject-variables: #Inject Testing Variables 
               file: config_testing_docker_variables.sh 
               scope: LOCAL 
               namespace: inject
           - script: "scripts/DD_SpinUpCurrentVersion.sh"
           - script: "scripts/DD_TestCurrentVersion.sh"
           - script: "scripts/DD_SpinDownRemoveCurrentVersion.sh"
           - test-parser: #Check current version 
               type: junit 
               test-results: "**/JUnit_Report.xml, **/Btool_Junit.xml"
           - script: "scripts/DD_SpinUpPreviousVersion.sh"
           - script: "scripts/DD_TestPreviousVersion.sh"
           - test-parser: #Check previous version type: 
               junit test-results: "**/JUnit_Report.xml, **/Btool_Junit.xml"
      requirements: 
           - Katalon
      final-tasks: 
           - script: "scripts/DD_StopAll"
Upload Splunk App: 
     key: USA 
     tasks: 
           - script: "scripts/USA_UploadBitBucket.sh"
```

The document structure is correct according to the error log, I'd appreciate any help thanks!


Answers:
author: Alexey Chystoprudov
body: There's no plan key

```
---
version: 2
plan:
     project-key: SBP 
     name: TA User Agents key: TAUA
     key: YOURKEY
....
```

comments: author: Marcin Gardias
body: Actually: missing line break:

```
name: TA User Agents key: TAUA
```


author: Dorian Brim
body: Apologies, but I actually did have a plan key specified on a new line, when pasting the code in I had to insert all the new lines manually and missed this one, but here is what I have

![Screen Shot 2020-04-20 at 10.33.50 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/91262i3255474B7EC91CFE/image-size/large?v=v2&px=999 "Screen Shot 2020-04-20 at 10.33.50 AM.png")


author: Alexey Chystoprudov
body: It looks like parser can't see new line. Can you try to change order of tags and put key after project-key for example. Just to be sure it's definitely new line


author: Dorian Brim
body: I put the key tag below the project-key tag and I'm still getting the error. I added an attachment of part of the error and what I changed.![Screen Shot 2020-04-22 at 10.53.57 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/91692iB3F204EBCE506AF7/image-size/large?v=v2&px=999 "Screen Shot 2020-04-22 at 10.53.57 AM.png")![Screen Shot 2020-04-22 at 10.54.13 AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/91693i6CFF3F3063890A88/image-size/large?v=v2&px=999 "Screen Shot 2020-04-22 at 10.54.13 AM.png")


author: Alexey Chystoprudov
body: What's your Bamboo version?


author: Dorian Brim
body: I am using 6.10.4


author: Alexey Chystoprudov
body: It should be compatible with YAML v2

I see strange path at stacktrace

com.mhackner.bamboo.Configuration.addDefaultValues(Configuration.java:53)

It's not Bamboo source code. Do you have an idea why does it printed at error message?


author: Dorian Brim
body: Nothing comes to mind as to why I'd be receiving that error, do you have any potential ideas?


author: Alexey Chystoprudov
body: Please raise support request so our engineers can gather more information about environment and application logs to investigate this issue


author: Dorian Brim
body: Okay, how exactly do I raise support request?


author: Alexey Chystoprudov
body: [https://support.atlassian.com/contact/](https://support.atlassian.com/contact/#/)


Tags: configuration

spec

yaml