Sharepoint – WorkFlow Timer Job Paused


On a random daily check on CA we found workflow timer job in “Paused” state in Central Admin. Multiple of these pointing to each server in farm in paused state. Many blog posts pointing to restarting the timer service on each server and also clearing the timer cache (configuration cache) would resolve the issue.

http://www.sharepointsiren.com/2013/05/sharepoint-timer-job-stuckpaused-fix.html

http://markimarta.com/sharepoint/paused-workflows-in-sharepoint-timer-job-fix/

After the cache is cleared initially the jobs ran for a couple of instances and they were again pausing and the reason was a modified workflow resulting in a “dead end” state. Which was a mistake by the user. Each server processing workflows timer job became “stuck” due to items reaching the “dead end” state. All workflows with pauses or state changes would have ceased to be processed at this stage.

Under normal operations, a workflow is first executed in the World Wide Web Publishing Service (w3wp.exe). After a delay or pause, in which the workflow “sleeps,” it wakes up and is then run by the SharePoint Timer Service (the owstimer.exe process).

 When w3wp.exe is under excessive load, it postpones the workflow. The Timer Service is then used to the continue the process. SharePoint dictates which Workflow Timer service will run the workflow; the operation can occur on any server running the “Microsoft SharePoint Foundation Workflow Timer Service” service. However, when Nintex Workflow is installed, it only deploys the DLLs required to run workflows to WFE servers–specifically, those servers running the “Microsoft SharePoint Foundation Web Application” service.

This issue is discovered by enabling verbose logging both at CA and also at Nintex global settings and also querying for the workflow name and its site collections using Nintex NWAdmin.exe

After the workflow is modified and already the workflows which are started with the broken workflow is cleared and again restarting the timer services on servers with clearing the cache resolved the issue.

This issue is reported on SharePoint 2010 and Nintex 2010

 

 

Tags: nintex workflow, State changes error, workflow timer job paused, sharepoint timer service restart.

Advertisement

Automate monitoring SharePoint and Windows Services


As a SharePoint admin, the most important role calls for monitoring servers and maintain the SLA’s. I guess there will be no second thoughts on this. For an admin as the environment grows to multiple farms and servers at different location it calls for automation – mostly on routine tasks to save time for their personal life and here in I am attempting to address how it did saved me some time. Automate monitor/start SharePoint Services on farm servers. You can script it to check these services at every restart and if you are the unlucky one where some of the services  keep on stopping or unstable you can schedule the the script to check the services and attempt to start them and also email you the status.

So, we are looking at the script to:

  1. Check the services at startup or on scheduled time.
  2. Attempt to start the services if they are stopped
  3. Send an email with the status of the services from each server.

What you need to know before trying this option:  SMTP server or mailhost server (which has to be unauthenticated SMTP).

I had this script, apparently it is been pieced together for my requirements and then scheduled to run on each reboot. How to call this script, 2 files created: Batch file which refers the PowerShell script  (keep both these files in same path)

  1. servicescheck.bat
@echo off
PUSHD "%~dp0"
powershell -file "servicescheck.ps1" < NUL
exit
  1. Servicescheck.ps1
param
(
    [Parameter(Mandatory=$false, HelpMessage='-ServiceNames Optional, provide a set of service names to restart.')]
    [Array]$ServiceNames=@("SharePoint 2010 Tracing","Simple Mail Transfer Protocol (SMTP)","SharePoint 2010 Timer","SharePoint 2010 Administration","IIS Admin Service","World Wide Web Publishing Service", "Net.Tcp Listener Adapter","Net.Pipe Listener Adapter")
);

$server = hostname;
$emailbody = "";

        Write-Host "Attempting to start services on" $server -ForegroundColor White;
        foreach($serviceName in $ServiceNames)
        {
            $serviceInstance = Get-Service  -DisplayName $serviceName -ErrorAction SilentlyContinue;
            if(($serviceInstance -ne $null) -AND ($serviceInstance.Status -eq "Stopped"))
            {
               # Write-Host "Attempting to start service" $serviceName ".." -ForegroundColor White -NoNewline;
                
                    try
                    {
                    start-Service -InputObject $serviceInstance; 
                                
                    }
                    catch
                    {
                        Write-Output "Error Occured: " $_.Message;
                    }
             }
        }
$emailbody = foreach($servicename in $servicenames){ Get-Service $servicename -ErrorAction SilentlyContinue | Select-Object Status, DisplayName | ConvertTo-Html -Fragment}

$users = "Venu Madhav <VenuMadhav@outlook.com>"
$fromemail = "$server@Contoso.com"
$smtpserver = "mailhost.contoso.com"
# assemble the HTML for our body of the email report.

$HTMLmessage = @"
$emailbody
"@ 

send-mailmessage -From $fromemail -to $users -subject "$server Rebooted - Services Status" -BodyAsHTML -Body $HTMLmessage -priority High -smtpServer $smtpserver
$emailbody = "";
exit

 

 

 

 

 

 

 

 

 

Tags: Monitor Services, Automate Service Monitoring, PowerShell, SharePoint, Automate monitoring SharePoint and Windows Services