Unable to Create Release: An item with the same key has already been added

I’ve just added a new project to Octopus Deploy and when I try and create the first release I get the error “An item with the same key has already been added”

All our other projects still work and I’ve run a health check on only Environment and single tentacle assigned to the project.

Bit more info.
Someone else in the team created a couple of releases and deleted them before the error started to appear.

I’ve changed the release number manually to something else on the Project settings page but that didn’t fix the problem.

Hi Rich,

Thanks for getting in touch! Sorry about the troubles. Currently in Octopus, when you delete something from the UI it is marked as deleted and a task is run to then delete the data. If this task fails, you will end up with your scenario.
If you could go through the tasks to find the failed or timed out deletion task, and run it again you should get those keys released and be able to use them again.

Hope that helps!

Thanks for the update.

I found the three delete tasks for the old releases all were marked as successful, I re-ran then and it completed saying no document found.

Sadly I still get the same error.

Hi Rich,

Before we do something dangerous, can you do a Raven Repair from your Octopus Manager in case this is caused by indexes.

Let me now how that goes, if it doesn’t, we can have a look in the db itself.

It looks like it was something to do with how we scoped the variables as when we removed all options in the scope for all variables the error went away. Clearly we made a mistake somewhere.