# Nexus 3.74.0 Nuget Feed Cleanup Polices does not cleanup V3 index

**URL:** https://community.sonatype.com/t/nexus-3-74-0-nuget-feed-cleanup-polices-does-not-cleanup-v3-index/13897
**Category:** Sonatype Nexus Repository
**Created:** [November 21, 2024, 2:01pm UTC](https://community.sonatype.com/t/nexus-3-74-0-nuget-feed-cleanup-polices-does-not-cleanup-v3-index/13897 "2024-11-21T14:01:15Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![pLeX](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@pLeX](https://community.sonatype.com/u/pLeX)
#### Post date: [November 21, 2024, 2:01pm UTC](https://community.sonatype.com/t/nexus-3-74-0-nuget-feed-cleanup-polices-does-not-cleanup-v3-index/13897/1 "2024-11-21T14:01:15Z")

</div>

Hey guys,

we are working with nexus repository 3.74.0 and having several nuget v3 feeds. We enabled the cleanup policies for some test repositories and want to delete assets which are older than 10 days.

We hosting chocolatey packages on these feeds and when chocolatey is downloading a asset, its creating a /v3/registration//index.json.

When you deleting a asset from the nexus webgui, the index is automatically deleting too.

When you do this over the api with: Invoke-RestMethod -Uri “/repository///” -Method DELETE -Headers @{“Authorization”=“Basic $cred”}

The index will also be deleted correctly.

When you using the cleanup policy, it will delete the asset but not the index.

Is someone else experience the same behaviour?

regards

---

<div class="post-metadata">

### Author: ![mpiggott](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mpiggott](https://community.sonatype.com/u/mpiggott)
#### Post date: [November 21, 2024, 4:23pm UTC](https://community.sonatype.com/t/nexus-3-74-0-nuget-feed-cleanup-polices-does-not-cleanup-v3-index/13897/2 "2024-11-21T16:23:55Z")

</div>

It sounds like you may have a misconfigured repository, there should only be a single `index.json` in a Nuget proxy repository in Nexus.

With a NuGet v3 proxy repository the URL used should be to the `index.json` (e.g. for the NuGet gallery it would be [https://api.nuget.org/v3/index.json](https://api.nuget.org/v3/index.json) ).

Generally speaking however, the Cleanup feature in Nexus is built around what we call Components which is nominally coordinates or the identifier for one or more assets. With a nuget v3 repository the index.json file isn’t associated with a Component and is not considered as part of cleanup.

---

<div class="post-metadata">

### Author: ![pLeX](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@pLeX](https://community.sonatype.com/u/pLeX)
#### Post date: [November 22, 2024, 7:41am UTC](https://community.sonatype.com/t/nexus-3-74-0-nuget-feed-cleanup-polices-does-not-cleanup-v3-index/13897/3 "2024-11-22T07:41:00Z")

</div>

Hi Matthew,

thanks for your reply. Sorry I was not specified enough… We using nuget (hosted) repositories not proxy.

The files under /v3/registration/(assets)/index.json will be created when a chocolatey agent is downloading the asset.

I dunno if there is a difference between proxy and hosted for the v3 index, but what I can say, is that the index will be cleaned/delete when you deleting the asset from the web gui or from the api, but not from a cleanup task.

It looks to me like a bug, but when you say its generally will not be touched from a cleanup policy, then the cleanup policies is unusable for nuget v3 feeds, because it breaks the search/download mechanism for clients. In my case the chocolatey agent is searching and trying to download packages which not existing. In my opinion it should work in the same way when you deleting from web gui or the api.

---

<div class="post-metadata">

### Author: ![mpiggott](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mpiggott](https://community.sonatype.com/u/mpiggott)
#### Post date: [November 22, 2024, 8:40pm UTC](https://community.sonatype.com/t/nexus-3-74-0-nuget-feed-cleanup-polices-does-not-cleanup-v3-index/13897/4 "2024-11-22T20:40:06Z")

</div>

This still sounds like some sort of misconfiguration, I haven’t looked at NuGet in some time but I believe the only index.json should be at the root of the repository and managed by Nexus. If you take a look at the previous link for the contents this is a service reference file which defines patterns for URLs to access various services on the server.

Is there a chance you’ve configured a raw repository, or something aside from nuget v3?

---

<div class="post-metadata">

### Author: ![pLeX](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@pLeX](https://community.sonatype.com/u/pLeX)
#### Post date: [November 25, 2024, 8:17am UTC](https://community.sonatype.com/t/nexus-3-74-0-nuget-feed-cleanup-polices-does-not-cleanup-v3-index/13897/5 "2024-11-25T08:17:19Z")

</div>

Hi Matthew,  
no im sorry, a raw repository is not supported from chocolatey. I dunno see a misconfiguration here. Again… when you deleting from the web gui, its working… When the cleanup policy is used, its not working. Maybe my wording is the problem 😃 Microsoft decscribes that as the “registration page” for nuget v3 specification:  
[Package Metadata, NuGet API | Microsoft Learn](https://learn.microsoft.com/en-us/nuget/api/registration-base-url-resource)

For better understanding I recorded a video to demonstrate the issue:

![Animation](https://canada1.discourse-cdn.com/flex047/uploads/communitysonatype/original/2X/4/4227f462cdd42a8f92483733a81d32a0dfce3919.gif)

---

<div class="post-metadata">

### Author: ![mpiggott](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mpiggott](https://community.sonatype.com/u/mpiggott)
#### Post date: [November 25, 2024, 4:25pm UTC](https://community.sonatype.com/t/nexus-3-74-0-nuget-feed-cleanup-polices-does-not-cleanup-v3-index/13897/6 "2024-11-25T16:25:48Z")

</div>

Hi Alexander,

Thanks for the video - I hadn’t interacted with the metadata shown here before. After checking the contents it does appear that this metadata ought to be removed when there are no packages with that particular `packageId` remaining.

If you wouldn’t mind reporting it as a bug: [Issues · sonatype/nexus-public · GitHub](https://github.com/sonatype/nexus-public/issues)

---

<div class="post-metadata">

### Author: ![pLeX](https://avatars.discourse-cdn.com/v4/letter/p/f475e1/32.png) [@pLeX](https://community.sonatype.com/u/pLeX)
#### Post date: [November 27, 2024, 10:08am UTC](https://community.sonatype.com/t/nexus-3-74-0-nuget-feed-cleanup-polices-does-not-cleanup-v3-index/13897/7 "2024-11-27T10:08:51Z")

</div>

Thanks Matthew,

I opened and issue: [Nexus 3.74.0 Nuget (hosted) Feed Cleanup Policies does not cleanup V3 registration page · Issue #530 · sonatype/nexus-public](https://github.com/sonatype/nexus-public/issues/530)
