Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-23811

cleanup policy task may fail due to DetachingList cannot be cast to java.util.Set

    XMLWordPrintable

    Details

      Description

      We have two documented cases of the following stack when booting customer support zips, both using 3.20.1:

      2020-02-03 11:36:45,512+0000 WARN  [quartz-3-thread-10] *SYSTEM org.sonatype.nexus.quartz.internal.task.QuartzTaskJob - Task cf66b3ac-725c-49b2-866e-38e6c7368d6e : 'Cleanup service' [repository.cleanup] execution failure
      java.lang.ClassCastException: org.sonatype.nexus.common.collect.DetachingList cannot be cast to java.util.Set
       at org.sonatype.nexus.cleanup.internal.service.CleanupServiceImpl.findPolicies(CleanupServiceImpl.java:145)
       at org.sonatype.nexus.cleanup.internal.service.CleanupServiceImpl.cleanup(CleanupServiceImpl.java:99)
       at org.sonatype.nexus.cleanup.internal.service.CleanupServiceImpl.lambda$0(CleanupServiceImpl.java:89)
       at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:407)
       at org.sonatype.nexus.cleanup.internal.service.CleanupServiceImpl.cleanup(CleanupServiceImpl.java:87)
       at org.sonatype.nexus.cleanup.internal.task.CleanupTask.execute(CleanupTask.java:46)
       at org.sonatype.nexus.scheduling.TaskSupport.call(TaskSupport.java:100)
       at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.doExecute(QuartzTaskJob.java:143)
       at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.execute(QuartzTaskJob.java:106)
       at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
       at org.sonatype.nexus.quartz.internal.QuartzThreadPool.lambda$0(QuartzThreadPool.java:143)
       at org.sonatype.nexus.thread.internal.MDCAwareRunnable.run(MDCAwareRunnable.java:40)
       at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)
       at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
       at java.lang.Thread.run(Thread.java:748)
      

      The error prevents the cleanup policy from running.

      The error has yet to be reported happening in production environments.

      The PR for fixing NEXUS-20111 seems to prevent anything but Set from being stored in policy list now ( first shipped in 3.19.1 ). However since there have been two cases where this stack was noticed, it seemed worth documenting.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              plynch Peter Lynch
              Last Updated By:
              Michael Prescott Michael Prescott
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  tigCommentSecurity.panel-title