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

"java.lang.AbstractMethodError" exception on RuntimeTaskDataProvider#processRuntimeTaskData invocations after upgrade to Bamboo 5.9.0

      After upgrading to Bamboo 5.9.0, customers of ours encounter the following reproducible exception when running builds using our Tasks for AWS Add-on:

      java.lang.AbstractMethodError: net.utoolity.atlassian.bamboo.taws.AWSRuntimeTaskDataProvider.processRuntimeTaskData(Lcom/atlassian/bamboo/task/runtime/RuntimeTaskDefinition;Lcom/atlassian/bamboo/v2/build/CommonContext;)V
      	at com.atlassian.bamboo.chains.ChainPluginSupportHelper.processRuntimeTaskData(ChainPluginSupportHelper.java:76)
      	at com.atlassian.bamboo.chains.ChainPluginSupportImpl$11.run(ChainPluginSupportImpl.java:319)
      	at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:200)
      	at com.atlassian.bamboo.variable.CustomVariableContextRunnerImpl.execute(CustomVariableContextRunnerImpl.java:32)
      	at com.atlassian.bamboo.chains.ChainPluginSupportImpl.buildCompleted(ChainPluginSupportImpl.java:305)
      	at sun.reflect.GeneratedMethodAccessor2242.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      	at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
      	at com.sun.proxy.$Proxy142.buildCompleted(Unknown Source)
      	at com.atlassian.bamboo.chains.ChainExecutionManagerImpl$3.run(ChainExecutionManagerImpl.java:392)
      	at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:321)
      	at com.atlassian.bamboo.chains.ChainExecutionManagerImpl.onBuildFinished(ChainExecutionManagerImpl.java:378)
      	at sun.reflect.GeneratedMethodAccessor2241.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36)
      	at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49)
      	at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)
      	at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)
      	at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)
      	at java.lang.Thread.run(Thread.java:744)
      

      Initital analysis

      Checking the 5.9.0 source of com.atlassian.bamboo.chains.ChainPluginSupportHelper#processRuntimeTaskData suggests this to be caused by an insufficient backwards compatibility check:

      try
      {
          runtimeConfigurator.processRuntimeTaskData(taskDefinition, commonContext);
      }
      catch (NoSuchMethodError e)
      {
          runtimeConfigurator.processRuntimeTaskData((TaskDefinition) taskDefinition, commonContext);
      }
      

      This tries to fall back to the older (pre 5.9) RuntimeTaskDataProvider#processRuntimeTaskData method using a TaskDefinition instead of the newly introduced RuntimeTaskDefinition, but expects a java.lang.NoSuchMethodError instead of the actually thrown java.lang.AbstractMethodError as an indicator for applying the fallback.

      Proposed fix

      Adjust ChainPluginSupportHelper#processRuntimeTaskData to catch the java.lang.AbstractMethodError exception and fall back to invoking the older RuntimeTaskDataProvider#processRuntimeTaskData method signature in that case.

      We consider this to be a rather critical bug, as it affects all Bamboo Add-ons that implement a RuntimeTaskDataProvider.

              Unassigned Unassigned
              847fe7f23dab Henrik Opel [Utoolity]
              Affected customers:
              2 This affects my team
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: