Maven metadata.xml corruption
Summary
A customer encountered an issue with a corrupt maven-metadata.xml
file during a build. It was unclear on why or how the file became corrupted, so it would be challenging to attempt to reproduce. The intention of the issue is to document it to determine if others are experiencing similar issues and determine how it may have ended up in this state.
Error in the build for a project:
Could not read metadata /.m2/repository/path/to/file/maven-metadata-xx.xml: no more data available - expected end tags </lastUpdated></versioning></metadata> to close start tag <lastUpdated> from line 79 and start tag <versioning> from line 5 and start tag <metadata> from line 2, parser stopped on TEXT seen ...<lastUpdated>20240213044202</la... @79:36
Note the missing closing tag below:
104 <version>1.1.1-RELEASE</version>
105 <version>2.2.1-RELEASE</version>
106 <version>3.3.1-RELEASE</version>
107 <version>4.4.1-RELEASE</version>
108 <version>5.5.1-RELEASE</version>
109 </versions>
110 <lastUpdated>20240213044202</la
Steps to reproduce
No reproduction
Example Project
See ZD Ticket (Internal) for reference
What is the current bug behavior?
Corrupt Maven metadata files can prevent builds and proper usage of maven commands
What is the expected correct behavior?
Maven metadata files should not become corrupt or have a mechanism to regenerate under certain conditions.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com 16.10.0-pre 64f5301ea4f
Workarounds
Delete a relevant package from the package registry. This seemingly re-creates the metadata (sync_worker?)