Uploaded image for project: 'SR for Confluence - Development'
  1. SR for Confluence - Development
  2. SRCONF-1368

Prune Old Page Versions does not work for blogpost

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: Low
    • Resolution: Done
    • Affects Version/s: 5.7.0.1-p5, 6.4.0-p5
    • Fix Version/s: 6.16.0
    • Labels:
      None
    • Sprint:
      SR4C Sprint 150, SR4C Sprint 151
    • Critical Points:
      1

      Description

      The Prune Old Page Versions does not run as expected, with below's error shown in logs:

      2020-07-13 14:41:40,042 ERROR [http-nio-8090-exec-3] [common.error.jersey.ThrowableExceptionMapper] toResponse Uncaught exception thrown by REST service: admin
       -- referer: http://localhost:8090/plugins/servlet/scriptrunner/admin/jobs/edit/09fc0732-3fb8-4447-ae14-740435c25986 | url: /rest/scriptrunner/latest/scheduled-jobs/com.onresolve.scriptrunner.canned.confluence.jobs.PruneOldPageVersions/preview | traceId: 0d002ea5e23dccf2 | userName: admin | sr.execution.id: [089c3507-de8d-4596-99e0-dc0f217bcc13]
      com.atlassian.confluence.core.service.NotAuthorizedException: admin
      	at com.atlassian.confluence.core.service.AbstractServiceCommand$ServiceCommandState$5.validate(AbstractServiceCommand.java:240)
      	at com.atlassian.confluence.core.service.AbstractServiceCommand$ServiceCommandState$6.execute(AbstractServiceCommand.java:285)
      	at com.atlassian.confluence.core.service.AbstractServiceCommand.execute(AbstractServiceCommand.java:60)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
      	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.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
      	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy3227.execute(Unknown Source)
      	at com.atlassian.confluence.core.service.ServiceCommand$execute.call(Unknown Source)
      	at com.onresolve.scriptrunner.canned.confluence.jobs.PruneOldPageVersions$_execute_closure1$_closure2$_closure4.doCall(PruneOldPageVersions.groovy:136)
      	at jdk.internal.reflect.GeneratedMethodAccessor2482.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at com.onresolve.scriptrunner.canned.confluence.jobs.PruneOldPageVersions$_execute_closure1$_closure2.doCall(PruneOldPageVersions.groovy:129)
      	at jdk.internal.reflect.GeneratedMethodAccessor2497.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at com.onresolve.scriptrunner.canned.confluence.jobs.PruneOldPageVersions$_execute_closure1.doCall(PruneOldPageVersions.groovy:111)
      	at com.onresolve.scriptrunner.canned.confluence.jobs.PruneOldPageVersions$_execute_closure1.doCall(PruneOldPageVersions.groovy)
      	at jdk.internal.reflect.GeneratedMethodAccessor2491.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at com.onresolve.scriptrunner.jobs.ConfluenceIdentitySwitchingService$_switchIndentityAndExecute_closure1.doCall(ConfluenceIdentitySwitchingService.groovy:30)
      	at com.onresolve.scriptrunner.jobs.ConfluenceIdentitySwitchingService$_switchIndentityAndExecute_closure1.doCall(ConfluenceIdentitySwitchingService.groovy)
      	at jdk.internal.reflect.GeneratedMethodAccessor2490.invoke(Unknown Source)
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at com.atlassian.confluence.user.AuthenticatedUserImpersonator$2.call(AuthenticatedUserImpersonator.java:118)
      	at com.atlassian.confluence.user.AuthenticatedUserImpersonator$1.call(AuthenticatedUserImpersonator.java:101)
      	at com.atlassian.confluence.user.AuthenticatedUserImpersonator.asUser(AuthenticatedUserImpersonator.java:82)
      	at com.atlassian.confluence.user.AuthenticatedUserImpersonator$asUser.call(Unknown Source)
      	at com.onresolve.scriptrunner.jobs.ConfluenceIdentitySwitchingService.switchIndentityAndExecute(ConfluenceIdentitySwitchingService.groovy:29)
      	at com.onresolve.scriptrunner.jobs.IdentitySwitchingService$switchIndentityAndExecute.call(Unknown Source)
      	at com.onresolve.scriptrunner.canned.confluence.jobs.PruneOldPageVersions.execute(PruneOldPageVersions.groovy:101)
      	at com.onresolve.scriptrunner.canned.confluence.jobs.PruneOldPageVersions.execute(PruneOldPageVersions.groovy)
      

      Steps to replicate

      1. create a new blank space, TEST with the Confluence admin
      2. create a new blogpost
      3. edit the blogpost a few time to create some version history.
      4. Go to Scriptrunner Jobs and create Prune old page versions with below's configuration:
      5. Click run

      Expected behaviour
      The old version of the blogpost will be deleted

      Actual Behavior

      Error below shows in the logs:

      Affected versions

      **ScriptRunner for Confluence 5.7.0.1-p5 => 

       

        Attachments

          Activity

            People

            Assignee:
            rholban Roland Holban [X] (Inactive)
            Reporter:
            wwong Wayne Wong [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: