Wednesday, June 25, 2014

Nintex Workflow Timeout Issue - Solutions

Recently got these timeout related errors in Nintex workflow 2007 with MOSS 2007 environment:

  • "Failed to report workflow progress. Failed to open a connection to a Nintex Workflow content database"
  • "Failed to Start Workflow. Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding"
  • Error: Timeout expired. The timeout period elapsed prior to completion of the server is not responding
Here is some error screenshots:
Failed to report workflow progress. Failed to open a connection to a Nintex Workflow content database
 and the another one:
Failed to Start Workflow. Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding
Meanwhile, In Event Logs, Found these errors:
Nintex Workflow; Build: 11201 (http://sharepoint.crescent.com/finance/approvals/default.aspx)
System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader()
   at Nintex.Workflow.Reports.MyWorkflowInfoCollection.BuildCollection(String username, SPWeb web, Int32 minRow, Int32 maxRow, String orderBy, OrderByDirection direction, List`1 statesToShow)
   at Nintex.Workflow.Reports.MyWorkflowInfoCollection..ctor(String user, SPWeb web, Int32 minRow, Int32 maxRow, String orderBy, OrderByDirection orderByDirection, List`1 statesToShow, Boolean& additionalRows)
   at Nintex.Workflow.ServerControls.WebParts.MyWorkflows.LoadView()
   at Nintex.Workflow.ServerControls.WebParts.MyWorkflows.Render(HtmlTextWriter writer)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Troubleshooting Steps:

Verify database is up and running and there is no network connectivity issues between Web and Database Severs. Follow these steps to troubleshoot timeout issues.

1. Increase Timeout value: 
Get the current database connection timeout value by:
stsadm -o getproperty -pn database-connection-timeout

By default, it would be 15 seconds. You can increase the timeout with the below command:
stsadm -o setproperty -pn database-connection-timeout -pv 60
This can be used for SharePoint Database connectivity Timeout Issues too.

2. Workflow Content Database may grown to large in size:
Large amount of data in the Nintex content database tables could likely to cause SQL Server timeout errors. So, Analyze Nintex content database table sizes. Here is how to do it in SQL Server 2008 and above.
  1. Open SQL Management Studio >> Expand the Database node
  2. Find the Nintex Workflow database (usually named NW2007DB or NW2010DB)
  3. Right-click on the Nintex Workflow database and select Reports > Standard Reports > Disk Usage by Table
If you are running with SQL Server 2005, use the below query to analyze database table usages:
USE [Nintex_WF_2007_Content]
begin try 
SELECT 
 a3.name AS [schemaname],
 a2.name AS [tablename],
 a1.rows as row_count,
 (a1.reserved + ISNULL(a4.reserved,0))* 8 AS reserved, 
 a1.data * 8 AS data,
 (CASE WHEN (a1.used + ISNULL(a4.used,0)) > a1.data THEN 
   (a1.used + ISNULL(a4.used,0)) - a1.data ELSE 0 END) * 8 AS index_size,
 (CASE WHEN (a1.reserved + ISNULL(a4.reserved,0)) > a1.used THEN 
   (a1.reserved + ISNULL(a4.reserved,0)) - a1.used ELSE 0 END) * 8 AS unused
FROM
 (SELECT 
  ps.object_id,
  SUM (
   CASE
    WHEN (ps.index_id < 2) THEN row_count
    ELSE 0
   END
   ) AS [rows],
  SUM (ps.reserved_page_count) AS reserved,
  SUM (
   CASE
     WHEN (ps.index_id < 2) THEN 
   (ps.in_row_data_page_count + ps.lob_used_page_count + ps.row_overflow_used_page_count)
     ELSE (ps.lob_used_page_count + ps.row_overflow_used_page_count)
   END
   ) AS data,
  SUM (ps.used_page_count) AS used
 FROM sys.dm_db_partition_stats ps
 GROUP BY ps.object_id) AS a1
LEFT OUTER JOIN 
 (SELECT 
  it.parent_id,
  SUM(ps.reserved_page_count) AS reserved,
  SUM(ps.used_page_count) AS used
  FROM sys.dm_db_partition_stats ps
  INNER JOIN sys.internal_tables it ON (it.object_id = ps.object_id)
  WHERE it.internal_type IN (202,204)
  GROUP BY it.parent_id) AS a4 ON (a4.parent_id = a1.object_id)
INNER JOIN sys.all_objects a2  ON ( a1.object_id = a2.object_id ) 
INNER JOIN sys.schemas a3 ON (a2.schema_id = a3.schema_id)
WHERE a2.type <> 'S' and a2.type <> 'IT'
ORDER BY a3.name, a2.name
end try 
begin catch 
select 
        ERROR_NUMBER() as tablename
,       ERROR_SEVERITY() as row_count
,       ERROR_STATE() as reserved
,       ERROR_MESSAGE() as data
,       1 as index_size
,   1 as unused 
end catch
Make sure: dbo.WorkflowProgress table down to about 10-15 million rows!

What to do when Workflow Progress table is over sized?
You can reduce the size of the workflow progress database table: http://connect.nintex.com/files/folders/white_papers/entry30032.aspx

Find Which Workflows Causing this bottleneck: 
Lets find which workflows are flooding the database tables. Use the below query to find all Nintex workflows (such as: Popular workflows or errored workflows) which may over utilize workflow progress table.
SELECT TOP 100 
I.WorkflowName, 
I.WorkflowInstanceID, 
I.SiteID, 
I.WebID, 
I.ListID, 
I.ItemID, 
I.WorkflowInitiator, 
I.WorkflowID,
I.State, COUNT(P.WorkflowProgressID) as WorkflowProgressRecords
FROM WorkflowInstance I inner join WorkflowProgress P WITH (NOLOCK)
ON I.InstanceID = P.InstanceID
--WHERE i.State=2 
GROUP BY I.WorkflowName, I.WorkflowInstanceID, I.SiteID, I.WebID, I.ListID, I.ItemID, I.WorkflowInitiator, I.WorkflowID, I.State 
ORDER BY COUNT(P.WorkflowProgressID) DESC
Here is the output:

From the above data, Use: Get SharePoint Site Collection, Web, List Objects from GUID to get the list/web/site objects.

Purge Workflow Data:
So, We got which workflow instances are causing this bottle neck. Next step is to Purge workflow data! Lets Purge workflow data using Nintex Admin command line tool: NWAdmin.exe (Located at: C:\Program Files (x86)\Nintex\Nintex Workflow 2007)

NWAdmin.exe -o PurgeWorkflowData -instanceId "GUID of the workflow instance"

Also, You can try purging workflow data based on date, Workflow status, etc. Keep an eye on the workflow content database, Log file sizes. Try truncating log files.

3. Move Workflow data to Another Workflow Content database:
You can also move workflow data to a new workflow content database. Follow these steps:
http://connect.nintex.com/files/folders/30882/download.aspx



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Check out these SharePoint products:

2 comments :

  1. Thank you.. the article help me a lot.

    ReplyDelete
  2. fantastic article

    ReplyDelete

Please Login and comment to get your questions answered!

You might also like:

Related Posts Plugin for WordPress, Blogger...