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

Job with dependent artifact can hang during branch creation if triggered before artifact exists

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 9.3.4, 9.2.6
    • 9.2.4, 9.3.3
    • Artifacts, Builds
    • None

    Description

      Issue Summary

      Job with dependent artifact can hang during initial branch build if triggered before artifact exists.

      Steps to Reproduce

      1. Create producer build plan
        1. Link it to a repository.
        2. Create plan branch: When new branch in repository is created
        3. Trigger >> Bitbucket Server repository triggered
        4. One stage with job that creates artifact A and a script task with sleep 30; (to delay the first build from completion)
        5. Share artifact A
      2. Create Consumer build plan
        1. Link it to a repository.
        2. Create plan branch: When new branch in repository is created
        3. Trigger >> Bitbucket Server repository triggered (repository polling untested but assumed to be the same)
        4. 2 stages
        5. First stage is a placeholder and can do anything.
        6. 2nd stage has job with artifact download task to download artifact A
      3. Push a new branch

      Expected Results

      Consumer plan job that downloads the artifact fails as dependent artifact is not found.

      Actual Results

      Job hangs indefinitely.

      The below exception is correctly thrown in the atlassian-bamboo.log file and is displayed against the build result:

      java.lang.IllegalArgumentException: Unable to find at least one successful result for plan: ART-PROD15
      	at com.atlassian.bamboo.plugins.artifact.ArtifactDownloaderRuntimeDataProvider.populateRuntimeTaskData(ArtifactDownloaderRuntimeDataProvider.java:104)
      	at com.atlassian.bamboo.chains.ChainPluginSupportHelper.lambda$prepareRuntimeTaskData$0(ChainPluginSupportHelper.java:37)
      	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$10.run(ChainPluginSupportImpl.java:242)
      	at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:174)
      	at com.atlassian.bamboo.variable.CustomVariableContextRunnerImpl.execute(CustomVariableContextRunnerImpl.java:31)
      	at com.atlassian.bamboo.chains.ChainPluginSupportImpl.buildStarted(ChainPluginSupportImpl.java:233)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at org.springframework.orm.hibernate5.support.OpenSessionInterceptor.invoke(OpenSessionInterceptor.java:90)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy245.buildStarted(Unknown Source)
      

      Notes

      The job never gets dispatched, so while this doesn't consume an agent the impact is it will use up a concurrent build slot for that plan and appear to be building while viewing the result.

      Workaround

      The build can be stopped manually by Viewing the build result >> Actions >> Stop Build.

      To avoid the problem: Remove the commit trigger (Plan Configuration >> Triggers) from the child plan and instead use a Bamboo plan dependency to trigger the child plan:

      Attachments

        Issue Links

          Activity

            People

              mgardias Marcin Gardias
              jowen@atlassian.com Jeremy Owen
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: