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

Failing to return maven-metadata.xml from group repo after upgrade to 3.20.0 because group repo maven-metadata.xml is zero bytes


    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.20.0, 3.22.1, 3.27.0
    • Fix Version/s: None
    • Component/s: Maven
    • Story Points:
    • Notability:


      After upgrade to 3.20.0 (previous version was 3.19.01-1), builds were failing due to failure to get maven-metadata.xml. Reverting back to 3.19.0 resolved the issue.


      The issue is due to a group repo containing an zero byte size maven-metadata.xml file, which results in a 500 response. The two referenced hosted repos don't seem to contain any relevant data. It should return a 404 for this group request.


      2019-12-23 12:08:03,885+0000 WARN  [qtp1366113754-11224]  user1 org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: GET /repository/maven-public/com/xxxx/cloud/aws-config/1.1.1-SNAPSHOT/maven-metadata.xml

      java.io.EOFException: input contained no data

       at org.codehaus.plexus.util.xml.pull.MXParser.fillBuf(MXParser.java:3676)

       at org.codehaus.plexus.util.xml.pull.MXParser.more(MXParser.java:3732)

       at org.codehaus.plexus.util.xml.pull.MXParser.parseProlog(MXParser.java:1715)

       at org.codehaus.plexus.util.xml.pull.MXParser.nextImpl(MXParser.java:1698)

       at org.codehaus.plexus.util.xml.pull.MXParser.next(MXParser.java:1317)

       at org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader.read(MetadataXpp3Reader.java:913)

       at org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader.read(MetadataXpp3Reader.java:519)

       at org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader.read(MetadataXpp3Reader.java:548)

       at org.sonatype.nexus.repository.maven.internal.MavenModels.readMetadata(MavenModels.java:83)


      $ cat content/vol-14/chap-10/cea7383c-863f-4b42-9214-23ba7ef62a1d.properties
      #2019-09-14 19:12:16,357+0000
      #Sat Sep 14 19:12:16 UTC 2019



      Rebuilding the Maven Metadata doe not resolve the issue.

      Invalidating the cache on the group repository does not help.

      It is odd why it works in 3.19.0, but not in 3.20.0.


      There are 4 issues here.

      1) Storing a zero byte maven-metadata.xml file in a group repository ( or any repository) should not be allowed by NXRM. There is no valid use case for a zero byte maven-metadata.xml file ( do not conflate this to mean other zero byte assets are not allowed in hosted or proxy repos - there are valid exceptions to that). If for some reason, a zero-length maven-metadata.xml is found in a group repo, delete it and then rebuild it.

      2) If a user has explicitly invalidated the cache of the group repo, then that implicitly means the cache of all group member repos are also invalidated. The next inbound group repo request for a maven-metadata.xml should be returned a newly rebuilt maven-metadata.xml.

      3) Any time a group repo member maven-metadata.xml is rebuilt, this should also flag to the containing group repos of that repo that their corresponding maven-metadata.xml is now dirty and should incorporate the changes from this member.

      4) In NXRM 2, you could select a group repo when wanting to rebuild metadata. In NXRM 3, it is not possible to select a group repo when rebuilding metadata - consider why this feature is not available and if we need to this capability back. This could be a separate issue as we would like to avoid users automating rebuilding maven-metadata on lots of repos because it is a very expensive operation and not normally needed.



          Issue Links



              Unassigned Unassigned
              msurani Mahendra Surani
              Ralph Boerger
              Last Updated By:
              Dawid Sawa Dawid Sawa
              NXRM - Mad Max
              0 Vote for this issue
              7 Start watching this issue


                Date of First Response: