Issue Summary
Job with dependent artifact can hang during initial branch build if triggered before artifact exists.
Steps to Reproduce
- Create producer build plan
- Link it to a repository.
- Create plan branch: When new branch in repository is created
- Trigger >> Bitbucket Server repository triggered
- One stage with job that creates artifact A and a script task with sleep 30; (to delay the first build from completion)
- Share artifact A
- Create Consumer build plan
- Link it to a repository.
- Create plan branch: When new branch in repository is created
- Trigger >> Bitbucket Server repository triggered (repository polling untested but assumed to be the same)
- 2 stages
- First stage is a placeholder and can do anything.
- 2nd stage has job with artifact download task to download artifact A
- 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:
- Mentioned in