Wednesday, July 17, 2013

SharePoint 2013: Workflow suspends on e-mail enabled library


Symptoms

SharePoint 2013 Designer Workflow goes to Suspended state when Item is added to on e-mail enabled document library https://sp.contoso.com/abc/Forms/AllItems.aspx
Name of Workflow: ABC Workflow.
When we manually add the item to library, everything works fine. New documents from incoming emails are starting the workflow but the workflow immediately goes to an Internal "Suspended" status and shows the below error in ULS. These workflows are initiated by the System Account. We have already set the declarativeworkflowautostartonemailenabled property to true, so we should be able to start the workflow upon creation. However, the workflow goes into a Suspended state.

We found below details in ULS logs.
RequestorId: 7d6b5f5d-e49d-3502-0000-000000000000. Details: RequestorId: 7d6b5f5d-e49d-3502-0000-000000000000.
Details: An unhandled exception occurred during the execution of the workflow instance. Exception details:
System.ApplicationException: HTTP 401 {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":
["0"],"SPRequestGuid":["7d6b5f5d-e49d-3502-b080-0ae9537b7c6b"],"request-id":["7d6b5f5d-e49d-3502-b080-0ae9537b7c6b"],"X-FRAME-OPTIONS":["SAMEORIGIN"], "MicrosoftSharePointTeamServices":["15.0.0.4481"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Thu, 02 May 2013 11:11:46 GMT"],"Server":["Microsoft-IIS\/8.0"],"WWW-Authenticate":["NTLM"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]} {"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access denied. You do not have permission to perform this action or access this resource."}}} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Cause

'Workflows can use app permissions' was not activated. 

Resolution

  1. Added the System account to Full control Permission on bin folder and GAC.
  2. Confirmed that this account do have full control on the Web application.
  3. Checked Site actions > Site Settings > Site features > Workflows can use app permissions > Activate.
  4. Performed an IISReset.
  5. We tested this on library, This worked.
  6. Account was showing as SharePointApp now in place of System account.
  7. SPD 2013 workflow are working as expected.


2 comments:

  1. i am also getting same error while running sharepoint workflow ,internal status suspended and error http 401

    ReplyDelete
  2. i am using sys account who having full control
    and 'Workflows can use app permissions' was activated

    ReplyDelete