Hi John,
Thanks for getting in touch! I’m very sorry for the delay in getting back to you here.
Are you still experiencing this issue?
We have had a small number of reports from older versions of Octopus where a task can occasionally become stuck while cancelling.
The fix for the stuck task generally requires manually updating the SQL entry to force the change in Octopus from Cancelling
to Canceled
.
If you are still running into this problem, below are the steps you can take to resolve it:
1. Backup Database.
Before you make any Database changes at all, please ensure you have a fresh backup of the Octopus database and your master key.
Documentation for this step.
2. Identify stuck task ID
The first thing you will need to do after you have backed up your Database and master key is to identify the Task-ID of the task. This can be found in the URL of the task itself, for example if you click on the task and look in the URI bar you should see something similar to:
http://octopus_server/app#/tasks/ServerTasks-836
The task ID is the last segment of the URI, so ServerTasks-836
in my test case.
3. Query the task in SQL
With the Task-ID identified, we can then perform an SQL query to identify that we have the correct task before we make any changes. Run the following query against your Octopus database:
SELECT *
FROM [OctopusDeploy].[dbo].[ServerTask]
WHERE Id = 'ServerTasks-836'
Confirm that the task we are querying is correct before we edit it. (The state should be Cancelling
.)
3. Update the task in SQL
Once you have performed the above steps and confirmed that you have the correct task, the next step is to manually update the task’s state to Canceled
by running the following:
UPDATE [OctopusDeploy].[dbo].[ServerTask]
SET [State] = 'Canceled'
WHERE Id = 'ServerTasks-836'
Done! When you return to the Octopus portal the previously stuck task should now be Canceled
.
Let me know if this helps or if you have any questions at all here. And again, sorry for the delay in getting back to you.
Best regards,
Daniel