K2 Hostserver crashes with message: "Process is terminated due to StackOverflowException"
kbt147629
PRODUCTIssue
When a Workflow instance is started that executes a REST Endpoint SmartObject, the K2 Hostserver Service may crash. When restarting the K2 Hostserver Service, it will continue to crash every time on start-up.Symptoms
When the K2 Hostserver Service crashes, the following message will be logged in the Windows Event Viewer - Application Log:
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc00000fd
Fault offset: 0x00007ff7ae076aef
Faulting process id: 0x9bc
Faulting application start time: 0x01d3e8342551298b
Faulting application path: D:Program Files (x86)K2 blackpearlHost ServerBinK2HostServer.exe
Faulting module path: unknown
Report Id: 65d9a510-5427-11e8-80f9-005056012b1a
Faulting package full name:
Faulting package-relative application ID:
When starting the K2 Hostserver in Console mode, the following message will be displayed:
Shortly after, the K2 Hostserver Console will close.
Troubleshooting Steps
The issue appears to be caused by an exception that occurs in the external REST endpoint referenced by a SmartObject. This causes a StackOverflowException to occur in the SmartObject causing the K2 Hostserver to crash. Because the Workflow Instance was in a running state when the first crash occurs, each time the Hostserver starts up the Workflow instance will execute the SmartObject again causing another crash.
To recover the K2 Environment, the Process Instance will need to be disabled in the K2 Database to stop the SmartObject from being executed each time the Hostserver starts up.
To achieve this, direct Database modification will be required. Please log a K2 Support Ticket on the K2 Customer Portal for assistance in resolving the issue, referencing this KB Article.
To fully resolve this issue, the External REST service will need to be reviewed and rectified to ensure no exceptions occur in the Endpoint that can cause the issue to occur again.