Step by Step Tutorial.Creating workflows with Windows Sharepoint Services and MOSS 2007(Part 17/20). Solving the infamous “Failed On Start (Retrying)”

 

 

image

 

 

Spending a lot a time (anwering) in the Sharepoint newsgroups, I’ve noticed the "Failed On Start" error is an extremely frequent question.This post will probably help many people.

When we start a (Custom) Sharepoint Workflow (but even sometimes Out of the Box workflows) the infamous Failed on start (retrying) error may hit you.The most common reasons of this error are:

1. in most cases the main reason is that the CodeBesideclass and the CodeBeside assembly in workflow.xml don’t match the workflow class name & assembly strong name  of the dll registered in the GAC  ("Unexpected Load Workflow Assembly: System.IO.FileNotFoundException: Could not load file or assembly xxxx") is what you will find in the Sharepoint log.

User Reflector the compare your assemblies strong name/class name & don’t forget the namespace!

2.the workflow-eventdelivery-throttle parameter is to low

To prevent web front ends (w3wp) from getting overrun by running too many workflows instances, there is a throttle limit. If more events than the throttle are already being processed, the newer events are enqueued as work items – they will be picked up by OWSTimer.

If your workflows don’t start immediately as expected you probably have to increase this throttle limit

stsadm -o setproperty -pn workflow-eventdelivery-throttle -pv "20"  (the default value is 15).

By Code :

SPWebApplication myWebApps = SPWebApplication.Lookup(new Uri(websiteUrl));
            myWebApps.WebService.WorkflowEventDeliveryThrottle = 20;
            myWebApps.WebService.Update();

It looks like in some situations” a Failed On Start” may be triggered and can be solved by increasing this value.

In some cases, I’ve noticed that increasing this value may solve a “Failed On Start” which indeed is very strange : when the W3P.exe is overrun, all actions (including event deliveries) are supposed the be enqueued (and thus executed later) but the OWSTIME.exe service.
The error message in the Sharepoint log looks like this:

Windows SharePoint Services     Workflow Infrastructure         936r    Verbose        RunWorkflow: No pending events – possibly targeted for async delivery

 

3.the transaction timeout value is too low can also generate a Failed on Start, specially when a lot of task (several hundreds) are created by the workflow which try to store the in a SQL Server transaction. the information you will find in the Sharepoint log file is soething like this

Workflow Infrastructure             72fg     High    Error in persisting workflow: System.Transactions.TransactionAbortedException: The transaction has aborted. —> System.TimeoutException: Transaction Timeout     — End of inner exception stack trace —     at System.Transactions.TransactionStateAborted.CreateAbortingClone(InternalTransaction tx).

One possible workaround is to increase the timeout value in the web.config file.  By default the value is set to 1 minute.  You can increase the value to 5 minutes for instance :

 

<configuration>

  <system.transactions>

    <defaultSettings timeout="00:05:00"/>

  </system.transactions>

</configuration>

 

4.repair of the .NET 3.0/.Net 3.5 Framework may be necessary. If you have SP1 for the .NET Framework installed, just go into the Control Panel/Add Remove Programs and click the Change button on Microsoft .NET Framework 3.0 SP1. If you don’t have the Service Pack you can install it. The Change process takes about 2 minutes.

5.A more exotic one : Workflow Foundation performance counters not loaded

Reload them again:  Lodctr "c:\Windows\Microsoft.Net\Framework\v3.0\Windows Workflow Foundation\perfcounters.ini"

Advertisements

2 responses to “Step by Step Tutorial.Creating workflows with Windows Sharepoint Services and MOSS 2007(Part 17/20). Solving the infamous “Failed On Start (Retrying)”

  1. Hello Sir,I have a question not relevant to this post but I didn\’t find any place to ask. Do you mind if I send question to your inbox?Ok the question is about the workflow you uploaded on codeplex "CollectFeedbackWorkflow" I just want to know about the form, more specifically I got almost everything but where these controls exist?"<%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="/_controltemplates/InputFormSection.ascx" %>"If you prefer not to reply here you can mail me on osamashah@msn.comThank you so much for the help

  2. hi osama,this is a standard ascx control provided with Sharepoint and can be found in C:\\Program Files\\Common Files\\Microsoft Shared\\web server extensions\\12\\TEMPLATE\\CONTROLTEMPLATES\\

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s