Issue with Cleanup Policies: Preview displays artifact but they are not cleaned when the cleanup task run

Hello,
I have an issue with Nexus Cleanup Policies. I can’t make it work properly. Maybe I’m missing something.

General information

  • Nexus version: Community 3.80.0-06
  • Saturated: No
  • Read-only: No
  • Database: H2
  • Blobstore type: File (> 50 GB free)

The issue, what I’ve done, what I expect, what is happening

I created a cleanup policy named raw_[REDACTED]. The policy (raw type) consist of cleaning artifact that are 7 days old, keep them if they have been downloaded last 7 days and there is also a regex enabled (3 criterion in total). When I preview it, I have artifacts that displays:


Then I enable the policy in the raw repository:

Then I run the “Admin - Cleanup repositories using their associated policies” task:

Then I check if the artifacts are cleaned:

What I see: artifacts are not deleted.
What I expect: artifacts are soft deleted, can’t be listed. Disk space is not reclaimed yet.

Troubleshooting done

1. Is the regex the issue?
I tried to remove the regex criterion and do all the steps above, the result is the same.

2. What does the logs says?
I can’t access to the log of the cleanup for an unknown reason. I guess the log is here:


I suppose that the log is not empty, UI reports 6 KB of data. When I click on it, the log is empty. When I try to download it I have a 404 error:

3. Is the other policy enabled on the repo is causing an issue?
I tried to disable the other policy and follow all the steps above, but the result is the same.

4. Any errors in Nexus logs?
I didn’t see any errors in Nexus logs.

5. What if I compact the blob storage or run other cleaning related tasks?
The result remains the same.

Thank you for reading! Hopping that there is a solution to make the policy work. This feature is crucial to keep the memory usage controlled.

Regards,
Anthony

1 Like

I have a very similar issue with this version of Nexus 3.80.

I can also see in the preview the assets that will be deleted, but after running the Cleanup Service task, the task log shows:

TASK org.sonatype.nexus.cleanup.internal.content.service.CleanupServiceImpl - 0 assets cleaned up for repository

It doesn’t find and delete them…

1 Like

I have a similar problem