Hello,
I was going through active and cancelling tasks after a failure, and noticed that we have a very old job that was stuck as “Active” but marked with "Cancellation of the task timeout. Clicking the cancel button does not do anything. I’ve tried restarting octopus deploy services on the server and tentacle to no avail. I was hoping there was a SQL Script that could be run to manually set that job to a canceled state or to remove it from the list of active tasks?
That doesn’t seem to work - I think that servertask is missing/corrupted in the db, because when I query the database directly it can’t find it.
Additionally when going through the UI it seems to indicate that the associated server task is missing?
OK, could you query the DeploymentHistory table for the Id of your ‘stuck’ deployment. This should show you the current state the DB thinks it’s in, and you could then update the record to be Canceled.
That didn’t work so I had our DBA take a look since that record was missing. It looks like we just had to do a query by description, and update the servertasks table for the record that was stuck in a cancelling state.