Duplicate release problem

Hi,

After upgrading to v2.4… form 1.6, one particular project reported lots of ‘duplicates’ when performing the migration.

Now when ever i create a release, it throws the following error:

‘Invalid version string -dup0.2450 Parameter name: version’

The migration ahs prefixed an old release with this -dup prefix but now it won;t even let me create a new release,

Help!

Thanks,

Lee

Hi Lee - sorry about this, we’ve got an import bug that can result in invalid version strings. I’ve created a ticket for the original issue, but this won’t fix the already invalid data in your database.

The “very quick” fix, depending on the number of duplicate releases, might be to open impacted documents in RavenDB (http://localhost:10931 on the Octopus server) and manually change them to valid (1.2.3-abc) release numbers.

I’ll start work now on a script using the API to fix these and update you via this thread once it is ready.

Regards,
Nick

Hi Lee,

I’ve created a simple script to find broken release numbers and “fix” them by generating new unique numbers. The corrupted release number is written into the release notes so that you can identify the original release if needed.

So that you can tweak it as required, I’ve uploaded it as a gist: https://gist.github.com/nblumhardt/d6e388728750d0bc18b4

Instructions for use are:

  1. Ensure you have an up-to-date backup of your Octopus server, and a copy of the master encryption key in a safe place
  2. Create a new .NET console application in Visual Studio
  3. Replace the contents of Program.cs with the code from the gist
  4. Paste in an API key and URL for your Octopus server
  5. Install the Octopus.Client NuGet package
  6. Run!

Not knowing the full range of release numbers affected, I can’t reliably massage them back into a semblance of the original number; you might have a better idea for how to generate the new release numbers given the data, if so let me know and I’ll be happy to help. Currently just aiming to do the quickest thing possible to get you back up and deploying happily.

Hope this helps, apologies again for the inconvenience. Any questions or trouble with it please let me know.

All the best,
Nick

Hi,

Many thanks for the quick resposne. I will try this out later this afternoon.

Thanks,

Lee