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

Invalid content returned through proxy prevents valid content from being retreived

    XMLWordPrintable

    Details

    • Notability:
      3

      Description

      In a stock configuration of Nexus, retreive https://localhost:8081/repository/maven-central/ant/ant/maven-metadata.xml.

      Set up Charles Proxy as the http proxy for outbound requests.  Using a rewrite rule, make it so that requests to repo1.maven.org return invalid content with a 200 response.

      Invalidate cache on the maven-central repository.

      Request  https://localhost:8081/repository/maven-central/ant/ant/maven-metadata.xml again.

      Observe in the logs:

      2020-03-31 16:10:55,911-0500 WARN  [qtp2069272095-57] *UNKNOWN org.sonatype.nexus.repository.view.handlers.ExceptionHandler - Invalid content: GET /ant/ant/maven-metadata.xml: org.sonatype.nexus.repository.InvalidContentException: Metadata at path ant/ant/maven-metadata.xml is not a valid maven-metadata.xml
      

      But also observe... the content has been lost in Nexus Repo! See screenshot below.

      Expected: Invalid content should be served when valid content is available. The whole point of the file content validation feature is to prevent this from happening.

      Workaround: Check "Block outbound connections on the repository" in the proxy repository. This will allow previously cached content to be served.

        Attachments

          Activity

            People

            Assignee:
            aishchenko Artem Ishchenko
            Reporter:
            rseddon Rich Seddon
            Last Updated By:
            Wes Wannemacher
            Team:
            NXRM - Trinity
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title