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

Purge unused components task can trigger java.lang.ClassCastException: com.orientechnologies.orient.core.id.ORecordId cannot be cast to com.orientechnologies.orient.core.record.impl.ODocument

    XMLWordPrintable

    Details

      Description

      The following task ERROR was noted in a customer running a HA-C environ inside a repository.purge-unused task log ( not nexus.log ). The Purge Unused Components task seemingly encountered problems purging components from a NuGet proxy repository:

      Task ERROR log message
      2018-10-14 21:15:36,325-0500 ERROR [quartz-5-thread-13] ltxld-sa-repo-02 *SYSTEM org.sonatype.nexus.repository.purge.PurgeUnusedTask - Failed to run task 'Purge unused components and assets from *' on repository 'nuget.org'
      java.lang.ClassCastException: com.orientechnologies.orient.core.id.ORecordId cannot be cast to com.orientechnologies.orient.core.record.impl.ODocument
       at org.sonatype.nexus.repository.purge.PurgeUnusedFacetImpl.lambda$0(PurgeUnusedFacetImpl.java:129)
       at com.google.common.collect.Iterators$6.transform(Iterators.java:788)
       at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47)
       at org.sonatype.nexus.repository.purge.PurgeUnusedFacetImpl.deleteUnusedComponents(PurgeUnusedFacetImpl.java:89)
       at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:56)
       at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:54)
       at org.sonatype.nexus.repository.purge.PurgeUnusedFacetImpl.purgeUnused(PurgeUnusedFacetImpl.java:74)
       at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
       at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:270)
       at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:53)
       at org.sonatype.nexus.repository.purge.PurgeUnusedTask.execute(PurgeUnusedTask.java:35)
       at org.sonatype.nexus.repository.RepositoryTaskSupport.execute(RepositoryTaskSupport.java:73)
       at org.sonatype.nexus.scheduling.TaskSupport.call(TaskSupport.java:93)
       at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.doExecute(QuartzTaskJob.java:145)
       at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.execute(QuartzTaskJob.java:108)
       at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
       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 task continued to process the remaining repositories in the system despite this error.

      Expected

      it is not known how to arrive in this state, but ClassCastException is unexpected. Hopefully the stack trace can help us add some more defensive code in this task, or improve the logging to better understand what specifically what was wrong other than a type error.

        Attachments

          Activity

            People

            Assignee:
            mjohnson Matt Johnson
            Reporter:
            plynch Peter Lynch
            Last Updated By:
            Peter Lynch Peter Lynch
            Team:
            NXRM - Morpheus
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title