Yesterday we virtualized a physical machine hosting Octopus into a VM. The VM has been working fine and we have successfully deployed applications today. Out of nothing Octopus started throwing Primary key constraint errors all over the place.
My first impuls was to put Octopus in maintenance mode, so I could investigate the issue. Even this action failed with the following error:
Error while executing SQL command in transaction ‘MaintenanceConfigurationUpdateAction’: Violation of PRIMARY KEY constraint ‘PK_Event_Id’. Cannot insert duplicate key in object ‘dbo.Event’. The duplicate key value is (Events-143300). The statement has been terminated. The command being executed was: INSERT INTO [dbo].[Event] ([Id], [RelatedDocumentIds], [ProjectId], [EnvironmentId], [TenantId], [Category], [UserId], [Username], [Occurred], [UserAgent], [Message], [SpaceId], [ChangeDetails], [JSONBlob], [JSON]) VALUES (Id, RelatedDocumentIds, ProjectId, EnvironmentId, TenantId, Category, UserId, Username, Occurred, UserAgent, Message, SpaceId, ChangeDetails, JSONBlob, JSON) SQL Error 2627 - Violation of PRIMARY KEY constraint ‘PK_Event_Id’. Cannot insert duplicate key in object ‘dbo.Event’. The duplicate key value is (Events-143300). The statement has been terminated.
Please advise.
Kind regards,
Raymond