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

Downloading missing blob does not automatically re-fetch from remote

    Details

      Description

      SYMPTOM:

      After migrating to NewDB (PostgreSQL or H2), trying to download some asset via proxy repository returns 500, and nexus.log shows "Attempt to access soft-deleted blob" and "MissingBlobException" like below:

      2022-08-30 12:53:58,952+1000 WARN  [qtp1548620246-103] *UNKNOWN org.sonatype.nexus.blobstore.file.FileBlobStore - Attempt to access soft-deleted blob f49953c3-a76d-467d-997e-c8ed71f3352c attributes: /Users/hosako/Documents/tests/nxrm-3.38.0_3.41.0/nexus-3.41.0/sonatype-work/nexus3/blobs/default/content/vol-20/chap-36/f49953c3-a76d-467d-997e-c8ed71f3352c.properties {deleted=true, @BlobStore.created-by=admin, creationTime=1661477012627, @BlobStore.created-by-ip=127.0.0.1, @BlobStore.content-type=application/java-archive, sha1=2973d150c0dc1fefe998f834810d68f278ea58ec, @BlobStore.blob-name=/junit/junit/4.12/junit-4.12.jar, @Bucket.repo-name=maven-central, size=314932}
      2022-08-30 12:53:59,143+1000 WARN  [qtp1548620246-103] *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: GET /repository/maven-central/junit/junit/4.12/junit-4.12.jar
      org.sonatype.nexus.repository.MissingBlobException: Blob default@0fe44557-c71d2261-aa97e2d5-6cb8b933-746aafb8:f49953c3-a76d-467d-997e-c8ed71f3352c exists in metadata, but is missing from the blobstore
      	at org.sonatype.nexus.repository.content.fluent.internal.FluentAssetImpl.download(FluentAssetImpl.java:173)
      	at java.util.Optional.map(Optional.java:215)
      	at org.sonatype.nexus.content.maven.internal.recipe.MavenContentFacetImpl.get(MavenContentFacetImpl.java:209)
      	at org.sonatype.nexus.content.maven.internal.recipe.MavenProxyFacet.getCachedContent(MavenProxyFacet.java:88)
      	at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.maybeGetCachedContent(ProxyFacetSupport.java:413)
      	at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.get(ProxyFacetSupport.java:271)
      ...
      

      REPRODUCE STEPS:

      1. Install Nexus 3.41.0 with H2 or PostgreSQL.
      2. Download some asset (eg: /repository/maven-central/junit/junit/4.12/junit-4.12.jar)
      3. Find above blob's properties file from the blob store by using the BlobID in the Blob Reference
      4. Append "deleted=true" in this .properties file
      5. Download junit-4.12.jar again => immediate 500
      6. Remove or rename this .properties file
      7. Download junit-4.12.jar again => immediate 500

      EXPECTED BEHAVIOUR:

      As per NEXUS-12388, Nexus should automatically try re-fetching the missing asset, rather than returning 500.

      POTENTIAL CAUSE:

      It seems the code is expecting "RetryDeniedException" but FluentAsset::download seems to throw "MissingBlobException" when blob is null.

      Technical Notes

      We should also consider if we can simply fix the issue rather than re-download the blob. Try doing a migration as well as following the reproduce steps. The migration probably generates a different cause for the same 500 error.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              hosako Hajime Osako
              Last Updated By:
              Leonardo Ruiz Leonardo Ruiz
              Team:
              NXRM - Neo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response:

                  tigCommentSecurity.panel-title