Can't stop deployment

Hello, I started a deployment hours ago and it has hung for some reason. I am trying to cancel it but it is stuck . The request says “Cancellation has been requested, attempting to stop the task”. It has been in this state for 4 hours. How can I kill this? there are many deployments happening on this server and rebooting is not practical

here is what I get in the task log

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
March 30th 2017 17:34:59Error
Unable to mark task ServerTasks-12229 as complete: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry) at System.Data.SqlClient.SqlConnection.Open() at Nevermore.Transient.RetryPolicy.<>c__DisplayClass26_0.<ExecuteAction>b__0() at Nevermore.Transient.RetryPolicy.ExecuteAction[TResult](Func1 func)
at Nevermore.RelationalTransaction…ctor(String connectionString, RetriableOperation retriableOperation, IsolationLevel isolationLevel, ISqlCommandFactory sqlCommandFactory, JsonSerializerSettings jsonSerializerSettings, RelationalMappings mappings, IKeyAllocator keyAllocator, IRelatedDocumentStore relatedDocumentStore)
at Nevermore.RelationalStore.BeginTransaction(RetriableOperation retriableOperation)
at Octopus.Server.Orchestration.RelationalTaskRunner.TaskComplete(String taskId, Exception error) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Server\Orchestration\RelationalTaskRunner.cs:line 106
at Octopus.Shared.Tasks.RunningTask.CompleteTask(Exception error) in Z:\buildAgent\workDir\eec88466c176b607\source\Octopus.Shared\Tasks\RunningTask.cs:line 154
ClientConnectionId:00000000-0000-0000-0000-000000000000
Error Number:-1,State:0,Class:20
Octopus.Server version 3.7.10 (3.7.10+Branch.master.Sha.3a9ac4c928883a98675d23f123728dc0a0f46155)

Hi,

I am sorry we didn’t get back to you sooner. As you can see from the logs it appears that when this task attempted to complete it had a problem connecting to the database. This not something we have seen before.

We do not have much more advice than wait until your deployments have finished and restart the service. It does appear that task did complete it couldn’t be marked as such. We realize this will mean you cannot deploy to the same environment the same project while in this state, but there will be no other way to get around the error.

Sorry I have no other trick up our sleeve solution for you. We would be interested in trying to figure out why this happened, so if after you have been able to restart you would like to send through your server logs that would be appreciated. A full deployment log would also assist.

Regards,
Vanessa

Hi Vanessa,

I restarted the Octopus service this morning and it killed the deployment. I dont know what database this was connecting to. I am only doing a web application deployment - there are no database projects getting deployed so this is very strange.

Hi,

It was the connection to the Octopus database itself. Potentially the connection to update that log was killed or delayed. I have not seen this reported. I do know that in a later version than 3.7 we extended the connection pool count and made some adjustments to holding connections which may resolve issues like this. I would suggest upgrading to the latest 3.11.x version if you have the opportunity.

Vanessa