Issues icon indicating copy to clipboard operation
Issues copied to clipboard

Release creation fails with `Cannot insert duplicate key` error

Open droyad opened this issue 6 months ago • 0 comments

When creating a release, the following error occurs (in part):

Violation of PRIMARY KEY constraint 'PK_VariableSet_Id'. Cannot insert duplicate key in object 'dbo.VariableSet'. 

When a release is created, the system snapshots any variables that have changed. It uses an ID convention that appends the version number and a random 5 characters to the ID.

Normally this is ok as the version number should be monotonically incrementing. However there are a number of situations where the version number is not incremented, or we pull out an older snapshot for comparison.

The 5 characters give a possible 45 million combinations, which means that once there are 45,000 snapshots, there ia a 1 in 1,000 chance of a clash.

Workaround

Create the release again

droyad avatar Jun 12 '25 02:06 droyad