andrew.beals@nintex.com

The infamous "failed to run" errors in the history list.

Blog Post created by andrew.beals@nintex.com Support on Aug 28, 2015

Symptoms

 

You may have seen following error "[workflow name] failed to run" in the workflow history list of your workflow. The strangest part being the workflow runs successfully despite the errors displayed. This generally happens when the workflow enters a "dehydrated" or "paused" state.

051012_1935_pausedworkf1.png

Upon reviewing the ULS logs for this workflow you may find the following messages:

 

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.

 

Cause

 

Farm Topology:

Service Applications 05.png-700x0.png

 

When a workflow has been queued for resumption and the Application server with the “Microsoft SharePoint Foundation Workflow Timer Service” tries to resume the workflow, it fails to run due to not having the “Microsoft SharePoint Foundation Web Application” service enabled. This error occurs because the Workflow Timer Service tries to read the workflow settings from the web.config or configuration database for the web application. By default, the workflow settings are stored in the web.config file of the server that is running the “Microsoft SharePoint Foundation Web Application” service.

 

When running workflows 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. The script can be found below in the Microsoft recommended solution.

 

Resolution

 

We recommend stopping/starting the services on the servers in your farm that should/should not be running them. In order to avoid Nintex licensing errors we recommend you review you Nintex Workflow License and ensure your farm topology matches your license and adjust your services accordingly. To assist you with this process please refer to and follow this article: Workflows and the SharePoint services required to run them.

 

Microsoft recommends the following to resolve these "Failed to run" errors:

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.

(Source: https://support.microsoft.com/en-us/kb/2674684)

 

Please note: the “Microsoft SharePoint Foundation Web Application” service provides web server functionality. Starting or stopping this service will deploy/remove files from the C:\inetpub\wwwroot\ directory. Please perform this action at your own discretion.

Outcomes