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

DeadBlobFinder does not distinguish between a missing property, unexpected values or empty file

    Details

    • Type: Story
    • Status: Ready to Groom
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.12.0
    • Fix Version/s: None
    • Component/s: Logging, Support Tools
    • Labels:
    • Notability:
      3

      Description

      Blobstore files may corrupt in odd ways. What to do in order to recover can depend on what type of corruption is present. Support and customers can't make good decisions when lacking information about the type of corruption.

      Nexus includes a DeadBlobFinder class which examines blob files based on references in the component database.

      Corruption of blob properties can include a zero byte blob properties file or the properties file may exist but a property may not be present or have an invalid or unexpected value.

      How DeadBlobFinder handles these cases is not ideal.

      Example:

      Manually modify a valid blob properties file to be zero bytes. Run the DeadBlobFinder on the repository containing the file. Default logging may print a message like this:

      2018-06-05 12:12:49,441-0300 ERROR [quartz-6-thread-11] *SYSTEM org.sonatype.nexus.blobstore.file.FileBlobStore - Unable to load BlobAttributes for blob id: 2b5dcc37-e954-4a48-a682-0429b121bea5, path: /app/nexus-testing/3.12.0-01/nexus-installer-3.12.0-01-mac-archive/sonatype-work/nexus3/blobs/default/content/vol-27/chap-08/2b5dcc37-e954-4a48-a682-0429b121bea5.properties, exception: null

      The exception: null part is in question.

      Setting org.sonatype.nexus.blobstore.file.FileBlobStore to DEBUG reveals:

      2018-06-05 12:26:54,722-0300 ERROR [quartz-6-thread-13] *SYSTEM org.sonatype.nexus.blobstore.file.FileBlobStore - Unable to load BlobAttributes for blob id: 2b5dcc37-e954-4a48-a682-0429b121bea5, path: /app/nexus-testing/3.12.0-01/nexus-installer-3.12.0-01-mac-archive/sonatype-work/nexus3/blobs/default/content/vol-27/chap-08/2b5dcc37-e954-4a48-a682-0429b121bea5.properties, exception: null
      java.lang.NumberFormatException: null
      	at java.lang.Long.parseLong(Long.java:552)
      	at java.lang.Long.parseLong(Long.java:631)
      	at org.sonatype.nexus.blobstore.BlobAttributesSupport.readFrom(BlobAttributesSupport.java:114)
      	at org.sonatype.nexus.blobstore.file.FileBlobAttributes.load(FileBlobAttributes.java:58)
      	at org.sonatype.nexus.blobstore.file.FileBlobStore.getBlobAttributes(FileBlobStore.java:986)
      	at org.sonatype.nexus.blobstore.file.FileBlobStore.getFileBlobAttributes(FileBlobStore.java:1003)
      	at org.sonatype.nexus.blobstore.file.FileBlobStore.get(FileBlobStore.java:430)
      	at org.sonatype.nexus.blobstore.file.FileBlobStore$$EnhancerByGuice$$21941c37.CGLIB$get$2(<generated>)
      	at org.sonatype.nexus.blobstore.file.FileBlobStore$$EnhancerByGuice$$21941c37$$FastClassByGuice$$6f3ceee8.invoke(<generated>)
      

      Expected

      The following cases should be distinctly logged without requiring changing log levels:

      • blob properties file is zero bytes
      • named blob property did not exist and is expected
      • named blob property did not have the expected value type ( expose what value it did have instead )

      Consider adding to the ResultState enum list to make these distinctions in addition to improving log messages.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            plynch Peter Lynch
            Last Updated By:
            Dominik Kaspar Dominik Kaspar
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Date of First Response:

                tigCommentSecurity.panel-title