Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

SharePoint 2010: Workflow fails to run after pause


View products that this article applies to.

Symptoms

SharePoint 2010 Workflow fails to run after pause and workflow status shows "In progress". If you click on it to go to the Workflow Status page, workflow history area shows "workflow failed to run." in latest item's Description.

Consider the following scenario:

A SharePoint 2010 farm has a Web Front End Server with the “Microsoft SharePoint Foundation Web Application” service running and a separate Application Server with the “Microsoft SharePoint Foundation Workflow Timer Service” running (The server does not have the Web Application service running).  

A workflow has been queued for resumption and the Application server with the Workflow Timer Service tries to resume the workflow but fails.

In this scenario the application server fails to resume the Workflow timer service and the workflow gets stuck in "In progress" status. The Workflow History list shows "workflow failed to run." message.

Additionally, the ULS log entries on the SharePoint server may include the following:

OWSTIMER.EXE (0x0E5C) 0x2184 SharePoint Foundation Workflow Infrastructure 72fu Unexpected Load Workflow Class: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.SharePoint.Workflow.SPWinOeHostServices.EnsurePluggableServices(SPSite site, SPWorkflowExternalDataExchangeServiceCollection services, ExternalDataExchangeService existingServices) at Microsoft.SharePoint.Workflow.SPWinOeHostServices..ctor(SPSite site, SPWeb web, SPWorkflowManager manager, SPWorkflowEngine engine)

OWSTIMER.EXE (0x0E5C) 0x2184 SharePoint Foundation Workflow Infrastructure 98d8 Unexpected System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.SharePoint.Workflow.SPWinOeHostServices.EnsurePluggableServices(SPSite site, SPWorkflowExternalDataExchangeServiceCollection services, ExternalDataExchangeService existingServices) at Microsoft.SharePoint.Workflow.SPWinOeHostServices..ctor(SPSite site, SPWeb web, SPWorkflowManager manager, SPWorkflowEngine engine)

OWSTIMER.EXE (0x0D64) 0x0E98 SharePoint Foundation Workflow Infrastructure frg9 Medium Workflow could not be run because SPWebApplication.UpdateWorkflowConfigurationSettings was not previously called, and the Web Application service has been disabled on this server. Call UpdateWorkflowConfigurationSettings or turn on the Web Application service for this server.

↑ Back to the top


Cause

The Workflow Timer Service tries to read the workflow batchsize settings from the web.config or configuration database for a web application. By default, the batchsize setting is in the web.config file if the server is running the Web Application service. 

If the Web Application service is not running on the same server and the script in Method 1 (under the 'Resolution' section) has not been run, the batchsize setting is neither in the web.config file nor in the configuration database, then the operation fails.

↑ Back to the top


Resolution

Method 1:

Locate one Web Front End server which has Web Application service running, run the following PowerShell command to copy workflow-related configuration from the web.config to the configuration database so it will be available from every server in the Farm. 

• $webapp = Get-SPWebApplication -identity http://<web app name>
• $webapp.UpdateWorkflowConfigurationSettings()

Method 2:

Start the Web Application Service on all servers that have the Workflow Timer Service running.

Method 3:

Disable the Workflow Timer Service on servers that are not running the Web Application service.

 

↑ Back to the top


More Information

A SharePoint workflow is put in a “dehydrated” state when a pause occurs or gets postponed due to the WorkflowPostponeThreshold.  SharePoint 2010 uses a queuing system to control workflow-related stress on farm resources and the content database. By using this system, when the number of workflows executing against a database reaches an administrator-configured threshold, successive workflow operations are added to the queue to be run by the Workflow Timer service. By default, this service receives a batch of workflow work items every minute.

Several farm administrator settings, directly and indirectly related to the queuing mechanism, affect the performance and scaling for workflow. The following sections describe what these settings do and how to adjust them to meet performance requirements.

  • Workflow Postpone Threshold (Set-SPFarmConfig –WorkflowPostponeThreshold <integer>)

The maximum number of workflows that can execute against a single content database before additional requests and operations are queued. Queued workflows show a status of Starting. This is a farm-wide setting that has a default value of 15. This represents the number of workflow operations that are being processed at a time, not the maximum number of workflows that can be in progress. As workflow operations are completed, successive operations will be able to run.

  • Workflow Event Delivery Batch Size (Set-SPWorkflow –BatchSize <integer>)

The Workflow Timer service is an exception to the postpone threshold limit and will retrieve batches of items from the queue and execute them one at a time. These batches can be larger than the postpone threshold. The number of work items that the service receives per run is set by using the BatchSize property. The BatchSize property can be set one time per Web Application service instance. The default value is 100.
When running on application servers that are not configured to be front-end servers, the Workflow Timer service requires workflow configuration settings in Web.config to be set in the configuration database. This must be done through a script that calls UpdateWorkflowConfigurationSettings() on the SPWebApplication object, which will copy the Web.config settings from a front-end server.

See the following link for more information

Estimate performance and capacity planning for workflow in SharePoint Server 2010

↑ Back to the top


Keywords: kb

↑ Back to the top

Article Info
Article ID : 2674684
Revision : 2
Created on : 11/3/2017
Published on : 11/3/2017
Exists online : False
Views : 1344