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

Bamboo fails to download artifacts in plan branches when using Specs branches

    XMLWordPrintable

Details

    Description

      Issue Summary

      Having Specs Branches enabled, Bamboo will fail to run a build where an Artifact Download task is configured.

      Steps to Reproduce

      1. Have Bamboo 7.0.2, with Bitbucket integrated to it.
      2. In Bitbucket, create a repository for the specs code, which will deploy two plans, PlanA and PlanB
      3. Configure PlanA to create an artifact.
      4. Configure PlanB to download that artifact, and in the field "Artifact name", select a specific artifact.
      5. Create a linked repository for the specs repository. Enable Specs on it.
      6. Make sure PlanA and PlanB have this repository as default repository in the plan.
      7. Create a branch. Now both PlanA and PlanB will have this branch created as plan branches.
      8. Run PlanA.
      9. Run PlanB.

      Expected Results

      PlanB will run successfully.

      Actual Results

      PlanB fails to start the run. In the logs we see:

      2020-04-08 10:39:04,125 INFO [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-11] [BitbucketServerBuildStatusUpdater] Sending build notification to Stash (build key: PR-PL20-8, repository: arts)
      2020-04-08 10:39:04,143 WARN [6-DelayedChangeDetectionThread:pool-12-thread-12] [ArtifactDownloaderRuntimeDataProvider] Unable to find an artifact definition for name: artifact
      2020-04-08 10:39:04,143 ERROR [6-DelayedChangeDetectionThread:pool-12-thread-12] [ChainPluginSupportHelper] Task context data provider failed:java.lang.IllegalArgumentException: Unable to find an artifact definition for name: artifact
      2020-04-08 10:39:04,144 ERROR [6-DelayedChangeDetectionThread:pool-12-thread-12] [ChainExecutionManagerImpl] Plan 'PR-PL20-8' started but a fatal error occurred
      java.lang.RuntimeException: java.lang.IllegalArgumentException: Unable to find an artifact definition for name: artifact
      	at com.atlassian.bamboo.chains.ChainPluginSupportHelper.lambda$prepareRuntimeTaskData$0(ChainPluginSupportHelper.java:50)
      	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
      	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
      	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
      	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
      	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
      	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
      	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
      	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
      	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485)
      	at com.atlassian.bamboo.chains.ChainPluginSupportHelper.prepareRuntimeTaskData(ChainPluginSupportHelper.java:31)
      	at com.atlassian.bamboo.chains.ChainPluginSupportImpl.lambda$buildStarted$9(ChainPluginSupportImpl.java:199)
      	at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:107)
      	at com.atlassian.bamboo.variable.CustomVariableContextRunnerImpl.execute(CustomVariableContextRunnerImpl.java:31)
      	at com.atlassian.bamboo.chains.ChainPluginSupportImpl.buildStarted(ChainPluginSupportImpl.java:197)
      	(...)
      Caused by: java.lang.IllegalArgumentException: Unable to find an artifact definition for name: artifact
      	at com.atlassian.bamboo.plugins.artifact.ArtifactDownloaderRuntimeDataProvider.populateRuntimeTaskData(ArtifactDownloaderRuntimeDataProvider.java:134)
      	at com.atlassian.bamboo.chains.ChainPluginSupportHelper.lambda$prepareRuntimeTaskData$0(ChainPluginSupportHelper.java:37)
      	... 66 more
      

      Workaround

      If, in the Artifact Download task, you select "Artifact name -> All artifacts", you will be able to bypass this bug.

      Attachments

        Issue Links

          Activity

            People

              mgardias Marcin Gardias
              pdemitrio Patricio
              Votes:
              9 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: