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

NullPointer appears if run cleanup for hosted created via REST

    XMLWordPrintable

    Details

      Description

      Steps to reproduce:
      1. Create repository using REST e.g. for helm

      curl -u admin:admin123 \
       -X POST --header 'Content-Type: application/json' \
       http://localhost:8081/service/rest/beta/repositories/helm/hosted \
       -d '{ "name": "h3232-hosted", "online": true, "storage": { "blobStoreName": "default", "strictContentTypeValidation": true, "writePolicy": "ALLOW" }}'

      2. Run cleanup policy task

      Expected: No errors appear
      Actual results: NullPointer appears in the log. 

      2019-12-24 11:06:43,267+0200 INFO  [qtp1195943845-205] admin org.sonatype.nexus.quartz.internal.task.QuartzTaskInfo - Task 'Cleanup service' [repository.cleanup] runNow2019-12-24 11:06:43,267+0200 INFO  [qtp1195943845-205] admin org.sonatype.nexus.quartz.internal.task.QuartzTaskInfo - Task 'Cleanup service' [repository.cleanup] runNow2019-12-24 11:06:43,269+0200 INFO  [qtp1195943845-205] admin org.sonatype.nexus.quartz.internal.task.QuartzTaskInfo - Task 'Cleanup service' [repository.cleanup] state change WAITING -> RUNNING2019-12-24 11:06:43,343+0200 INFO  [quartz-3-thread-7] *SYSTEM org.sonatype.nexus.cleanup.internal.task.CleanupTask - Task log: /Users/aornatovskyy/nexus/nexus-internal/target/sonatype-work/nexus3/log/tasks/repository.cleanup-20191224110643332.log2019-12-24 11:07:32,779+0200 WARN  [quartz-3-thread-7] *SYSTEM org.sonatype.nexus.quartz.internal.task.QuartzTaskJob - Task 71acb02a-a375-46c4-93df-5365ec20dd25 : 'Cleanup service' [repository.cleanup] execution failurejava.lang.NullPointerException: null at org.sonatype.nexus.cleanup.internal.service.CleanupServiceImpl.findPolicies(CleanupServiceImpl.java:161) at org.sonatype.nexus.cleanup.internal.service.CleanupServiceImpl.cleanup(CleanupServiceImpl.java:102) at org.sonatype.nexus.cleanup.internal.service.CleanupServiceImpl.lambda$0(CleanupServiceImpl.java:92) at org.sonatype.nexus.cleanup.internal.service.CleanupServiceImpl$$Lambda$573.0000000000000000.accept(Unknown Source) at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:407) at org.sonatype.nexus.cleanup.internal.service.CleanupServiceImpl.cleanup(CleanupServiceImpl.java:90) 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.quartz.internal.QuartzThreadPool$$Lambda$568.0000000000000000.run(Unknown Source) 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:819)
      

        Attachments

          Activity

            People

            Assignee:
            aornatovskyy Anatoliy Ornatovskyy
            Reporter:
            aornatovskyy Anatoliy Ornatovskyy
            Last Updated By:
            Ophelia Hernandez
            Team:
            Original Nexus - Trinity - not for new tickets
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title