Writing an interesting troubleshooting post in Sharepoint area, We have encountered the below error while executing workflows on the SharePoint
Workflow Failed on Start (retrying)
On checking further in ULS logs :
Load Workflow Class: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.InvalidOperationException: The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly. at System.Diagnostics.PerformanceCounter.Initialize() at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, Boolean readOnly) at System.Workflow.Runtime.PerformanceCounterManager.CreateCounters(String name) at System.Workflow.Runtime.Hosting.ManualWorkflowSchedulerService.OnStarted() at System.EventHandler`1.Invoke(Object sender, TEventArgs e) at System.Workflow.Runtime.WorkflowRuntime.StartRuntime() at Microsoft.SharePoint.Workflow.SPWinOeHostServices….
We have found that problematic sharepoint farm servers are missing Windows Workflow Foundation counter
Server with correct counters , see below:
We have followed the solutions mentioned on the Internet
Lodctr “c:\Windows\Microsoft.Net\Framework\v3.0\Windows Workflow Foundation\perfcounters.ini”
Lodctr /R “c:\Windows\Microsoft.Net\Framework\v3.0\Windows Workflow Foundation\perfcounters.ini”
Note: – we found percounters.ini at path C:\Windows\Microsoft.Net\Framework\v4.0.30319
Please change the path as per your environment.
Our issue was still persisting with same error.
Next step was to export the below registry keys from the working server & importing it on non working server.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Windows Workflow Foundation 184.108.40.206]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Windows Workflow Foundation 220.127.116.11]
After that we ran the above command again
Lodctr /R “C:\Windows\Microsoft.Net\Framework\v4.0.30319\perfcounters.ini”
This has resolved the issue partially, missing counters appeared in perfmon & workflow started working after retrying.
Again, we searched for the ULS logs & this time we found the real culprit.
Nintex workflow error was being encountered, Team has uninstalled the Nintex from this farm but there were steps that were missing.
On following the missing steps mentioned in the below article, issue got resolved.
Removing the Nintex Workflow Database
- Open Microsoft SQL Server Management Studio and delete the associated Nintex Workflow database(s).
Removing entries from the Web.Config
- On the server’s file system, navigate to the folder hosting the web application (by default “C:\inetpub\wwwroot\wss\virtualdirectories\80”).
- Open web.config with Notepad.
- Verify there is no reference to “Nintex.Workflow”. If there are any, delete them.
- Use stsadm.exe to run this command to remove farm properties added by Nintex Workflow:
stsadm.exe –o setproperty –pn “NintexWorkflowServer2010License” –pv “”
- Use stsadm.exe to run this command:
stsadm.exe –o setproperty –pn “NW2007ConfigurationDatabase” –pv “”
Note: The reference to the NW2007ConfigurationDatabase is correct.
- You should also remove the following libraries and lists :