Note: This article applies to Nexus Repository versions 3.3.0 to 3.6.0. The issue that causes this was fixed in version 3.6.1.
If you see the following error in the Nexus Repository logs when running the task "Purge unused docker manifests and images", then you have hit a bug where a docker blob has been misidentified as a manifest.
2017-07-05 06:06:35,729+0000 ERROR [quartz-1-thread-1] *SYSTEM org.sonatype.nexus.repository.docker.internal.DockerGCTask - Failed to run task 'Purge unused docker manifests and images' on repository 'Docker'
org.sonatype.nexus.repository.docker.internal.V2Exception$ManifestInvalid: manifest invalid
Below are the recovery steps:
- Shutdown Nexus Repository
- Make a backup of "sonatype-work/nexus3/db/component".
- Then open a command prompt and run:
java -jar <nrexus-install>/lib/support/nexus-orient-console.jar
- This will open a prompt. At that prompt execute the following commands (you may need to change depending on your sonatype work location):
connect plocal:sonatype-work/nexus3/db/component admin admin
update asset set attributes.docker.asset_kind='BLOB' where format='docker' and name like '%/blobs/%' and attributes.docker.asset_kind='MANIFEST'
exit
- This will convert this blobstore file back into an asset of type "BLOB" which is what is should be.
- After executing the above commands restart the server.