Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 3.22.0
-
Fix Version/s: 3.23.0
-
Component/s: Repository
-
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.