Hi Paul - I managed to resolve this. I simply removed the hanging task from the ravendb UI. Not sure if this was the purest fix or not but seemed to do the trick for me.
I had this same issue and deleted the task that was causing the issue. But now I’m getting this error in the logs over and over:
Octopus.Platform.Documents.Persistence.ResourceNotFoundException: The resource ‘ServerTasks-1061’ was not found.
at Octopus.Platform.Documents.Persistence.SessionExtensions.LoadRequired[TModel](IDocumentSession session, String id) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Platform.Documents\Persistence\SessionExtensions.cs:line 45
at Octopus.Server.Orchestration.TaskController.Receive(TimeoutElapsedEvent timeout) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Orchestration\TaskController.cs:line 98
The error was continuously logged for at least 30 minutes. I ended up
resolving it by restoring from the latest backup. After restoring the DB
the tasks (Apply retention policies) that had been hanging were marked as
"Timed Out" and I stopped getting the errors.
Thanks for replying. I suppose I shouldn’t have manually deleted the tasked
from the RavenDB collection. Is there a better way of handling tasks that
are hanging? I tried restarting the service but that didn’t work.