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

NoSuchFileException from Reconcile task when it checks files under <blobstore>/content/tmp/

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.40.1
    • Fix Version/s: None
    • Component/s: Scheduled Tasks
    • Labels:
    • Notability:
      3

      Description

      ISSUE:

      Running the "Repair - Reconcile component database from blob store" task fails with the following ERROR in the task log:

      2022-07-20 11:21:17,151-0500 ERROR [quartz-15-thread-3]  *SYSTEM org.sonatype.nexus.blobstore.restore.datastore.RestoreMetadataTask - Failed to run task 'Uses blobs in a blobstore to restore assets to a repository'
      java.io.UncheckedIOException: java.nio.file.NoSuchFileException: /opt/sonatype/sonatype-work/nexus3/blobs/default/content/tmp/tmp$ac1d220d-9c2f-42fe-856a-597c885477b0.properties
              at java.nio.file.FileTreeIterator.fetchNextIfNeeded(FileTreeIterator.java:88)
              at java.nio.file.FileTreeIterator.hasNext(FileTreeIterator.java:104)
              at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1811)
              at java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(StreamSpliterators.java:294)
              at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(StreamSpliterators.java:206)
              at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:161)
              at java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:300)
              at java.util.Spliterators$1Adapter.hasNext(Spliterators.java:681)
              at org.sonatype.nexus.blobstore.restore.datastore.RestoreMetadataTask.restore(RestoreMetadataTask.java:149)
              at org.sonatype.nexus.blobstore.restore.datastore.RestoreMetadataTask.execute(RestoreMetadataTask.java:119)
              at org.sonatype.nexus.blobstore.restore.datastore.RestoreMetadataTask.execute(RestoreMetadataTask.java:1)
              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)
      Caused by: java.nio.file.NoSuchFileException: /opt/sonatype/sonatype-work/nexus3/blobs/default/content/tmp/tmp$ac1d220d-9c2f-42fe-856a-597c885477b0.properties
              at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
              at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
              at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
              at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
              at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
              at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
              at java.nio.file.Files.readAttributes(Files.java:1737)
              at java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:225)
              at java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
              at java.nio.file.FileTreeWalker.next(FileTreeWalker.java:372)
              at java.nio.file.FileTreeIterator.fetchNextIfNeeded(FileTreeIterator.java:84)
              ... 23 common frames omitted
      2022-07-20 11:21:17,152-0500 INFO  [quartz-15-thread-3]  *SYSTEM org.sonatype.nexus.blobstore.restore.datastore.RestoreMetadataTask - Task complete
      

      EXPECTED BEHAVIOUR:

      • Reconcile task should not fail because one file caused NoSuchFileException.
        • Log the full file and filepath that is missing and continue
        • Note this should happen for any exception
      • When sinceDays = 1, Reconcile task should not check "tmp" (and "directpath"), or should check only "vol*" to make task faster.

      REPRODUCE STEPS:

      No repro steps available as this would be some race condition (hard to reproduce).

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            hosako Hajime Osako
            Last Updated By:
            Michael Oliverio Michael Oliverio
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                tigCommentSecurity.panel-title