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

4 Likes

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…

3 Likes

I have a similar problem

1 Like

Hello,

the same for our instance. It does not work with Nexus OSS 3.80.0.

2 Likes

Still the same problem with 3.81.0.

2 Likes

Same, with Nexus OSS 3.80.0.

1 Like

We are encountering the same issue. It is really annoying to us because we have a large test matrix that creates a lot of Docker images. At first, we could make the Virtual Disk bigger, but we are running very low. We are considering to downgrade, but we are not sure if this will break stuff.

1 Like

Hi folks,

let’s bring a bit of data to the party. I am, like you, also affected and the issue can be traced back to the update to 3.80.0.

So here’s a diff of 3.79.1…3.80.0.

As one can see, there are indeed several changes to files related to the cleanup and, it seems, also regex-functionality.

I’m not qualified to judge those changes, but it is a data point that Sonatype might wanna consider.

Cheers
Thomas

The day we started to ship arm64 images, we also upgraded. So at first I thought this was related.

I also had this problem after upgrading to 3.80.

I downgraded to 3.79 but lost all data because these have been migrated already to 3.80 and cannot be read by 3.79.

I created a github issue here: Cleanup task does not clean anymore since 3.80 · Issue #672 · sonatype/nexus-public · GitHub

Hi.

We are facing the same issue as well with version 3.81.1.
Cleanup policies are not respected anymore. For example, cleanup of components last downloaded more than 7 days ago does not work anymore and we need to manually cleanup such components.
Any udpate on the issue from Sonatype is really appreciated.

Thanks,
Yakir

Hi, all! Our team is aware of some issue(s) with cleanup policies not targeting components correctly. They’re being actively investigated due to the potential for disruption in our users’ workflows.

I’ll share updates on the issue as they’re made available to me.

Hi, all,

We’ve identified solutions to a number of issues that were affecting cleanup policies. Fixes will be included as part of release 3.83.0.

1 Like

Hello @jzora,
Thank you for keeping us updated on the subject !
I’ll wait for the new version.
Thank you.
Regards.