Uploaded image for project: 'Bamboo'
  1. Bamboo
  2. BAM-21805

Attempting to delete a deployment environment that has an agent dedication causes org.acegisecurity.acls.NotFoundException on the deployment dashboard

    XMLWordPrintable

Details

    Description

      Issue Summary

      Deleting a deployment environment that has an agent dedication causes org.acegisecurity.acls.NotFoundException: Could not find ACL for HibernateObjectIdentityImpl{Java Type=interface com.atlassian.bamboo.deployments.environments.InternalEnvironment on the deployment dashboard.

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Create a deployment project and deployment environment
      2. Dedicate an agent to the deployment environment
      3. Grant view and edit permissions to both the deployment project and environment to a non-admin user
      4. Login as that non-admin user
      5. Delete the environment
      6. Load the deployment dashboard

      Expected Results

      Deployment dashboard loads

      Actual Results

      Deployment dashboard does not load and presents the below error in both the UI and $BAMBOO_HOME/atlassian-bamboo.log

      2022-07-08 14:09:16,236 WARN [http-nio-8085-exec-23 url: /bamboo/rest/api/latest/deploy/dashboard/paginate; user: depperm] [BambooRuntimeExceptionMapper] Unexpected error from REST call
      com.google.common.util.concurrent.UncheckedExecutionException: org.acegisecurity.acls.NotFoundException: Could not find ACL for HibernateObjectIdentityImpl{Java Type=interface com.atlassian.bamboo.deployments.environments.InternalEnvironment, Identifier=84410388}
      	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2055)
      	at com.google.common.cache.LocalCache.get(LocalCache.java:3966)
      	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3989)
      	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4950)
      	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4956)
      	at com.atlassian.bamboo.security.BambooCachingPermissionManagerFacadeImpl$BambooCachingPermissionManager.readAclById(BambooCachingPermissionManagerFacadeImpl.java:47)
      	at com.atlassian.bamboo.security.BambooPermissionManagerImpl.hasPermission(BambooPermissionManagerImpl.java:458)
      	at com.atlassian.bamboo.security.BambooPermissionManagerImpl.hasPermission(BambooPermissionManagerImpl.java:436)
      	at com.atlassian.bamboo.security.BambooPermissionManagerImpl.hasPermission(BambooPermissionManagerImpl.java:131)
      	at com.atlassian.bamboo.security.BambooCachingPermissionManagerFacadeImpl.hasPermission(BambooCachingPermissionManagerFacadeImpl.java:87)
      	at com.atlassian.bamboo.deployments.projects.service.DeploymentProjectServiceImpl.lambda$getPaginatedDeploymentsWithEnvironments$6(DeploymentProjectServiceImpl.java:1194)
      	at com.atlassian.bamboo.utils.PaginatedDataCollectorImpl$LimitedCumulatedPredicate.test(PaginatedDataCollectorImpl.java:71)
      	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
      	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
      	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
      	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
      	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
      	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
      	at com.atlassian.bamboo.utils.PaginatedDataCollectorImpl.collect(PaginatedDataCollectorImpl.java:35)
      	at com.atlassian.bamboo.deployments.projects.service.DeploymentProjectServiceImpl.getPaginatedDeploymentsWithEnvironments(DeploymentProjectServiceImpl.java:1197)
      ...
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1647)
      	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
      	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: org.acegisecurity.acls.NotFoundException: Could not find ACL for HibernateObjectIdentityImpl{Java Type=interface com.atlassian.bamboo.deployments.environments.InternalEnvironment, Identifier=84410388}
      	at com.atlassian.bamboo.security.acegi.acls.HibernateMutableAclServiceImpl.readAclById(HibernateMutableAclServiceImpl.java:81)
      	at com.atlassian.bamboo.security.acegi.acls.HibernateMutableAclServiceImpl.readAclById(HibernateMutableAclServiceImpl.java:72)
      	at jdk.internal.reflect.GeneratedMethodAccessor992.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
      	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
      	at com.sun.proxy.$Proxy139.readAclById(Unknown Source)
      	at com.atlassian.bamboo.security.BambooPermissionManagerImpl.readAclById(BambooPermissionManagerImpl.java:196)
      	at com.atlassian.bamboo.security.BambooCachingPermissionManagerFacadeImpl$BambooCachingPermissionManager.access$101(BambooCachingPermissionManagerFacadeImpl.java:37)
      	at com.atlassian.bamboo.security.BambooCachingPermissionManagerFacadeImpl$BambooCachingPermissionManager$1.load(BambooCachingPermissionManagerFacadeImpl.java:41)
      	at com.atlassian.bamboo.security.BambooCachingPermissionManagerFacadeImpl$BambooCachingPermissionManager$1.load(BambooCachingPermissionManagerFacadeImpl.java:38)
      	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3533)
      	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2282)
      	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2159)
      	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2049)
      	... 293 more
      

      Workarounds

      Option 1

      As a Bamboo admin, visit $BAMBOO_BASE_URL/deploy/config/configureEnvironmentPermissions.action?environmentId=$ID replacing the $ID with the Identifier from the error message.

      E.g.

      org.acegisecurity.acls.NotFoundException: Could not find ACL for HibernateObjectIdentityImpl{Java Type=interface com.atlassian.bamboo.deployments.environments.InternalEnvironment, Identifier=84410388}
      

      Becomes: $BAMBOO_BASE_URL/deploy/config/configureEnvironmentPermissions.action?environmentId=84410388

      Toggle any permission on this screen to restore the permission cache to a working condition. For example, remove the edit permission for any user and add it back.

      Option 2

      Alternatively, if you no longer need the deployment environment, you can have a Bamboo administrator permanently delete the deployment environment that caused the problem.

      Option 3

      For audit purposes, if a user (not an Admin) must delete the deployment environment, ask a Bamboo administrator to remove the Agent dedication configuration from the Environment and to run the steps listed on Option 1 to refresh the cache, then the user can safely remove the deployment environment.

      Option 4

      Restart Bamboo Server to restore the Deployment dashboard view. If the deployment environment is expected to be deleted, please follow Option 2 or Option 3.

      Attachments

        Issue Links

          Activity

            People

              851f15845f55 Mateusz Szmal
              jowen@atlassian.com Jeremy Owen
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: