Support Console Troubleshooting

  • 3 March 2015
  • 0 replies
  • 14 views

Userlevel 7
Badge +10

Products: Nintex Workflow 2013, Nintex Workflow 2010

 

Sometimes it can be helpful to replicate the page load behavior of the Nintex Workflow Support Console for troubleshooting purposes. This PowerShell script emulates the SQL Database queries that can potentially cause the page to timeout on loading.

 

Here is an example error message thrown when loading the Support Console page:

 

"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."

 

2015-03-03 13_29_16-Clipboard.png

 

Running this PowerShell script should produce meaningful exceptions if there is an issue with loading the Nintex Workflow Support Console (assuming it is a SQL Client timeout issue).

 

PowerShell Script
  1. Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
  2. [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
  3. [void][System.Reflection.Assembly]::LoadWithPartialName("Nintex.Workflow")
  4. [void][System.Reflection.Assembly]::LoadWithPartialName("Nintex.Workflow.Administration")
  5.  
  6. function Get-AllNWDatabases(){
  7.  
  8. $cmd = New-Object -TypeName System.Data.SqlClient.SqlCommand
  9.  
  10. $cmd.CommandType = [System.Data.CommandType]::StoredProcedure
  11. $cmd.CommandText = 'GetAllDatabases'
  12.  
  13. $reader = [Nintex.Workflow.Administration.ConfigurationDatabase]::GetConfigurationDatabase().ExecuteReader($cmd)
  14.  
  15. $data = @()
  16.  
  17. while($reader.Read())
  18. {
  19.     $row = New-Object System.Object
  20.     $row | Add-Member -MemberType NoteProperty -Name "DatabaseId" -Value $reader['DatabaseId']
  21.     $row | Add-Member -MemberType NoteProperty -Name "DatabaseName" -Value $reader['DatabaseName']
  22.     $row | Add-Member -MemberType NoteProperty -Name "ErrorsCount" -Value $reader['ErrorsCount']
  23. $data += $row
  24. }
  25. $data
  26.  
  27. }
  28.  
  29. function Get-WorkflowErrors($DatabaseName){
  30.  
  31. $cmd = New-Object -TypeName System.Data.SqlClient.SqlCommand
  32.  
  33. $cmd.CommandType = [System.Data.CommandType]::StoredProcedure
  34. $cmd.CommandText = 'GetWorkflowErrors'
  35. $cmd.Parameters.Add('@DatabaseName', [System.Data.SqlDbType]::NVarChar).Value = $DatabaseName
  36. $cmd.Parameters.Add('@PageNumber', [System.Data.SqlDbType]::Int).Value = 1
  37. $cmd.Parameters.Add('@PageSize', [System.Data.SqlDbType]::Int).Value = 10
  38. $cmd.Parameters.Add('@TotalErrors', [System.Data.SqlDbType]::Int).Value = 0
  39.  
  40.  
  41. $reader = [Nintex.Workflow.Administration.ConfigurationDatabase]::GetConfigurationDatabase().ExecuteReader($cmd)
  42.  
  43. $count = @()
  44.  
  45. while($reader.Read())
  46. {
  47.         $count += $reader[0]
  48. }
  49.  
  50. $count.Count
  51. }
  52.  
  53. function Run-SupportConsoleDiag(){
  54.  
  55. $data = @()
  56.  
  57. foreach ($dbref in Get-AllNWDatabases){
  58.  
  59.  
  60.  
  61. $row = New-Object System.Object
  62. $row | Add-Member -MemberType NoteProperty -Name "DatabaseName" -Value $dbref.DatabaseName
  63. $row | Add-Member -MemberType NoteProperty -Name "WorkflowErrorCount" -Value $(Get-WorkflowErrors -DatabaseName $dbref.DatabaseName)
  64.  
  65. $data += $row
  66. }
  67.  
  68. $data
  69.  
  70. }
  71.  
  72. Run-SupportConsoleDiag

 

 

 

More Information on this topic can be found here: Support Console: Database connection timed out


0 replies

Be the first to reply!

Reply