Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-21404

Adding triggers definitions in YAML specs causes an unexpected error in the logs

      Issue Summary

      If a schedule or remote trigger is added to the YAML specs, the project is imported but an error is thrown in the logs

      Steps to Reproduce

      1. Link a new repository to Bamboo with the following content for the /bamboo-specs/bamboo.yaml file
        version: 2
        plan:
          project-key: SMT
          key: TST
          name: First Plan aka. Plan A
        triggers:
        - cron: 0 30 6 ? * 5,2,6,3,4
        stages:
        - Default Stage:
            manual: false
            final: false
            jobs:
            - Default Job
        Default Job:
          key: JOB1
          tasks:
          - script:
              interpreter: SHELL
              scripts:
              - echo test > text.txt
          artifacts:
          - name: Text
            pattern: '**/*.txt'
            shared: true
            required: true
        branches:
          create: manually
          delete: never
          link-to-jira: true
        notifications: []
        labels: []
        other:
          concurrent-build-plugin: system-default
        
      1. Make sure you have a project with the key SMT
      2. Enable specs for the repository
      3. Run a manual scan for specs

      Expected Results

      The plan will be imported with no errors in the logs.

      Actual Results

      the plan is imported but the below exception is thrown in the atlassian-bamboo.log file:

      2021-08-31 12:01:23,956 ERROR [17-BAM::SpecsDetection:pool-25-thread-1] [BambooPluginUtils] Error parse YAML trigger
      com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException: triggers / [0] / tag: Property is required.
      	at com.atlassian.bamboo.specs.api.validators.common.ImporterUtils.checkThat(ImporterUtils.java:40)
      	at com.atlassian.bamboo.specs.yaml.BambooYamlParserUtils.checkPresent(BambooYamlParserUtils.java:87)
      	at com.atlassian.bamboo.specs.yaml.MapNode.getNode(MapNode.java:117)
      	at com.atlassian.bamboo.trigger.exporters.TagTriggerDefinitionExporter.fromYaml(TagTriggerDefinitionExporter.java:119)
      	at com.atlassian.bamboo.trigger.exporters.TagTriggerDefinitionExporter.fromYaml(TagTriggerDefinitionExporter.java:34)
      	at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl$6.call(BambooYamlParserImpl.java:1174)
      	at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl$6.call(BambooYamlParserImpl.java:1170)
      	at com.atlassian.bamboo.plugin.BambooPluginUtils.callUnsafeCode(BambooPluginUtils.java:55)
      	at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl.parseTrigger(BambooYamlParserImpl.java:1170)
      	at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl.lambda$null$4(BambooYamlParserImpl.java:208)
      	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
      	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
      	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
      	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
      	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
      	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
      	at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl.lambda$parsePlan$5(BambooYamlParserImpl.java:209)
      	at java.base/java.util.Optional.map(Optional.java:265)
      	at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl.parsePlan(BambooYamlParserImpl.java:207)
      	at com.atlassian.bamboo.configuration.external.rss.YamlSpecsImportServiceImpl.parseYaml(YamlSpecsImportServiceImpl.java:161)
      	at com.atlassian.bamboo.configuration.external.rss.YamlSpecsImportServiceImpl.processSimplifiedYaml(YamlSpecsImportServiceImpl.java:107)
      	at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.tryProcessYaml(RepositoryStoredSpecsServiceImpl.java:338)
      	at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.runBambooSpecs(RepositoryStoredSpecsServiceImpl.java:184)
      	at com.atlassian.bamboo.configuration.external.RssDetectionServiceImpl.runRssDetection(RssDetectionServiceImpl.java:374)
      	at com.atlassian.bamboo.configuration.external.detection.RssDetectionRunnable.run(RssDetectionRunnable.java:42)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)
      	at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
      	at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
      	at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      

      Workaround

      From our tests, this BUG seems to be harmless so no workaround needs to be provided.

          Form Name

            [BAM-21404] Adding triggers definitions in YAML specs causes an unexpected error in the logs

            Zuzanna Struczewska made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 599281 ]
            Marcin Gardias made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: Waiting for Release [ 12075 ] New: Closed [ 6 ]
            Bugfix Automation Bot made changes -
            Support reference count New: 1
            Gabriel Ribeiro made changes -
            Description Original: h3. Issue Summary
            If a schedule our remote trigger is added to the YAML specs, the project is imported but an error is thrown in the logs
            h3. Steps to Reproduce
             # Link a new repository to Bamboo with the following content for the {{/bamboo-specs/bamboo.yaml}} file
            {noformat}
            version: 2
            plan:
              project-key: SMT
              key: TST
              name: First Plan aka. Plan A
            triggers:
            - cron: 0 30 6 ? * 5,2,6,3,4
            stages:
            - Default Stage:
                manual: false
                final: false
                jobs:
                - Default Job
            Default Job:
              key: JOB1
              tasks:
              - script:
                  interpreter: SHELL
                  scripts:
                  - echo test > text.txt
              artifacts:
              - name: Text
                pattern: '**/*.txt'
                shared: true
                required: true
            branches:
              create: manually
              delete: never
              link-to-jira: true
            notifications: []
            labels: []
            other:
              concurrent-build-plugin: system-default
            {noformat}
             # Make sure you have a project with the key {{SMT}}
             # Enable specs for the repository
             # Run a manual scan for specs

            h3. Expected Results
            The plan will be imported with no errors in the logs.
            h3. Actual Results
            the plan is imported but the below exception is thrown in the atlassian-bamboo.log file:
            {noformat}
            2021-08-31 12:01:23,956 ERROR [17-BAM::SpecsDetection:pool-25-thread-1] [BambooPluginUtils] Error parse YAML trigger
            com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException: triggers / [0] / tag: Property is required.
            at com.atlassian.bamboo.specs.api.validators.common.ImporterUtils.checkThat(ImporterUtils.java:40)
            at com.atlassian.bamboo.specs.yaml.BambooYamlParserUtils.checkPresent(BambooYamlParserUtils.java:87)
            at com.atlassian.bamboo.specs.yaml.MapNode.getNode(MapNode.java:117)
            at com.atlassian.bamboo.trigger.exporters.TagTriggerDefinitionExporter.fromYaml(TagTriggerDefinitionExporter.java:119)
            at com.atlassian.bamboo.trigger.exporters.TagTriggerDefinitionExporter.fromYaml(TagTriggerDefinitionExporter.java:34)
            at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl$6.call(BambooYamlParserImpl.java:1174)
            at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl$6.call(BambooYamlParserImpl.java:1170)
            at com.atlassian.bamboo.plugin.BambooPluginUtils.callUnsafeCode(BambooPluginUtils.java:55)
            at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl.parseTrigger(BambooYamlParserImpl.java:1170)
            at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl.lambda$null$4(BambooYamlParserImpl.java:208)
            at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
            at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
            at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
            at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
            at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
            at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
            at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
            at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl.lambda$parsePlan$5(BambooYamlParserImpl.java:209)
            at java.base/java.util.Optional.map(Optional.java:265)
            at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl.parsePlan(BambooYamlParserImpl.java:207)
            at com.atlassian.bamboo.configuration.external.rss.YamlSpecsImportServiceImpl.parseYaml(YamlSpecsImportServiceImpl.java:161)
            at com.atlassian.bamboo.configuration.external.rss.YamlSpecsImportServiceImpl.processSimplifiedYaml(YamlSpecsImportServiceImpl.java:107)
            at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.tryProcessYaml(RepositoryStoredSpecsServiceImpl.java:338)
            at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.runBambooSpecs(RepositoryStoredSpecsServiceImpl.java:184)
            at com.atlassian.bamboo.configuration.external.RssDetectionServiceImpl.runRssDetection(RssDetectionServiceImpl.java:374)
            at com.atlassian.bamboo.configuration.external.detection.RssDetectionRunnable.run(RssDetectionRunnable.java:42)
            at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
            at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
            at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)
            at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
            at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
            at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)
            at java.base/java.lang.Thread.run(Thread.java:829)
            {noformat}
            h3. Workaround
            From our tests, this BUG seems to be harmless so no workaround needs to be provived.
            New: h3. Issue Summary

            If a schedule or remote trigger is added to the YAML specs, the project is imported but an error is thrown in the logs
            h3. Steps to Reproduce
             # Link a new repository to Bamboo with the following content for the {{/bamboo-specs/bamboo.yaml}} file
            {noformat}
            version: 2
            plan:
              project-key: SMT
              key: TST
              name: First Plan aka. Plan A
            triggers:
            - cron: 0 30 6 ? * 5,2,6,3,4
            stages:
            - Default Stage:
                manual: false
                final: false
                jobs:
                - Default Job
            Default Job:
              key: JOB1
              tasks:
              - script:
                  interpreter: SHELL
                  scripts:
                  - echo test > text.txt
              artifacts:
              - name: Text
                pattern: '**/*.txt'
                shared: true
                required: true
            branches:
              create: manually
              delete: never
              link-to-jira: true
            notifications: []
            labels: []
            other:
              concurrent-build-plugin: system-default
            {noformat}

             # Make sure you have a project with the key {{SMT}}
             # Enable specs for the repository
             # Run a manual scan for specs

            h3. Expected Results

            The plan will be imported with no errors in the logs.
            h3. Actual Results

            the plan is imported but the below exception is thrown in the atlassian-bamboo.log file:
            {noformat}
            2021-08-31 12:01:23,956 ERROR [17-BAM::SpecsDetection:pool-25-thread-1] [BambooPluginUtils] Error parse YAML trigger
            com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException: triggers / [0] / tag: Property is required.
            at com.atlassian.bamboo.specs.api.validators.common.ImporterUtils.checkThat(ImporterUtils.java:40)
            at com.atlassian.bamboo.specs.yaml.BambooYamlParserUtils.checkPresent(BambooYamlParserUtils.java:87)
            at com.atlassian.bamboo.specs.yaml.MapNode.getNode(MapNode.java:117)
            at com.atlassian.bamboo.trigger.exporters.TagTriggerDefinitionExporter.fromYaml(TagTriggerDefinitionExporter.java:119)
            at com.atlassian.bamboo.trigger.exporters.TagTriggerDefinitionExporter.fromYaml(TagTriggerDefinitionExporter.java:34)
            at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl$6.call(BambooYamlParserImpl.java:1174)
            at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl$6.call(BambooYamlParserImpl.java:1170)
            at com.atlassian.bamboo.plugin.BambooPluginUtils.callUnsafeCode(BambooPluginUtils.java:55)
            at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl.parseTrigger(BambooYamlParserImpl.java:1170)
            at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl.lambda$null$4(BambooYamlParserImpl.java:208)
            at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
            at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
            at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
            at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
            at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
            at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
            at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
            at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl.lambda$parsePlan$5(BambooYamlParserImpl.java:209)
            at java.base/java.util.Optional.map(Optional.java:265)
            at com.atlassian.bamboo.configuration.external.yaml.BambooYamlParserImpl.parsePlan(BambooYamlParserImpl.java:207)
            at com.atlassian.bamboo.configuration.external.rss.YamlSpecsImportServiceImpl.parseYaml(YamlSpecsImportServiceImpl.java:161)
            at com.atlassian.bamboo.configuration.external.rss.YamlSpecsImportServiceImpl.processSimplifiedYaml(YamlSpecsImportServiceImpl.java:107)
            at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.tryProcessYaml(RepositoryStoredSpecsServiceImpl.java:338)
            at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.runBambooSpecs(RepositoryStoredSpecsServiceImpl.java:184)
            at com.atlassian.bamboo.configuration.external.RssDetectionServiceImpl.runRssDetection(RssDetectionServiceImpl.java:374)
            at com.atlassian.bamboo.configuration.external.detection.RssDetectionRunnable.run(RssDetectionRunnable.java:42)
            at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
            at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
            at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)
            at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
            at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
            at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)
            at java.base/java.lang.Thread.run(Thread.java:829)
            {noformat}
            h3. Workaround

            From our tests, this BUG seems to be harmless so no workaround needs to be provided.
            Alexey Chystoprudov made changes -
            Fix Version/s New: 8.1.0 [ 97096 ]
            Fix Version/s New: 8.0.1 [ 97707 ]
            Alexey Chystoprudov made changes -
            Status Original: In Progress [ 3 ] New: Waiting for Release [ 12075 ]
            Alexey Chystoprudov made changes -
            Status Original: Needs Triage [ 10030 ] New: In Progress [ 3 ]
            Alexey Chystoprudov made changes -
            Assignee New: Alexey Chystoprudov [ achystoprudov ]
            Gabriel Ribeiro made changes -
            Summary Original: Triggers definitions in YAML specs causes an unexpected error in the logs New: Adding triggers definitions in YAML specs causes an unexpected error in the logs
            Gabriel Ribeiro created issue -

              achystoprudov Alexey Chystoprudov
              gribeiro Gabriel Ribeiro
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: