cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

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

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

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

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

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (5,124)