cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Microsoft Flow GatewayTimeout Error Code 502

Hoping that someone in the community will be able to assist, because the guys at support has not been able to. I have a MS Flow that was functioning perfectly for about a month, with no changes to the working Flow, it started failing with BadGateway.

 

4 Retries Occured4 Retries Occured

 

The Flow uses a 3rd party action from Plumsail, to Create a SharePoint Site from a Template, custom built for the Organizations needs.  Previously it took between 1 - 2 min to complete. 

 

Now it takes about 2min, before it starts "retrying the action" and then a couple of seconds later, errors out.  From what I can tell the Flow completes the action but doesn't receive a response during the action that does the Site Creation.  It then resends the request, which in turn gives me an error that the site already exists, because the first action completed.

 

Retry InformationRetry Information

Response Body:

 

ErrorError

 

Flow results show that the site already exist, but if one had to check the flow duration and site creation would be the same.  What I mean with that is that the Flow ran 4 minutes ago and if you look at the sub sites information, it was also created 4 minutes ago.  Meaning that the site was created through the flow, but Flow didn't get a Status Code 200.

 

Site.png

 

The site that we're trying to create contains 3 Document Libraries and 5 Lists.  Inside the libraries, we have various Document Sets created, with some sub folders.  There are 3 custom built Document Sets, that we're going to use with search pages later.  I've rebuilt the Flow and the Template Site that is used during the Flow, more than once, as part of the requests from Support, with no luck. 

 

To eliminate the possibility of the 3rd party action not working, I've tried using a "Send an HTTP Request to SharePoint" and creating the site using the webinfos API, but I have the same result.  If I use the STS#0, default Team Site Template, it works.  What doesn't add up is why the default team site is working, but not custom site, which has been rebuilt and I use the same site through the GUI and works perfectly.

 

Now with the request still open with Support still trying to find a solution, I've recreated the entire Solution in my personal O365 Tenant and the Site was created and Flow is surprisingly SUPER FAST, under a minute.  

 

Does anybody have any ideas?

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: Microsoft Flow GatewayTimeout Error Code 502

Hi @ArmandCronjé,

 

What’s your current situation? Are you still having the issue?

Error code 502 means that the failure is temporary and transient. Please click Resubmit to the flow again.

In addition, please try to create SharePoint Online site using Azure Functions, the following blog for your reference:

https://www.stadlersoftware.com/microsoft-flow/sharepoint-online-site-creation-using-microsoft-flow-...

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Microsoft Flow GatewayTimeout Error Code 502

Hi Mabel, Thanks for your response. I understand that error code 502 is a temporary and transient, but I've experienced this since middle of August. So resubmitting has the exact same result every time, although my other site collections that has the exact same flow runs without error. I will try the suggested method, using the Azure Function and revert back with my findings. Thanks, Armand Cronjé
Highlighted
Frequent Visitor

Re: Microsoft Flow GatewayTimeout Error Code 502

Hi Mabel,

 

I'm not able to complete the Azure Function. The provided Blog imports the Azure Function with the URL, which mine is not successful, I get an error:Importing OpenAPIImporting OpenAPI

 

I went on to upload this manually, once done, I configure the rest of the Custom Connector and create it.

Upon running the Flow and during testing I get an error 404 "Resource Not Found".  I tried to get more information about this, but solutions that I've found mentions that the body is not present, but mine is.

404.pngFlow-404.png

 

I then proceeded to create another flow, with a HTTP request, and I called the Azure Function, not using the connector: (The information was hard coded and not using list values)

 HTTPConf.png

 

This attempt suceeded, but unfortunately no site was created.

 Result1.png

 

Do you perhaps have another idea or is there something I'm doing wrong.

 

Thanks,

 

Armand

Highlighted
Frequent Visitor

Re: Microsoft Flow GatewayTimeout Error Code 502

I'm having this same issue and it's incredibly frustrating. This wasn't always the case.

 

I am also on SharePoint Online (maybe this started in August?) and I was using SP 2013 Workflows to create the subsites. What began happening was the Workflows would continue without receiving a responseCode which threw the entire WF logic out of sync. I moved it to Flow and receive exactly what you're experiencing here.

 

My templates aren't very large at all, and the closest I've been able to get to understanding it is that it might have to do with the number of Workflows that I'm provisioning within the template itself? I can't say for sure, but this problem began spontaneously and is really causing me a hard time coming up with a solution.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Users online (9,127)