Workflow "Failed on Start (retrying)"

Oh!! its SharePoint again :). One of these small things in this beast which makes you bang your head and pull your hear again and again if you don't get it right. Now lucky you you can search this issue and find the solution.

Debugging in SharePoint is very tricky sometimes because you get all of these levels to run around (GAC + IIS + Deployment Folder under the feature + Feature.xml + Workflow.xml + SharePoint itself + InfoPath the main form template + InfoPath the workflow forms and  Web Services) so after this, it is not strange that you would start pulling your hear after a while.

Problem Description:

if you try any workflow (including OOB WF and Custom WF) and when you try to start it, it will show the message Workflow "Failed on Start (retrying)". You may also see that some tasks in the WF are created and even so it fails.

Tip: whenever you are stuck with your custom workflow, try having the OOB, if it doesn't run, its not your problem. (i spent one complete day almost 20H just to discover its not my fault).

One Proof that this thing its not your custom code problem, if you attach the WF process to Visual Studio, it will not catch any exception.

Reasoning:

In WSS/MOSS the workflow engine will report back 'a workflow failed to start' even if the workflow did start.

The reason why is that - the workflow will be sent the 'OnWorkflowActivated' event (start command) and essentially as far as MOSS is concerned - it's starting.

When the workflow for e.g. writes a task item and then waits (handleExternal Event) for the OnTaskChanged event. At this point if it failed - a different error other than 'failed to start' would be reported.

Resolution:

  • First and importantly check all your correlation tokens. make sure that each task (Creation, Updating and Completing) has its own Token not the workflow token.
  • Then compare the dll you have with theone in the workflow.xml and the one in the GAC. simply they all should be the same.
  • Try this on the command prompt: Lodctr "c:\Windows\Microsoft.Net\Framework\v3.0\Windows Workflow Foundation\perfcounters.ini"
  • And if it doesn't work for you try: Lodctr /R "c:\Windows\Microsoft.Net\Framework\v3.0\Windows Workflow Foundation\perfcounters.ini"

Some Links might Help:

https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2268844&SiteID=1

Some errors you might see in logs:

  • The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.
  • Failed on Start (retrying).
  • Unexpected 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.DefaultWorkflowSchedulerService.OnStarted() at System.Workflow.Runtime.Hosting.WorkflowRuntimeService.HandleStarted(Object source, WorkflowRuntimeEventArgs e) at System.EventHandler`1.Invoke(Object sender, TEventArgs e)...
    01/11/2008 03:33:24.79* w3wp.exe (0x12B4) 0x0E9C Windows SharePoint Services Workflow Infrastructure
  • Unexpected    ...     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._InvokeConstructor(Object[] args, SignatureStruct& signature, IntPtr declaringType)     at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType)     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)     at System.Ac...    
    01/11/2008 03:33:24.79*    w3wp.exe (0x12B4)                           0x0E9C    Windows SharePoint Services       Workflow Infrastructure           72fu    Unexpected    ...tivator.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)    
    01/11/2008 03:33:24.80     w3wp.exe (0x12B4)                           0x0E9C    Windows SharePoint Services       Workflow Infrastructure

Comments

  • Anonymous
    January 10, 2008
    PingBack from http://geeklectures.info/2008/01/10/workflow-failed-on-start-retrying/

  • Anonymous
    January 10, 2008
    PingBack from http://msdnrss.thecoderblogs.com/2008/01/10/workflow-failed-on-start-retrying-4/

  • Anonymous
    January 11, 2008
    Am experiencing the problem "Failed on start (retrying)" The only thing different is m getting this "System.ArgumentException: Value does not fall within the expected range." when I peek into log. Surprisingly, even after getting this error, my workflow continues to work and tasks are being created and completed as per my code. I just wanna get rid of this irritating "Failed.." Here, you are talking about performance counters. What I am experiencing a little differenct. Thanks in advance. Here is log -> 72fs Unexpected RunWorkflow: System.ArgumentException: Value does not fall within the expected range.     at Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties..ctor(SPWorkflow workflow, Int32 runAsUserId, String associationData, String initiationData)     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.MakeActivation(SPWorkflow workflow, SPWorkflowEvent e)     at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(Guid trackingId, SPWorkflowHostService host, SPWorkflow workflow, Collection1 events, TimeSpan timeOut)     at Microsoft.SharePoint.Workflow.SPWorkflowManager.RunWorkflowElev(SPWorkflow originalWorkflow, SPWorkflow workflow, Collection1 events, SPRunWorkflowOptions runOptions) -Prudhvi

  • Anonymous
    April 24, 2008
    The comment has been removed

  • Anonymous
    June 27, 2008
    what your idea about this exception in log AutoStart Workflow: System.ArgumentException: New instances of this workflow template are currently disallowed.     at Microsoft.SharePoint.Workflow.SPWorkflowManager.StartWorkflowElev(SPListItem item, SPFile file, SPWorkflowAssociation association, SPWorkflowEvent startEvent, Boolean bAutoStart, Boolean bCreateOnly) please help me as soon as posible mek027@yahoo.com tanks in advance

  • Anonymous
    September 04, 2008
    Hi, i receive the error "Failed on Start (retrying)" but only with some documents for another documents the same workflow start normally. The documents that present the error i terminate and start manually and continue receiving the error, wich is the solution for this scenario. I can't reasociate the workflow with the document library because the another instances of the workflow your status is waiting for approval and are much documents executing the workflow actually.

  • Anonymous
    September 27, 2008
    The comment has been removed

  • Anonymous
    December 25, 2008
    Fantastic solution !!! It worked great when I changed the Correlation Token value to be unique. Thanks!!!

  • Anonymous
    December 25, 2008
    Varadarajan , am glad it worked for you

  • Anonymous
    January 06, 2009
    This has been a issue for Us for Months... I Can not get this resolved can ANYOne Help?? Thanks jill.willman@sagepub.com

  • Anonymous
    February 12, 2009
    You made my day....this point helped friend.. "Then compare the dll you have with theone in the workflow.xml and the one in the GAC. simply they all should be the same. "

  • Anonymous
    March 30, 2009
    I'm having the the same problem but i can't figure out anything from the log - this is what im getting : 03/31/2009 13:20:10.34 w3wp.exe (0x0ECC)                       0x0F90 Windows SharePoint Services   Workflow Infrastructure       936l High     Engine RunWorkflow: System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.  File name: 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'     at System.ModuleHandle.ResolveType(Int32 typeToken, RuntimeTypeHandle* typeInstArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInstCount)     at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)     at System.Reflection.Module.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)  ... 03/31/2009 13:20:10.34* w3wp.exe (0x0ECC)                       0x0F90 Windows SharePoint Services   Workflow Infrastructure       936l High     ...   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, Module decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, RuntimeMethodHandle& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)     at System.Reflection.CustomAttribute.GetCustomAttributes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)     at System.Reflection.CustomAttribute.GetCustomAttributes(Assembly assembly, RuntimeType caType)     at System.Reflection.Assembly.GetCustomAttributes(Boolean inherit... 03/31/2009 13:20:10.34* w3wp.exe (0x0ECC)                       0x0F90 Windows SharePoint Services   Workflow Infrastructure       936l High     ...)     at System.Workflow.Activities.Rules.RuleValidation.<LoadExtensionAttributeType>b__0(Assembly a)     at System.Array.ForEach[T](T[] array, Action1 action) &nbsp; &nbsp; at System.Workflow.Activities.Rules.RuleValidation.LoadExtensionAttributeType(Boolean loadAttributes) &nbsp; &nbsp; at System.Workflow.Activities.Rules.RuleValidation..ctor(Activity activity, ITypeProvider typeProvider, Boolean checkStaticType) &nbsp; &nbsp; at System.Workflow.Activities.Rules.RuleConditionReferenceValidator.Validate(ValidationManager manager, Object obj) &nbsp; &nbsp; at System.Workflow.ComponentModel.Compiler.ValidationHelpers.ValidateObject(ValidationManager manager, Object obj) &nbsp; &nbsp; at System.Workflow.ComponentModel.Compiler.DependencyObjectValidator.ValidateDependencyProperty(DependencyObject dependencyObject, DependencyProperty depende... 03/31/2009 13:20:10.34* w3wp.exe (0x0ECC) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0F90 Windows SharePoint Services &nbsp; Workflow Infrastructure &nbsp; &nbsp; &nbsp; 936l High &nbsp; &nbsp; ...ncyProperty, ValidationManager manager) &nbsp; &nbsp; at System.Workflow.ComponentModel.Compiler.DependencyObjectValidator.Validate(ValidationManager manager, Object obj) &nbsp; &nbsp; at System.Workflow.ComponentModel.Compiler.ActivityValidator.Validate(ValidationManager manager, Object obj) &nbsp; &nbsp; at System.Workflow.ComponentModel.Compiler.CompositeActivityValidator.Validate(ValidationManager manager, Object obj) &nbsp; &nbsp; at System.Workflow.Activities.IfElseBranchValidator.Validate(ValidationManager manager, Object obj) &nbsp; &nbsp; at System.Workflow.ComponentModel.Compiler.ValidationHelpers.ValidateObject(ValidationManager manager, Object obj) &nbsp; &nbsp; at System.Workflow.ComponentModel.Compiler.ValidationHelpers.ValidateActivity(ValidationManager manager, Activity activity) &nbsp; &nbsp; at System.Workflow.ComponentModel.Compiler.Compos... 03/31/2009 13:20:10.34* w3wp.exe (0x0ECC) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0F90 Windows SharePoint Services &nbsp; Workflow Infrastructure &nbsp; &nbsp; &nbsp; 936l High &nbsp; &nbsp; ...iteActivityValidator.Validate(ValidationManager manager, Object obj) &nbsp; &nbsp; at System.Workflow.Activities.IfElseValidator.Validate(ValidationManager manager, Object obj) &nbsp; &nbsp; at System.Workflow.ComponentModel.Compiler.ValidationHelpers.ValidateObject(ValidationManager manager, Object obj) &nbsp; &nbsp; at System.Workflow.ComponentModel.Compiler.ValidationHelpers.ValidateActivity(ValidationManager manager, Activity activity) &nbsp; &nbsp; at System.Workflow.ComponentModel.Compiler.CompositeActivityValidator.Validate(ValidationManager manager, Object obj) &nbsp; &nbsp; at System.Workflow.Runtime.WorkflowDefinitionDispenser.ValidateDefinition(Activity root, Boolean isNewType, ITypeProvider typeProvider) &nbsp; &nbsp; at System.Workflow.Runtime.WorkflowDefinitionDispenser.LoadRootActivity(Type workflowType, Boolean createDefinition, Boo... 03/31/2009 13:20:10.34* w3wp.exe (0x0ECC) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0F90 Windows SharePoint Services &nbsp; Workflow Infrastructure &nbsp; &nbsp; &nbsp; 936l High &nbsp; &nbsp; ...lean initForRuntime) &nbsp; &nbsp; at System.Workflow.Runtime.WorkflowDefinitionDispenser.GetRootActivity(Type workflowType, Boolean createNew, Boolean initForRuntime) &nbsp; &nbsp; at System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance) &nbsp; &nbsp; at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext context, WorkflowInstance workflowInstance) &nbsp; &nbsp; at System.Workflow.Runtime.WorkflowRuntime.GetWorkflowExecutor(Guid instanceId, CreationContext context) &nbsp; &nbsp; at System.Workflow.Runtime.WorkflowRuntime.InternalCreateWorkflow(CreationContext context, Guid instanceId) &nbsp; &nbsp; at System.Workflow.Runtime.WorkflowRuntime.CreateWorkflow(Type workflowType, Dictionary2 namedArgumentValues, Guid instanceI... 03/31/2009 13:20:10.34* w3wp.exe (0x0ECC)                       0x0F90 Windows SharePoint Services   Workflow Infrastructure       936l High     ...d)     at Microsoft.SharePoint.Workflow.SPWinOeHostServices.Send(SPWinOeWorkflow winoeworkflow, SPWorkflowEvent e)     at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(Guid trackingId, SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut)     any ideas ?

  • Anonymous
    April 07, 2009
    This site have solve my problem. It talks about different url due to layout changes. http://connectionstringexamples.com/article.php?story=Sharepoint-error-System-Argument

  • Anonymous
    July 07, 2009
    •Try this on the command prompt: Lodctr "c:WindowsMicrosoft.NetFrameworkv3.0Windows Workflow Foundationperfcounters.ini" worked for me. you are a life saver. Thanks alot.

  • Anonymous
    August 20, 2009
    I was also receiving Failed on start (retrying) for all workflows, ootb and spd. I did repair on .net framework from add/remove programs and that didn't work, i then did Lodctr /R "c:WindowsMicrosoft.NetFrameworkv3.0Windows Workflow Foundationperfcounters.ini" and that didn't work. Finally checked perfmon and saw the wwf was not part of ojects list. I tried again, but this time using  Lodctr "c:WindowsMicrosoft.NetFrameworkv3.0Windows Workflow Foundationperfcounters.ini"  and that FINALLY worked for me. Drop down list object appeared and all registry entries were there. Now no more failed on start errors. thanks again!!!!

  • Anonymous
    September 15, 2009
    I have the same error, but the file perfcounters.ini is not even in the informed path. Any info help be really appreciated.

  • Anonymous
    September 15, 2009
    Denise Moura, did you ensure you have 3.5SP1?

  • Anonymous
    September 22, 2009
    The way I resolved that issues was by removing all the commented out activity. I also replace the token. Possibly one of the commented out activity had some incorrect token.

  • Anonymous
    November 13, 2009
    Thanks to Anil's Commments above...After wasting 10 hours...i finally found the remedy!

  • Anonymous
    November 17, 2009
    Can you help i have followed the information carolina used however when i run the locdir command without the R there is the following reponse C:>Lodctr "c:WindowsMicrosoft.NetFrameworkv3.0Windows Workflow Foundation perfcounters.ini" Unable to find initialization file c:WindowsMicrosoft.NetFrameworkv3.0Windo ws Workflow Foundationperfcounters.ini however with the R it says it was able to succesfully rebuild he performance conter. what am i doing wrong????

  • Anonymous
    October 19, 2010
    I had the same problem and also tried the above solution. Eventually i found out that my problem was something else. The error "Failed on start" will also be a result of changing the App Pool identity without changing the service account i Central Admin. That solved my problem and I thought I'd post it here as well. Read more here: intellisoft.wordpress.com/.../sharepoint-2007-workflow-failed-on-start-retrying

  • Anonymous
    March 15, 2011
    Since this is still relevent with SharePoint 2010... I got a Failed on Start (retrying) message because I was not requiring one of my Lookup fields in my InfoPath form. Once I made this a required field (technically, I 1. disabled my Submit button if the Lookup was blank and 2. added N/A to the Lookup list and autopopulated the Lookup for an "N/A" condition) I no longer got this error.