Error In Starting Task Queue

Getting the following error message and tasks are not running:

2020-01-10 14:59:34.9194 6076 13 FATAL An error occured starting the Task Queue. Tasks will not be processed until the server is restarted.
System.Exception: ‘’ is not a valid document Id. It should have the format ‘-’. Example: ‘Projects-101’.
at Octopus.Core.Resources.DocumentIdParser.AssertValidDocumentId(String documentId) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Core\Resources\DocumentIdParser.cs:line 31
at Octopus.Core.Model.Events.EventBuilder.AppendReference(String displayText, String documentId) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Core\Model\Events\EventBuilder.cs:line 37
at Octopus.Core.Model.Clustering.OctopusClusterService.FailRunningTasksForMissingNodes() in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Core\Model\Clustering\OctopusClusterService.cs:line 305
at Octopus.Server.Orchestration.TaskQueue.TaskQueue.PollForMoreWorkOnBackgroundThread(Object state) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Orchestration\TaskQueue\TaskQueue.cs:line 93

I’ve restarted the server serveral times. This error always occurs. We’ve recently upgraded from an older version of OD to 2019.9.12. Looking at the task tab we have one task for Check Tentacle healty that says it started 3 years ago and should have finished 1,087 days ago. I’ve tried cancelling manually but it just seems hung. All other tasks seem to be stuck behind this one.

Hi Stephen,

Thanks for getting in touch! This issue has been raised a couple of times in the past and I believe our best current approach is to try and manually remove the problematic task from the database.

Whilst the resolution should work without issue, it is always worth taking a fresh database backup before making any manual changes. :slight_smile:

The first step after backing up your Octopus database is to identify the Task-ID we need to edit. You can find this in the URL when viewing the stuck health check task in the portal.

Example: OctopusServer/app#/Spaces-1/tasks/ServerTasks-244388?activeTab=taskSummary

Once you have your Task-ID, you can confirm that it’s the troublesome task in the database with the following:

SELECT * FROM dbo.ServerTask Where Id LIKE 'ServerTasks-244388'

When you have confirmed that you have the correct Task-ID, you can run the following command to attempt to change the status to Canceled.

UPDATE dbo.ServerTask
SET State ='Canceled'
WHERE Id = 'ServerTasks-244388'

Manually setting the task to Canceled should hopefully resolve this issue.

Let me know how you go here, if doing this does not help resolve the issue, please let me know. :slight_smile:

Looking forward to hearing from you.

Best regards,

Thanks Daniel. I was able to find the offending task and setting it to cancelled did indeed solve our issue.

Hi Stephen,

Thanks for the update! I’m glad to hear this has resolved the issue. :slight_smile:

Please don’t hesitate to get in touch at any time.

Best regards,