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

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              achystoprudov Alexey Chystoprudov
              gribeiro Gabriel Ribeiro
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: