cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
paul_culmsee
Level 8

Very slow and intermittent error 520. x-ms-failure-cause apihub-token-exchange

Well after having a very good flow day, I had a very bad flow day.

 

Out of nowhere, my epic flow suddenly goes from taking 1 minute to run to taking half an hour. All of the SharePoint flow actions are complaining about retries, and sometimes working and then sometimes failing. Eg an action that has 2 timeouts in one run with take a second or two on the next run...

 

The error I consistently see in the retries and errors is:error 520. On a retry I will see something like:

 

Duration: 43s
Start time: 2018-03-07T11:08:14.7908465Z
End time: 2018-03-07T11:08:58.136289Z
Status: 520
Client request ID: 20ac3a99-ef97-4f8f-9aee-3e603e0fa8d8

 

When it fails alrogether, I see. x-ms-failure-cause apihub-token-exchange in the header and in the body I see:

 

{
  "Message""Error from ASE:token exchange failure."
}

 

The issue is definitely in the connections, because for a while PowerApps was also very slow to connect to SharePoint connections too, with occasional errors. 

 

So to troubleshoot, I tried to re-auth my SharePoint connector and it made no difference. I tried to share the flow with a different account, and I then edited the flow and changed the connections on SharePoint tasks to run as that account. While the flow editor worked fine and happily saved the flow, this resulted in the flow breaking altogether with:

 

'The template language expression 'json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$connections']['shared_sharepointonline_1']['connectionId']' cannot be evaluated because property 'shared_sharepointonline_1' doesn't exist, available properties are 'shared_sharepointonline, shared_onedriveforbusiness'

 

Foiled by that approach, I exported the flow and then imported it while logged in as my second account and while it happily imported, I was unable to connect it to PowerApps. That gave me a registration error.

 

Can you confirm if there are known issues happening at present?

 

Paul Culmsee

1 ACCEPTED SOLUTION

Accepted Solutions
paul_culmsee
Level 8

Re: Very slow and intermittent error 520. x-ms-failure-cause apihub-token-exchange

An update... this flow has several SharePoint Get Items and Get FIles actions. At some point the oData filters on those actions were wiped, meaning they were dealing with large lists and not the small subsets they were supposed to... 

 

Weird that 5 of these actions would lose their config.... but anyway. after correcting this, things seems better. The flow in my second reply also started going back to running quickly, so I think I had a couple of issues going on...

 

Paul

View solution in original post

2 REPLIES 2
paul_culmsee
Level 8

Re: Very slow and intermittent error 520. x-ms-failure-cause apihub-token-exchange

Made a new test flow, logged in as my alternate account... same issue. This would suggest its not a specific account thing on this tenant... 

 

issue.PNG

paul_culmsee
Level 8

Re: Very slow and intermittent error 520. x-ms-failure-cause apihub-token-exchange

An update... this flow has several SharePoint Get Items and Get FIles actions. At some point the oData filters on those actions were wiped, meaning they were dealing with large lists and not the small subsets they were supposed to... 

 

Weird that 5 of these actions would lose their config.... but anyway. after correcting this, things seems better. The flow in my second reply also started going back to running quickly, so I think I had a couple of issues going on...

 

Paul

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,870)