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

Snapshot remover deletes GAV level maven-metadata.xml files, resulting in 404 responses

    XMLWordPrintable

    Details

      Description

      Reproduce steps.... 

      Publish 4 timestamped snapshots to the same GAV into a hosted maven snapshot repository using Maven. Then ran a snapshot remover task against that repository with minimum count 2, and retention days 0.

      The GAV maven-metadata.xml file is removed. The GA level file is not removed.

      Attempting to access the file with either HEAD or GET requests results in a 404 response.

      $ curl --head http://localhost:8081/repository/maven-snapshots/com/group/binaries/some-project/1.0-SNAPSHOT/maven-metadata.xml
      HTTP/1.1 404 com/group/binaries/some-project/1.0-SNAPSHOT/maven-metadata.xml
      Server: Nexus/3.26.0-04 (PRO)
      X-Content-Type-Options: nosniff
      Content-Security-Policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
      X-XSS-Protection: 1; mode=block
      Cache-Control: no-cache, no-store, max-age=0, must-revalidate, post-check=0, pre-check=0
      Pragma: no-cache
      Expires: 0
      X-Frame-Options: DENY
      Content-Type: text/html
      Content-Length: 1948
      

      This causes subsequent builds that are trying to retrieve the snapshot to fail.

      Retrieving the GA level maven-metadata.xml file triggers a rebuild, and the GAV level file is available afterwards.

      It seems to me the bug here is that the GAV level file is removed? It should be left in place and marked as needing rebuild. This is what happens to the GA level file.

      This is a regression introduced in 3.25.1

        Attachments

        1. bug-2020-08-21_12.42.17.mkv
          674 kB
          Michael Bucher

          Activity

            People

            Assignee:
            mbucher Michael Bucher
            Reporter:
            rseddon Rich Seddon
            Last Updated By:
            Rich Seddon
            Team:
            NXRM - Operations/Groot
            Votes:
            5 Vote for this issue
            Watchers:
            12 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title