Cleanup tasks do not run as per the cleanup policy docs

1,088 views
Skip to first unread message

Nibedita Nanda

unread,
Feb 26, 2019, 7:30:05 AM2/26/19
to Nexus Users
Hi,

I am using Nexus 3.14.0-04. 

I have  followed the document https://help.sonatype.com/repomanager3/cleanup-policies#CleanupPolicies-CleanupTask and cleaned one clean up policy and 2 cleans up tasks.

As per my clean up policy, under the criteria, i have given 7 days and in the preview, i can see one image is falling into that catagory.
As per my understanding this will be marked for delete when i run the admin task "Delete unused manifests and images"

When i tried running the above Delete unused manifests and images task, it did not run. The status is still waiting.

If i check the log i can see this particular task is still waiting.

Another question: As per the document, when a user delete an image(docker image from the UI, that will be marked as delete, the actual deletion will happen only when admin runs the Delete unused manifests and images task.
Is that not true.  I tried deleting an image at UI and it got deleted immediately. so what is the need of "Delete unused manifests and images" task?

How the clean up policy and the clean up tasks are related? When user deleted an image form the UI(with a normal user), does that gets deleted permanently? As soon as i delete a component, i can not see that at the UI which means the image got deleted permanently? Somehow the mentioned  logic in the document  does not work here.

Also while performing some operation , i am getting  a pop up in red color " Operation failed system can not be contacted" .. What is the solution for this.




Nibedita Nanda

unread,
Feb 26, 2019, 10:50:10 AM2/26/19
to Nexus Users
Can somebody please go through the details let me understand how the cleanup policy and the tasks works wiht nexus 3.14.0-04? 

jt...@sonatype.com

unread,
Feb 26, 2019, 11:43:35 AM2/26/19
to Nexus Users
Hello,
The task is "Admin - Cleanup repositories using their associated policies" (per the doc link you provided). "Delete unused manifests and images" is not related to cleanup directly.
"Admin - Cleanup repositories using their associated policies" should run once a day automatically but if you manually run it it should delete everything in preview IF you've assigned the repository the policy you previewed.

As for docker, imagine you have the centos image and an image that uses the centos layers.  If you delete the centos image, the second image is still using the centos layers so those layers will not be deleted.  NXRM does not automatically know what images are using what layers and vice versa so the "Delete unused manifests and images" tasks scans for unused items and then marks them for deletion.  It is possible there may be nothing in this category (such as the above centos example) so it may do nothing.

However, what the document is trying to avoid is thinking people have reclaimed space when in fact there may be large items sitting around unused after the cleanup is run.  We recommend scheduling it to have a complete docker clean solution.
There is a ticket open to have this done automatically and reduce this complexity here: https://issues.sonatype.org/browse/NEXUS-18066

Nothing is finally(hard) deleted until a compact blobstore task is run. This is also detailed in the Cleanup documentation.
Until you do this everything is soft deleted (can be undeleted through modification of the blobs) intentionally in case items are removed errantly, regardless of what shows in the UI.


I hope that helps,
Joe
Reply all
Reply to author
Forward
0 new messages