SharePoint 2013: Workflows failing on start


Recently I helped out a colleague with an issue in a load balanced SharePoint 2013 environment with Nintex Workflow 2013 on it. All the workflows that were started on WFE1 worked fine, but all started on WFE2 failed on start with the following issue logged to the SharePoint 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.InitializeImpl()

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..ctor(SPSite site, SPWeb web, SPWorkflowManager manager, SPWorkflowEngine engine) -

-- End of inner exception stack trace ---

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)

at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)

at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)

at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)

at Microsoft.SharePoint.Workflow.SPWorkflowManager.LoadPluggableClass(String classname, String assembly, Object[] parameters)

If you look up this issue you’ll find a lot of references to SharePoint 2007, but it seems that this is still possible in a SharePoint 2013 / Windows Server 2012 environment as well.

Cause

An incorrect registration of the Windows Workflow Foundation performance counters will cause this. You can easily verify this by opening up perfmon, adding a counter and looking for the category “Windows Workflow Foundation”.

perfmon - Add Counters

Solution

Register the performance counters on each affected server:

lodctr C:\Windows\Inf\Windows Workflow Foundation 3.0.0.0\perfcounters.ini

That restores the counters and will make your workflows start again!

 


Links to this post

Comments

Friday, 21 Nov 2014 06:06 by Sangeet Ahuja
Hi, How to verify "An incorrect registration" of wwf perf counter ? Thanks, Sangeet

Friday, 21 Nov 2014 06:25 by Sangeet Ahuja
Firsly, thanks!! Adding more info : we had to change your script slightly to get it working : In command prompt (run as admin) : lodctr "C:\Windows\Inf\Windows Workflow Foundation 4.0.0.0\perfcounters.ini" Why 4.0.0.0 ? Check : http://technet.microsoft.com/en-us/library/jj658588(v=office.15).aspx Our SP2013 Workflows were complaining.. which run on windows workflow foundation 4, therefore changed your script and it works for us.

Friday, 21 Nov 2014 07:46 by Steven Van de Craen
Hi Sangeet, Nintex Workflow 2013 uses the "classic" Workflow engine using .NET 3.5, while you are probably using the "new" Workflow Manager? I'm glad you fixed it though!!

CAPTCHA Image Validation