Hello
We seemed to have hit another problem while re-deploying a release to the same environment (and same machines):
We’re running Octopus 3.0.10.2278 version with DB located outside the octopus server.
Error while executing SQL command: Violation of PRIMARY KEY constraint ‘PK_ServerTask_Id’. Cannot insert duplicate key in object ‘dbo.ServerTask’. The duplicate key value is (ServerTasks-914).
The statement has been terminated.
The command being executed was:
INSERT INTO dbo.[ServerTask] (Name, Description, QueueTime, StartTime, CompletedTime, ErrorMessage, ConcurrencyTag, State, HasPendingInterruptions, HasWarningsOrErrors, ServerNode, ProjectId, EnvironmentId, Id, Json) values (@Name, @Description, @QueueTime, @StartTime, @CompletedTime, @ErrorMessage, @ConcurrencyTag, @State, @HasPendingInterruptions, @HasWarningsOrErrors, @ServerNode, @ProjectId, @EnvironmentId, @Id, @Json)
System.Exception: Error while executing SQL command: Violation of PRIMARY KEY constraint ‘PK_ServerTask_Id’. Cannot insert duplicate key in object ‘dbo.ServerTask’. The duplicate key value is (ServerTasks-914).
The statement has been terminated.
The command being executed was:
INSERT INTO dbo.[ServerTask] (Name, Description, QueueTime, StartTime, CompletedTime, ErrorMessage, ConcurrencyTag, State, HasPendingInterruptions, HasWarningsOrErrors, ServerNode, ProjectId, EnvironmentId, Id, Json) values (@Name, @Description, @QueueTime, @StartTime, @CompletedTime, @ErrorMessage, @ConcurrencyTag, @State, @HasPendingInterruptions, @HasWarningsOrErrors, @ServerNode, @ProjectId, @EnvironmentId, @Id, @Json) —> System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint ‘PK_ServerTask_Id’. Cannot insert duplicate key in object ‘dbo.ServerTask’. The duplicate key value is (ServerTasks-914).
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource
1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Octopus.Core.RelationalStorage.RelationalTransaction.Insert[TDocument](String tableName, TDocument instance, String customAssignedId) in y:\work\refs\heads\master\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 127 --- End of inner exception stack trace --- at Octopus.Core.RelationalStorage.RelationalTransaction.Insert[TDocument](String tableName, TDocument instance, String customAssignedId) in y:\work\refs\heads\master\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 133 at Octopus.Core.RelationalStorage.RelationalTransaction.Insert[TDocument](TDocument instance) in y:\work\refs\heads\master\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 87 at Octopus.Server.Orchestration.Deploy.DeploymentFactory.CreateDeployment(IRelationalTransaction transaction, ICommunicationsConfiguration communications, IWebPortalConfiguration webPortalConfiguration, Deployment deployment, User user, DateTimeOffset queueTime, ILifecycleProgressionEvaluator lifecycleProgressionEvaluator, Func
2 promptedVariableProvider) in y:\work\refs\heads\master\source\Octopus.Server\Orchestration\Deploy\DeploymentFactory.cs:line 186
at Octopus.Server.Web.Api.Actions.DeploymentCreateAction.Execute() in y:\work\refs\heads\master\source\Octopus.Server\Web\Api\Actions\DeploymentCreateAction.cs:line 90
at Octopus.Server.Web.Infrastructure.Api.Responder1.Respond(TDescriptor options, NancyContext context) in y:\work\refs\heads\master\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 162 at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at CallSite.Target(Closure , CallSite , Object , Object , NancyContext ) at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass5.<.ctor>b__2(Object o) in y:\work\refs\heads\master\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 46 at CallSite.Target(Closure , CallSite , Func
2 , Object )
at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)
Can we get any feedback on this ? Is this a current version issue?
Thanks,
Andrzej