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

Deleting an artifact definition from a build plan will corrupt any linked deployment plans with artifact download tasks

      Summary

      Deleting an artifact definition from a build plan will corrupt any linked deployment plans with artifact download tasks. Can no longer create or deploy a release, nor delete the deployment project once affected. Source build plan can not be modified.

      Steps to Reproduce

      1. Setup a build plan with 2 shared artifact definitions
      2. Create a deployment project linked to this build plan
      3. Add an environment with an artifact download task
      4. Build the source build plan
      5. Delete one of the artifact definitions
      6. Attempt to create a release off that result

      Expected Results

      Release can be created / deployed
      Deployment project can be deleted
      Source build plan can not be modified

      Actual Results

      The below exception is thrown in the UI as an Internal Server error and logged to the atlassian-bamboo.log when attempting to create a release / delete the project / change the source build plan:

      org.springframework.orm.hibernate5.HibernateSystemException: Cannot instantiate abstract class or interface:  : com.atlassian.bamboo.deployments.projects.persistence.items.AbstractMutableDeploymentProjectItem; nested exception is org.hibernate.InstantiationException: Cannot instantiate abstract class or interface:  : com.atlassian.bamboo.deployments.projects.persistence.items.AbstractMutableDeploymentProjectItem
      	at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:296)
      	at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:362)
      	at org.springframework.orm.hibernate5.HibernateTemplate.execute(HibernateTemplate.java:313)
      	at com.atlassian.bamboo.deployments.projects.persistence.DeploymentProjectDaoImpl.getProjectItems(DeploymentProjectDaoImpl.java:206)
      	at sun.reflect.GeneratedMethodAccessor1679.invoke(Unknown Source)
      	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:333)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
      	at com.sun.proxy.$Proxy89.getProjectItems(Unknown Source)
      	at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl$3.run(DeploymentVersionServiceImpl.java:454)
      	at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:174)
      	at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl.getNewDeploymentVersionWithoutName(DeploymentVersionServiceImpl.java:447)
      	at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl.createDeploymentVersionInternal(DeploymentVersionServiceImpl.java:302)
      	at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl.access$000(DeploymentVersionServiceImpl.java:109)
      	at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl$2.apply(DeploymentVersionServiceImpl.java:280)
      	at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl$2.apply(DeploymentVersionServiceImpl.java:277)
      	at com.atlassian.bamboo.core.ScopedExclusionServiceImpl.withLock(ScopedExclusionServiceImpl.java:63)
      	at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl.createDeploymentVersion(DeploymentVersionServiceImpl.java:277)
      	at com.atlassian.bamboo.deployments.versions.actions.AbstractCreateDeploymentVersion.createVersion(AbstractCreateDeploymentVersion.java:117)
      	at com.atlassian.bamboo.deployments.execution.actions.ExecuteManualDeployment.execute(ExecuteManualDeployment.java:210)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      

      Notes

      • The affected deployment plan will display "No shared artifacts found for related plan. Please configure the build plan to publish shared artifacts." despite shared artifacts being configured still on the source build plan.

      Workaround

      1. Create a new plan with an artifact definition. This plan needs no content other than an artifact definition and its sole purpose is to be removed and in the next step.
      2. Remove this new plan created in step 1. This will trigger Bamboo to execute a DB cleanup and removes orphaned Artifact definition records which trigger the bug in affected plans.

            [BAM-19782] Deleting an artifact definition from a build plan will corrupt any linked deployment plans with artifact download tasks

            Frederik added a comment -

            We are also still seeing this issue after removing all artifacts from a plan and then re-adding new artifacts.

            Frederik added a comment - We are also still seeing this issue after removing all artifacts from a plan and then re-adding new artifacts.

            We are still seeing this issue on 6.6.1 build 60605 when renaming/removing artifacts from specs. 

            Manually creting and deleting an artifact "fixes" the problem.

            Sometimes redeploying the specs fixes the problem.

            Kaare Jakobsen added a comment - We are still seeing this issue on 6.6.1 build 60605 when renaming/removing artifacts from specs.  Manually creting and deleting an artifact "fixes" the problem. Sometimes redeploying the specs fixes the problem.

            @mark.burvill You must create a new plan and add an artifact to it.

            I'm seeing this on a 6.5.0 installation, triggered by publishing a bamboo specs update that removed some artifacts.

            Yes, the workaround to make a brand new plan with an artifact and then delete it does fix things, but the bug is still there.

            Pretty sure these plans were all originally made post-6.5.0 transition, too (if that makes any difference).

            Alastair Maw added a comment - @mark.burvill You must create a new plan and add an artifact to it . I'm seeing this on a 6.5.0 installation, triggered by publishing a bamboo specs update that removed some artifacts. Yes, the workaround to make a brand new plan with an artifact and then delete it does fix things, but the bug is still there. Pretty sure these plans were all originally made post-6.5.0 transition, too (if that makes any difference).

            This worked for me as well , i did run the temporary plan (simple checkout of repository with a shared artifact) and then delete it, i went to the build plan i could not delete previously and it was deleted as expected

            Stuart James added a comment - This worked for me as well , i did run the temporary plan (simple checkout of repository with a shared artifact) and then delete it, i went to the build plan i could not delete previously and it was deleted as expected

            Ramon Wind added a comment -

            Workaround also worked for me!

            Ramon Wind added a comment - Workaround also worked for me!

            I was having the same problem and after updating from 6.4 to 6.5, the Workaround listed above worked for me.  I did enabled the Plan and created a single Shared Artifact.

            IP Tools (Admin) added a comment - I was having the same problem and after updating from 6.4 to 6.5, the Workaround listed above worked for me.  I did enabled the Plan and created a single Shared Artifact.

            I've installed Bamboo 6.5.0 build 60509 to try and fix this problem, but despite trying the workaround above (create empty job, delete it again), I'm still unable to delete affected deployment plans. I've left about an hour for the cleanup script to run, but I still get the following:

            org.springframework.orm.hibernate5.HibernateSystemException: Cannot instantiate abstract class or interface: : com.atlassian.bamboo.deployments.projects.persistence.items.AbstractMutableDeploymentProjectItem; nested exception is org.hibernate.InstantiationException: Cannot instantiate abstract class or interface: : com.atlassian.bamboo.deployments.projects.persistence.items.AbstractMutableDeploymentProjectItem
            at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:302)
            at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:386)
            at org.springframework.orm.hibernate5.HibernateTemplate.execute(HibernateTemplate.java:335)
            at com.atlassian.bamboo.deployments.projects.persistence.DeploymentProjectDaoImpl.getProjectItems(DeploymentProjectDaoImpl.java:206)
            at com.atlassian.bamboo.deployments.projects.persistence.DeploymentProjectDaoImpl.delete(DeploymentProjectDaoImpl.java:249)
            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:344)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
            at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
            at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
            at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
            at com.sun.proxy.$Proxy94.delete(Unknown Source)
            ---[rest omitted]

            Mark Burvill added a comment - I've installed Bamboo 6.5.0 build 60509 to try and fix this problem, but despite trying the workaround above (create empty job, delete it again), I'm still unable to delete affected deployment plans. I've left about an hour for the cleanup script to run, but I still get the following: org.springframework.orm.hibernate5.HibernateSystemException: Cannot instantiate abstract class or interface: : com.atlassian.bamboo.deployments.projects.persistence.items.AbstractMutableDeploymentProjectItem; nested exception is org.hibernate.InstantiationException: Cannot instantiate abstract class or interface: : com.atlassian.bamboo.deployments.projects.persistence.items.AbstractMutableDeploymentProjectItem at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:302) at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:386) at org.springframework.orm.hibernate5.HibernateTemplate.execute(HibernateTemplate.java:335) at com.atlassian.bamboo.deployments.projects.persistence.DeploymentProjectDaoImpl.getProjectItems(DeploymentProjectDaoImpl.java:206) at com.atlassian.bamboo.deployments.projects.persistence.DeploymentProjectDaoImpl.delete(DeploymentProjectDaoImpl.java:249) 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:344) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy94.delete(Unknown Source) --- [rest omitted]

              mgardias Marcin Gardias
              jowen@atlassian.com Jeremy Owen
              Affected customers:
              5 This affects my team
              Watchers:
              22 Start watching this issue

                Created:
                Updated:
                Resolved: