SharePoint 2013 Workflow gets canceled automatically

Hi,

I was struck with the error of Workflow gets canceled automatically.
Scenario was :
A new SP 2013 installation, one server with SP, WF, etc and the other is simply SQL Server. Went through the installation steps for Workflow including the powershell bits. In designer, I am able to create a simple workflow and select 2013 as the type. When the workflow is run, is shows internal status is canceled and has the following error text below.

  • RequestorId: 55c6990b-c4a6-352c-4a5b-449fc1aecac4. Details: System.ApplicationException: HTTP 401 {"x-ms-diagnostics":["3001000;reason=\"There has been an error authenticating the request.\";category=\"invalid_client\""],"SPRequestGuid":["55c6990b-c4a6-352c-4a5b-449fc1aecac4"],"request-id":["55c6990b-c4a6-352c-4a5b-449fc1aecac4"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"SPRequestDuration":["61"],"SPIisLatency":["1"],"Server":["Microsoft-IIS\/8.0"],"WWW-Authenticate":["Bearer realm=\"61e7a76b-024e-40d5-9185-2887a044d7cc\",client_id=\"00000003-0000-0ff1-ce00-000000000000\",trusted_issuers=\"00000005-0000-0000-c000-000000000000@*,00000003-0000-0ff1-ce00-000000000000@61e7a76b-024e-40d5-9185-2887a044d7cc\"","Negotiate","NTLM"],"X-Powered-By":["ASP.NET"],"MicrosoftSharePointTeamServices":["15.0.0.4420"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Date":["Tue, 05 Feb 2013 19:17:31 GMT"]} {"error_description":"The server was unable to process the request due to an.....


    Finally nailed it by following steps:

    1. Be sure User profile synchronization is started.

    2. The user by whom you are logged is available in User Profile list. ( In my case it was not, created new profile for the current logged in user and make sure, you are not running workflow with SharePoint system user. Please create a new user in Active directory, and using this user, create/provision workfow
          3. Final step full synchronization of User Profile Application.


and its started working!!!

Hope it saves your time

Comments

  1. That’s actually by design and due to OAuth.

    OAuth tokens, when including a user identity, only include the user’s UPN for security reasons. SharePoint uses that UPN to lookup the user in the UPA to get their additional details, like what you’re getting. You’re hitting it in workflow because Workflow Manager has an S2S trust established with SharePoint to establish it is in fact workflow.

    There are numerous services that have this dependency in SharePoint 2013, including Workflow Manager.

    ReplyDelete
  2. Hi Anuja,

    I am also stuck with the same problem for last 2weeks. i am also getting same error message. workflow gets canceled automatically.

    Please help on this

    thanks
    RajeshKannan.R
    itrajeshkannan@gmail.com

    ReplyDelete
  3. Have you tried above steps? as well make sure to run full synchronization of User Profile Application

    ReplyDelete
  4. Hi Anuja,
    Great help indeed. Hope more such inputs will save our time.
    :)

    Thanks

    ReplyDelete
  5. I am also stuck with the same issue

    RequestorId: f4234732-0df3-a835-0000-000000000000. Details: RequestorId: f4234732-0df3-a835-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"],"SPClientServiceRequestDuration":["127"],"SPRequestGuid":["f4234732-0df3-a835-bdd2-c9b5cdc0317c"],"request-id":["f4234732-0df3-a835-bdd2-c9b5cdc0317c"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4420"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Wed, 22 May 2013 14:49:55 GMT"],"Server":["Microsoft-IIS\/7.5"],"WWW-Authenticate":["NTLM"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor

    Please help.

    ReplyDelete
  6. Have you tried the above step? is your user having proper permission or added as Site collection Admin?

    ReplyDelete
  7. Hey, great article!

    I have followed step 1, but steps 2 and 3 seem a bit unclear to me:

    2. The user by whom you are logged is available in User Profile list.
    Where do I check this?

    3. Final step full synchronization of User Profile Application.
    How do I run a full sync?

    ReplyDelete
    Replies
    1. You can refer http://technet.microsoft.com/en-us/library/ee890104.aspx

      Delete
  8. Hi, for the record, I found another case where this error happens: if the workflow initiator does not have write access to the hidden Workflow History List, the same error happens. To solve the issue, simply open the hidden list permission (through SharePoint Designer>All Files>Lists, for example) and make sure to have your potential initiators contribute rights. The list defaultly inherits the site's permissions.

    ReplyDelete
    Replies
    1. Thanks Francis Laurin its work for me:)

      Delete
    2. I was having the same issue. Went to the hidden workflow list as you suggested, applied the permissions needed and started working! Thanks a lot!

      Delete
  9. Actually, I'm getting this error and the user DOES have access to the hidden Workflow History list (use has full control), DOES have a profile and is NOT the farm administrator.

    Any other ideas? It's absolutely ridiculous how difficult it is to install Workflow Manager. . .and the documentation is so incomplete. . .TECHNET doesn't even mention that profiles need to be installed!

    ReplyDelete
    Replies
    1. Have you tried installing Power View? Also very frustrating.

      Delete
  10. I am trying to use FBA and get this same error, with Active Directory users the workflow executes fine, the FBA user is already in User Profile... is Forms Based Authentication and Workflows supported?

    ReplyDelete
  11. I am also getting the same error when using FBA. With windows it works fine.

    ReplyDelete
    Replies
    1. SharePoint Workflow uses signed security tokens to authenticate. The SharePoint Web Application must be claims enabled and not use Forms Based Authentication (which is a requirement of SharePoint OAuth).

      Because the response header only includes WWW-Authenticate: NTLM it would seem that SharePoint is not configured for server-to-server authentication
      http://technet.microsoft.com/en-us/library/jj219546.aspx

      Delete
  12. So what you are saying is that using Form based authentication it is not possible to start the workflow successfully ?

    ReplyDelete
  13. I'd like to know that as well, if your syaing using FBA is not possible or is associated with the issue?

    ReplyDelete
  14. Hi,

    I get following error while starting workflow using code behind:

    RequestorId: cd90796b-2d7a-d732-94eb-8f1806b2679c. Details: System.ApplicationException: HTTP 401 {"error_description":"The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs."} {"x-ms-diagnostics":["3001000;reason=\"There has been an error authenticating the request.\";category=\"invalid_client\""],"SPRequestGuid":["cd90796b-2d7a-d732-94eb-8f1806b2679c"],"request-id":["cd90796b-2d7a-d732-94eb-8f1806b2679c"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"SPRequestDuration":["47"],"SPIisLatency":["7"],"Cache-Control":["private"],"WWW-Authenticate":["Bearer realm=\"75cf7db6-1b8f-441c-9656-b623bbe1cc2a\",client_id=\"00000003-0000-0ff1-ce00-000000000000\",trusted_issuers=\"00000005-0000-0000-c000-

    ReplyDelete
  15. On your workflow make sure you DO NOT check Automatically update the workflow status to the current stage name. I unchecked it and all issues disappeared.

    ReplyDelete
    Replies
    1. Thanks Kim. This worked for me. Kind of silly though.

      Delete
  16. The probleme is in groups of AD, I found this article: http://sergeluca.wordpress.com/2013/03/26/sharepoint-2013-issue-with-the-new-start-a-task-process-and-how-to-fix-it-with-an-app-step/

    ReplyDelete
  17. Worked for me. Thanks for the post

    ReplyDelete
  18. HI Anuja

    Am getting the following error

    RequestorId: 2785410f-9edf-ce27-0000-000000000000. Details: RequestorId: 2785410f-9edf-ce27-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ApplicationException: HTTP 404 {"Connection":["close"],"Date":["Tue, 17 Dec 2013 19:38:56 GMT"],"Server":["Microsoft-HTTPAPI\/2.0"]} HTTP Error 404. The requested resource is not found. 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

    Please let me know if you have any idea on this issue .

    Regards
    Habeebullah.

    ReplyDelete
  19. Hi Anuja

    you have a great post here to keep in mind.

    i have little different error than that. if you ever have ran into this error.

    RequestorId: 9dea9a29-bb82-214a-0000-000000000000. Details: RequestorId: 9dea9a29-bb82-214a-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ApplicationException: HTTP 500 {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["0"],"SPClientServiceRequestDuration":["30"],"SPRequestGuid":["9dea9a29-bb82-214a-92f0-943af4411ac2"],"request-id":["9dea9a29-bb82-214a-92f0-943af4411ac2"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4420"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Fri, 31 Jan 2014 20:19:03 GMT"],"Server":["Microsoft-IIS\/7.5"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor

    Thank you
    Rav Smith

    ReplyDelete
    Replies
    1. http://designerworkflow.blogspot.in/2014/02/error-requestorid-1ca8de59-3d62-782a.html

      Delete
    2. Rav, Did you ever figure this issue out? I'm getting the same thing in our environment after updating to SP1. Thanks.

      Delete
    3. http://anujabhojani.blogspot.in/2014/02/workflow-gets-canceled-automatically.html

      Delete
    4. Problem is, I'm not sending mail in the WF. I am just adding a WF comment on a document and ending the WF as a test.

      Delete
  20. Yes. This issue is because the SMTP server gets stop and when SendEmail activity try to send email. It doesn't get response from STMP. Go through my blog hope that will clear all your doubts.
    http://designerworkflow.blogspot.in/2014/02/error-requestorid-1ca8de59-3d62-782a.html

    ReplyDelete
  21. This comment has been removed by the author.

    ReplyDelete
  22. hi

    I have one question for you......

    I am calling a site wf from a list wf , The list wf gets cancelled on call of site workflow

    the site wf works if run independently

    I get the list not exists error

    The task lists and history are associated and exists

    can you please get me the solution for this

    Thanks,
    Suraj

    ReplyDelete
  23. I have the same issue when I started working on workflow. One can solve this issue by checking alerts on any list or library. My workflow was containing Email notification and the Out going email address was containing old IP address of my mail server...and for this reason I was getting the error HTML 500 so if your workflow is containing any mail notification sending then
    1. Create a testing list.
    2. select alert me on any change or create Item
    3. insert data in the list.
    4. See event viewer of the sharepoint web server check if there any error or not.
    5. if it shows error on IP or mail server host connection error then try to change the IP or mail server name in Central admin --> system settings --> out going email settings put new server name or IP. Reset IIS(sometimes IIS Reset not required but as formality)
    5. See the email for alerts is received or not. If you received email then go for your workflow testing and check its status. My status was "Completed"

    and for the error HTTP 401 need to start or restart the host server i forgot the name. but after restarting the host service in sharepoint web application server my next error was HTTP 500.

    ReplyDelete
  24. Hi Guys,

    Please help me in fixing Workflow cancelled error, basically getting access denied error.

    I have verified following steps.

    1) Workflow end point returning the xml- This indicates wf is configured properly
    2) Workflow published with Site admin account
    3) User profile up and running
    4) Workflow published account was coming in user profile search(verified from central admin)
    5) No Logging in workflow(Just only one statement in workflow)

    Please help me in fixing in this issue

    Regards
    Sri

    ReplyDelete
  25. Had the same issue, workflow was worrking only for NTLM user but not for FBA.
    After using App permission as described here : http://msdn.microsoft.com/en-us/library/office/jj822159(v=office.15).aspx
    And inserting all my workflow activity inside an APP step, it now works fine

    so do not forget to include all your steps inside an APP step.

    ReplyDelete
  26. Retrying last request. Next attempt scheduled in less than one minute. Details of last request: HTTP InternalServerError to http://site_vti_bin/client.svc/web/lists/getbyid(xyz)

    and workflow get cancel user profile service is running

    ReplyDelete
  27. This comment has been removed by the author.

    ReplyDelete
  28. Hi Anuja,

    Am getting below error.

    RequestorId: b585f151-aee6-3820-0000-000000000000.
    Details: An unhandled exception occurred during the execution of the workflow instance.
    Exception details: System.ApplicationException: HTTP 404 {"Transfer-Encoding":["chunked"],
    "X-SharePointHealthScore":["0"],"SPClientServiceRequestDuration":["68"],
    "SPRequestGuid":["b585f151-aee6-3820-86e2-80d7f0a5df11"],"request-id":["b585f151-aee6-3820-86e2-80d7f0a5df11"],
    "X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4605"],
    "X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],
    "Cache-Control":["max-age=0, private"],"Date":["Fri, 28 Aug 2015 09:15:05 GMT"],
    "Server":["Microsoft-IIS\/8.0"],"X-AspNet-Version":["4.0.30319"],
    "X-Powered-By":["ASP.NET"]}
    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)

    ReplyDelete
    Replies
    1. Hi Karthik,
      I'm getting the same error as well 'HTTP 404' error when the workflow is kicked off. It cancels automatically when someone other than the list owner starts the workflow.

      Delete
  29. Please anyone answer for the above error

    ReplyDelete
  30. Hello,

    I am getting same error but workflow runs in subsite with same user and it gets cancelled in top level site only.

    Subsite is inheriting permission. It throws 401 exception and in description it is written as
    "HTTP response content could not be read. 'Error while copying content to a stream.'"

    ReplyDelete
  31. How about this?


    0






    I found this in a different post. I am going to try it later today.


    Please do as follows:

    1.Navigate to the site that the workflow is on in SharePoint 2013 Designer.

    2.Go to All Files -> Lists

    3.Right click on Workflow History

    4.Select Properties

    5.Click on Permissions for this list under the ‘Customization’ section (This should open up the edit permissions page in the browser)

    6.Break inheritance on this list by selecting Stop Inheriting Permissions in the new opened browser window

    7.Use the check box next to the appropriate group (probably the visitors group) to select the group that needs updated permissions

    8.Select Edit User Permissions

    9.Grant the group 'Contribute' permissions

    10.Select OK

    ReplyDelete

Post a Comment

Popular posts from this blog

Search Result Webpart,Filter result If QueryString is present in URL

Permission denied for "Add and Customize Pages" in Sharepoint Online