Friday, November 28, 2014

SharePoint Workflow 2013 not working throwing all 0 co-relation ID error page

In recent past our SharePoint 2013 users were complaint that SharePoint workflows are not working and when ever they click on workflow column (this column created automatically by SharePoint workflow) is navigating to error page that displaying all 0 guid. 

We looked in ULS logs but did not find any specify information. In SharePoint 2013 workflow architecture is very different. SharePoint 2013 workflow run on service bus and it have its own separate databases and architecture.

Open the Power shell management in Workflow server where have workflow manager installed. run get-WFFarm command to get certificate and endpoints related information. Make sure certificate are not expire. Run get-WFFarmStatus tshin will return the WorkFlow endpoint status. here you could get a warning related to Workflowservicefrontend and this could be show stopped but important is workflowservicebackend that should be running if not than we can run that suing shell command.

Untitled

here it seems that every thing is fine.

What could we next? than event viewer can help us go to event viewer and expand Application and service log here you will find a Microsoft-Workflow, Expand this and select operational here you will get several warring like below , so this is the issue.form the details it showing that account not have permission to execute the Stored procedure in workflow database.

Now we understand what is the issue. to fix this issue we need to log in SharePoint SQL serve with the account that have sysadmin permission. so after log in the server and fire the SQL management studio, Expand databases here we find the same name database if we expand workflow database than we can find this stored procedure as well.

Log Name:      Microsoft-Workflow/Operational

Source:        Microsoft-Workflow

Date:          11/18/2014 5:39:54 AM

Event ID:      18

Task Category: (65516)

Level:         Warning

Keywords:      Dispatcher,Management

User:          Domain\Service account

Computer:      Machinename.Domain.net

Description:

Failed SQL command after 1 tries with error '229'. Exception: System.Data.SqlClient.SqlException (0x80131904): The EXECUTE permission was denied on the object 'InsertTrackingAndStatus', database 'OPSPP_WorkflowManager_InstanceManagementDB', schema 'dbo'.

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

   at System.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader()

   at System.Data.SqlClient.SqlCommand.EndExecuteNonQueryInternal(IAsyncResult asyncResult)

   at System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(IAsyncResult asyncResult)

   at Microsoft.Workflow.Management.ExecuteNonQueryAsyncResult.OnEndExecuteSql(IAsyncResult result)

   at Microsoft.Workflow.Management.ExecuteSqlAsyncResult.EndAsyncResult(IAsyncResult result)

   at Microsoft.Workflow.Common.BackoffRetryAsyncResult.IsolateWithRetry(IAsyncResult result)

   at Microsoft.Workflow.Common.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)

ClientConnectionId:50d4777e-0f3e-4921-a1bc-a383cc417348  Command Details:   SQL Text          : InsertTrackingAndStatus

  SQL Parameters    :

    > @StatusRecords = Microsoft.Workflow.Management.SqlDataAccessProvider+InstanceStatusValuesCollection

    > @MetadataWithInstanceId = Microsoft.Workflow.Management.SqlDataAccessProvider+MetadataValuesWithInstanceIdCollection

    > @Variables = Microsoft.Workflow.Management.SqlDataAccessProvider+VariablesCollection

    > @TrackingRecords =

    > @StatusHistoryRecords =

    > @DebugTraceRecords = Microsoft.Workflow.Management.SqlDataAccessProvider+DebugTraceRecordValuesCollection

    > @RollingStatusHistoryWindowSize = 1000

    > @RollingDebugTraceWindowSize = 5000

Event Xml:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

  <System>

    <Provider Name="Microsoft-Workflow" Guid="{B2885F6E-231C-43FF-BBEA-7516148FF6FE}" />

    <EventID>18</EventID>

    <Version>0</Version>

    <Level>3</Level>

    <Task>65516</Task>

    <Opcode>0</Opcode>

    <Keywords>0x4000000000000210</Keywords>

    <TimeCreated SystemTime="2014-11-18T10:39:54.821991300Z" />

    <EventRecordID>1643486011</EventRecordID>

    <Correlation ActivityID="{C63E7DEC-AB83-43C3-9721-AEBB3F0BD3C9}" />

    <Execution ProcessID="6364" ThreadID="5684" />

    <Channel>Microsoft-Workflow/Operational</Channel>

    <Computer>SBYVMNTSHP03P.Domain.net</Computer>

    <Security UserID="S-1-5-21-369997941-647960827-447208795-648028" />

  </System>

  <EventData>

    <Data Name="tryCount">1</Data>

    <Data Name="errorCode">229</Data>

    <Data Name="command">  SQL Text          : InsertTrackingAndStatus

  SQL Parameters    :

    &gt; @StatusRecords = Microsoft.Workflow.Management.SqlDataAccessProvider+InstanceStatusValuesCollection

    &gt; @MetadataWithInstanceId = Microsoft.Workflow.Management.SqlDataAccessProvider+MetadataValuesWithInstanceIdCollection

    &gt; @Variables = Microsoft.Workflow.Management.SqlDataAccessProvider+VariablesCollection

    &gt; @TrackingRecords =

    &gt; @StatusHistoryRecords =

    &gt; @DebugTraceRecords = Microsoft.Workflow.Management.SqlDataAccessProvider+DebugTraceRecordValuesCollection

    &gt; @RollingStatusHistoryWindowSize = 1000

    &gt; @RollingDebugTraceWindowSize = 5000

</Data>

    <Data Name="exception">System.Data.SqlClient.SqlException (0x80131904): The EXECUTE permission was denied on the object 'InsertTrackingAndStatus', database 'OPSPP_WorkflowManager_InstanceManagementDB', schema 'dbo'.

   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)

   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&amp; dataReady)

   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

   at System.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader()

   at System.Data.SqlClient.SqlCommand.EndExecuteNonQueryInternal(IAsyncResult asyncResult)

   at System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(IAsyncResult asyncResult)

   at Microsoft.Workflow.Management.ExecuteNonQueryAsyncResult.OnEndExecuteSql(IAsyncResult result)

   at Microsoft.Workflow.Management.ExecuteSqlAsyncResult.EndAsyncResult(IAsyncResult result)

   at Microsoft.Workflow.Common.BackoffRetryAsyncResult.IsolateWithRetry(IAsyncResult result)

   at Microsoft.Workflow.Common.AsyncResult.AsyncCompletionWrapperCallback(IAsyncResult result)

ClientConnectionId:50d4777e-0f3e-4921-a1bc-a383cc417348</Data>

  </EventData>

</Event>

Now we need to check whether the account under the Workflow services are running have sufficient permission. right click the database and select properties.

Here we can see all the account and roles that have permission on this database.

image

but here is gotcha we don't know what is the right permission that need to give although we can give dbowner permission to workflow account but that could give more than required permission.

As per MS article and understanding this is not recommended to give direct permission to any account so we have another way here you will find  role. this  is the key to solve the issue. Open the Query window and check selected database is “XXXXX-InstanceManagementDB” and write GRANT EXECUTE TO WFServiceoperators hit execute.

Issue is fix ? partially yes :) if we check event log warning is disappear form the event log and if we again go our site collection and try to reproduce the issue it will change with another database  that is XXXX-ResourceManagementDB” so we need to follow the same way and execute the command for the DB as well and grant permission to role again.

now close browse fire a new instance and try to reproduce the issue. this is the way i solve the issue hope it will help you as well.

No comments:

Post a Comment