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

FileBlobStore error handling makes it impossible to see what blob causes a runtime exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.1
    • Fix Version/s: 3.3.0
    • Component/s: Blobstore
    • Labels:
    • Story Points:
      1
    • Sprint:
      Sprint 91

      Description

      A user has a snapshot removal task failing due to a problem with a file in the blobstore:

      2017-03-03 09:48:39,170+0000 ERROR [quartz-1-thread-12] *SYSTEM org.sonatype.nexus.repository.maven.tasks.RemoveSnapshotsTask - Failed to run task 'Remove Maven snapshots from internal-snapshot-repositories' on repository 'internal-snapshot-repositories'
      java.lang.NumberFormatException: null
      at java.lang.Long.parseLong(Long.java:552) [na:1.8.0_112]
      at java.lang.Long.parseLong(Long.java:631) [na:1.8.0_112]
      at org.sonatype.nexus.blobstore.file.internal.BlobAttributes.readFrom(BlobAttributes.java:117) [na:na]
      at org.sonatype.nexus.blobstore.file.internal.BlobAttributes.load(BlobAttributes.java:98) [na:na]
      at org.sonatype.nexus.blobstore.file.internal.FileBlobStore.get(FileBlobStore.java:364) [na:na]
      at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39) [org.sonatype.nexus.common:3.2.1.01]
      at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:270) [org.sonatype.nexus.common:3.2.1.01]
      at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:53) [org.sonatype.nexus.common:3.2.1.01]
      at org.sonatype.nexus.repository.storage.BlobTx.get(BlobTx.java:129) [na:na]
      at org.sonatype.nexus.repository.storage.StorageTxImpl.getBlob(StorageTxImpl.java:738) [na:na]
      at org.sonatype.nexus.repository.storage.StorageTxImpl.requireBlob(StorageTxImpl.java:744) [na:na]
      at sun.reflect.GeneratedMethodAccessor248.invoke(Unknown Source) [na:na]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0_112]
      at java.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0_112]
      at org.sonatype.nexus.common.stateguard.SimpleMethodInvocation.proceed(SimpleMethodInvocation.java:53) [org.sonatype.nexus.common:3.2.1.01]
      
      

      There is a problem with the creation timestamp:

      https://github.com/sonatype/nexus-internal/blob/release-3.2.1-01/components/nexus-blobstore-file/src/main/java/org/sonatype/nexus/blobstore/file/internal/BlobAttributes.java#L117

      But we only catch IOException, so it is now impossible to see what blob caused this:

      https://github.com/sonatype/nexus-internal/blob/release-3.2.1-01/components/nexus-blobstore-file/src/main/java/org/sonatype/nexus/blobstore/file/internal/FileBlobStore.java#L378

      Is there a reason not to catch "Exception" there, and then wrap it up in "BlobStoreException"? We need see what blob caused the issue whenever any exception is thrown.

        Attachments

          Activity

            People

            Assignee:
            fmilens Frederick Milens
            Reporter:
            rseddon Rich Seddon
            Last Updated By:
            Peter Lynch
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title