We’re using Sonatype Nexus Repository ManagerOSS 3.30.1-01 with an s3 blobstore and 3 npm repos (hosted, proxy and group) configured with this blobstore,
I see a lot of objects in s3 bucket with a tag deleted=true, but we have no any Cleanup policy or Tasks,
and for “proxy” repo “Maximum component age” is -1,
so my question is -
when nexus decides to delete blobs, and which blobs, if nothing configured to do so ?
Hi Alexey. Nexus Repository will never decide to delete a blob on its own. To remove blobs of components that were soft deleted (no longer present in any repository, but blobs still present on disk) you have to run an Admin - Compact blob store task.
No. Invalidate cache will make Nexus Repository to check for any changes to already stored content at remote repository next time a client will request them. Without doing that, once Nexus Repository has downloaded some content, it will not check for changes on remote repository until its cache expires. You can control the values for that in your repository settings. You can learn more about storage management from our guide: A Primer for Storage Management in Nexus Repository 3 - Sonatype Guides
When files in repositories are updated with newer vesrsions it will cause the old versions of these to be deleted. For instance, when a maven-metadata.xml file is uploaded during artifact deploy the old one will be deleted. This will give you blobs in deleted state.
Thank you, Rich, for the answer,
I’m just truing to understand from where it comes.
I have “Disable redeploy” on the hosted repo and -1 “Maximum component age” on the proxy repos (save cache forever), on the remote repos versions are almost always immutable (http://registry.npmjs.org/), and I have no any “Cleanup Policy” configured…
When I delete an artifact from the UI, it is usually marked as a soft delete. However, I don’t see this information either in my external PostgreSQL database or in the artifact’s property file blob. As of now, the blob file should always exist, but when I run the “compact Blob store” task to hard delete the artifact, the blob file is not deleted. Additionally, when I run the “reconcile component from database” task to verify, the artifact I removed is still there. I am using Nexus OSS 3.78.1 and deploying with Docker.
There are also tasks called Admin - Cleanup unused asset blobs these mark blobs as deleted and must run before compact. The unused asset blob tasks won’t mark blobs as deleted until they’re older than 30-minutes (iirc) as a safety precaution.
The thing I forgot to mention is that I’m trying to delete artifacts from a PROXY repository. It might seem unusual, but I’m working with Windows container images, which are very large (5–15 GB per image). When I delete artifacts from a HOSTED repository, they are completely removed after running the “Compact blob store” task. I can then confirm that they are no longer present by running the “Reconcile component database from blob store” task, and verifying that the artifacts no longer appear in the UI.