SharePoint Workflow Manager service constantly restarting - InvalidCastException

Brass Contributor

We recently started encountering an issue with the Microsoft Workflow Manager. Every few minutes the Workflow Manager service will crash and restart. We have 3 hosts to manage 2013 workflows in our SharePoint 2016 environment. Workflows in the environment continue to work, but sometimes delayed or unavailable.

 

We went ahead and upgraded to the SharePoint workflow manager that was released this year (2023) as the Microsoft one has been deprecated, still with 3 nodes in the farm. We are still encountering the same issue. All that is recorded in the event viewer is "Failed Service Bus Operation: System.InvalidCastException: Specified cast is not valid." Which is then followed by "Application: Microsoft.Workflow.ServiceHost.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception." And after a moment or two, the Workflow Service comes back online.

 

My best guess is that there is an offending workflow that is trying to cast an incompatible value? I can't seem to find it though, and I find it odd that it crashes the workflow service and there is no further information on what workflow or where to look to fix it. Nothing in the SPLogfiles that jumps out either. 

 

Here are the screenshots from the Event Viewer:

 

redamaleki_1-1680827378354.png  redamaleki_2-1680827481805.png  

redamaleki_3-1680827653485.png

 

 

 

3 Replies

Hi @redamaleki,

am curious to know the procedure you followed to migrate the classic WFM to SPWFM, if it’s by database backup and restore method , is this supported case ? , and what’s the behaviour of  existing workflow instances after migrating to SPWFM, do we have to restart all instances through any scripts ?

We're experiencing the exact same problem in our environment at the moment. Workflows have been down for pretty much 8 days, and Microsoft Support has not been fruitful (getting one email a day from them).

You would be a hero if you could share what you did to rectify your issue.
Did you get this resolved? It took us months to get someone on Microsoft's end of premium support (Software Assurance no longer cover SharePoint Server for support). I can describe what they had us do, but the error was specific to a workflow that was removed from the management front end, but that was still trying to execute in the backend. I can elaborate further, but it will be a bit of a write up.