-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 3.19.1
-
Fix Version/s: 3.22.0
-
Component/s: Scheduled Tasks
-
Labels:
-
Notability:2
The reconcile task does not clean up bad blob references from the component database.
Reproduce steps:
- Fire up a new 3.19.1 instance of Nexus Repo
- Create a hosted raw repository
- Upload a file to the new raw repository
- Locate the blob files created (.properties and .bytes) and delete them
- Attempt to download the file
Observe that this fails with an error:
Caused by: org.sonatype.nexus.repository.storage.MissingBlobException: Blob default@099C9170-A540438F-65654D48-26A4A334-497D5032:901b2a8c-891c-4d15-8aef-8cceb867846a exists in metadata, but is missing from the blobstore
at org.sonatype.nexus.repository.storage.StorageTxImpl.requireBlob(StorageTxImpl.java:931)
at sun.reflect.GeneratedMethodAccessor245.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonatype.nexus.common.stateguard.SimpleMethodInvocation.proceed(SimpleMethodInvocation.java:53)
at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:272)
at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:53)
at org.sonatype.nexus.common.stateguard.StateGuardAspect$1.invoke(StateGuardAspect.java:63)
at com.sun.proxy.$Proxy217.requireBlob(Unknown Source)
at org.sonatype.nexus.repository.raw.internal.RawContentFacetImpl.get(RawContentFacetImpl.java:94)
at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:56)
... 116 common frames omitted
Now schedule and run a "repair - econcile component database from blob store" to run against the blob store. The task will find the bad database reference:
2019-12-04 12:02:42,151-0600 ERROR [quartz-3-thread-3] *SYSTEM org.sonatype.nexus.blobstore.restore.DefaultIntegrityCheckStrategy - Blob properties missing for asset 'foo/bar/NOTICE.txt'.
But after it completes, subsequent download attempts of the file will still fail with a missing blob error.
Expected: The reconcile task should find (and remove) component database references that point to blob files that no longer exist on disk. In the above test, the subsequent failure should have been a simple 404, not a 500 with a missing blob error.