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

'Docker - Delete unused manifests and images' fails with NullPointerException

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.41.0
    • Fix Version/s: None
    • Component/s: Docker, Scheduled Tasks
    • Labels:
    • Story Points:
      3
    • Notability:
      3

      Description

      Issue:

      Task 'Docker - Delete unused manifests and images' fails with "java.lang.NullPointerException: Cannot get property 'digest' on null object" error.

      Steps to reproduce:

      1) Create a docker proxy to https://registry-1.docker.io

      2) Pull rockylinux/rockylinux:8 (https://hub.docker.com/r/rockylinux/rockylinux)

      docker pull <host>:<port>/rockylinux/rockylinux:8
      

      3) Run task 'Docker - Delete unused manifests and images' on docker proxy (deploy offset hours set to 0)

      4) Check the log/tasks/repository.docker.gc-<timetsamp>/log for the error.

      Expected behaviour

      Task 'Docker - Delete unused manifests and images' should not fail with Null Pointer exception

      Actual Behaviour

      The task fails with

       
      2022-08-22 16:18:54,230+0100 INFO [quartz-17-thread-9] *SYSTEM org.sonatype.nexus.repository.docker.internal.orient.DockerGCFacetImpl - Running GC for v2 assets on docker-hub-proxy
      2022-08-22 16:18:54,248+0100 ERROR [quartz-17-thread-9] *SYSTEM org.sonatype.nexus.repository.docker.tasks.DockerGCTask - Failed to run task 'Docker - Delete unused manifests and images' on repository 'docker-hub-proxy'
      java.lang.NullPointerException: Cannot get property 'digest' on null object
      at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60)
      at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:190)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.getAt(DefaultGroovyMethods.java:342)
      at org.codehaus.groovy.runtime.dgm$242.invoke(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoMetaMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:251)
      at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:71)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
      at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:34)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
      at org.sonatype.nexus.repository.docker.internal.V2Manifest.referencedDigests(V2Manifest.groovy:104)
      at org.sonatype.nexus.repository.docker.internal.orient.DockerGCFacetImpl.fetchDataForManifest(DockerGCFacetImpl.java:382)
      at org.sonatype.nexus.repository.docker.internal.orient.DockerGCFacetImpl.fetchDataForRepository(DockerGCFacetImpl.java:355)
      at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:49)
      at org.sonatype.nexus.repository.docker.internal.orient.DockerGCFacetImpl.handleV2Assets(DockerGCFacetImpl.java:215)
      at org.sonatype.nexus.repository.docker.internal.orient.DockerGCFacetImpl.processRepository(DockerGCFacetImpl.java:144)
      at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:58)
      at org.sonatype.nexus.transaction.TransactionInterceptor.proceedWithTransaction(TransactionInterceptor.java:66)
      at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55)
      at org.sonatype.nexus.repository.docker.internal.orient.DockerGCFacetImpl.deleteUnusedManifestsAndImages(DockerGCFacetImpl.java:126)
      at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
      at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:272)
      at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:54)
      at org.sonatype.nexus.repository.docker.tasks.DockerGCTask.execute(DockerGCTask.java:48)
      at org.sonatype.nexus.repository.RepositoryTaskSupport.execute(RepositoryTaskSupport.java:79)
      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:145)
      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)
      

      Workaround

      Browse docker proxy and delete folder rockylinux. Then run task  'Docker - Delete unused manifests and images' on docker proxy.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ybulatnikov Eugene Bulatnikov
              Reporter:
              msurani Mahendra Surani
              Last Updated By:
              Rich Seddon Rich Seddon
              Team:
              NXRM - Mad Max
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response:

                  tigCommentSecurity.panel-title