Cleanup deleted repositories - Sonatype Nexus Repository - Sonatype Community

Cleanup deleted repositories

post by jhonny.oliveira on May 18, 2021

Hi!

As part of our housekeeping activities, I have recently removed several repositories from Nexus (maven proxy). However, I have noticed that they are still around and consuming space. From the query I ran, I can see that the repos have been marked for deletion:

I already ran “Compact blob store”, unfortunately, it does not seem to make any difference.

Is there a way to clean-up this space?

Thank you!


post by este.nombre.esta.disponible on May 21, 2021

Hi,

I’m having the very same issue. Is there any way to remove repositories that are marked as “pending deletion”?

Kind regards.


post by mpiggott on May 21, 2021

Generally speaking there is a task that runs periodically in the background - nexus-public/StorageFacetCleanupTaskManager.java at master · sonatype/nexus-public · GitHub

If it’s not running the quartz trigger is probably broken. You could (while nexus is stopped) connect to the database and remove that task which Nexus will re-create on startup.


post by jhonny.oliveira on May 21, 2021

Thank you @mpiggott for the information provided so far!

Can you please be a little bit more specific on the steps required to solve the issue? Can’t we do it via the WebUI?

Cheers!


post by mpiggott on May 28, 2021

I had some time and made a change to remove and recreate the task on startup which should be in 3.31 which I believe will fix the issue.


post by jhonny.oliveira on May 28, 2021

Looking forward for the upgrade.

Thank you!


post by pogacnik on Oct 21, 2024

I have same problem, after removing proxy repo, data was not removed.

Will any of these tasks clean some disk (I don’t want to reboot nexus)?


post by sebastien_picavet on Nov 26, 2024

Compact blob tasks are needed to claim the free space. First task must be done.


post by pogacnik on Nov 28, 2024

When you create “compact blob store” you have to set the repository, but what if you delete the entire repository, which task should I run to delete data from deleted repository?


post by sebastien_picavet on Nov 28, 2024

Repository != blob

Deleting a repository is not deleting the blob store.

If you have also deleted the blob store, files are staying in NEXUS_DIR/sonatype-work/nexus3/blobs. I have never tested, but in that case, I think you can also delete the directory (just rename it to be sure at the first time).