another technical blog...technically

Wednesday, July 30, 2014

Howto solve Workflow suspended with HTTP 401 and survive to a demo

Today... demo day...
Objectives:
  •     Show the customer what he/she is paying for
  •     Satisfy customer
  •     Sell change requests
  •     Earn project bonus
So, basically, let's take another demo roundtrip and let's test all the process.
Wow everything works fine, why don't we start the workflow?
Wow... Why execution failed?

RequestorId: dbaf8233-b7f4-cc8e-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ApplicationException: HTTP 401 {"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."}}} {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["2"],"SPRequestGuid":["dbaf8233-b7f4-cc8e-84d2-34863a603d9b"],"request-id":["dbaf8233-b7f4-cc8e-84d2-34863a603d9b"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4551"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Fri, 25 Jul 2014 14:01:50 GMT"],"Server":["Microsoft-IIS\/8.0"],"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 executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Wow... Why my bonus it's flying away?
Don't worry about it, the solution it's simple, even if the situation is frustrating.
The problem can be solved using central admin, look for Refresh trusted security token services metadata feed and run it now. Then make an iisreset.
If you are a lazy one use this small PowerShell
Get-SPTimerJob "RefreshMetadataFeed" | Start-SPTimerJob
And now, let's go on with demo, and with the bonus :) .
written in: Milano, Italia

7 comments:

  1. did not worked. still get the same error.

    ReplyDelete
    Replies
    1. Hi buddy,

      have you tried to iisreset your machine after "Refresh trusted security token services metadata feed" restart?

      Are you sure you have restarted the correct timer job, and that the timer job did its work?

      If your answer is yes to both question, the problem is elsewhere, and maybe you have to reconfigure the workflow manager.

      Best regards.

      Delete
  2. Hi Bro,
    I ran into this same issue with my client every day.
    Please check if account starting workflow has user profile service.As workflows user oAuth.
    It will solve ur issue.

    ReplyDelete
    Replies
    1. how to check if the account starting workflow has a user profile service?

      Delete
  3. Thank you for this great help:
    Get-SPTimerJob "RefreshMetadataFeed" | Start-SPTimerJob

    after above PowerShell cmdlet execution and reset iis, then it start working.

    great...

    ReplyDelete
  4. I have delete the workflow and publish again.
    it's work now

    ReplyDelete
  5. I have delete the workflow and publish again.
    It work now

    ReplyDelete

Because of a lot of SPAM about courses, I need to moderate all comments here.
I ensure you that I will answer whenever possible (if you are not a spammer).

Me, myself and I

My Photo
I'm just another IT guy sharing his knowledge with all of you out there.
Wanna know more?