cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
srduval
Advocate V
Advocate V

Bad Gateway 504 Error

I have a flow that is trying to execute a stored procedure in an Azure SQL database, the SP runs fine (3-5 minutes) in SSMS, but in flow it fails every time with a bad gateway/timeout error.

 

i've tried the execute stored procedure step as well as the execute SQL query both fail. I have other steps that read from the same connection to the same server/database. I put a parameter on the sp to see what happens and when i put the parameter to just return a select statement, it ran without issue. But when the flow tries to run the full SP which truncates a table and inserts new records, it fails

Annotation 2020-07-16 112809.png

{
"error": {
"code": 504,
"source": "flow-apim-msmanaged-na-westus2-01.azure-apim.net",
"clientRequestId": "921d218a-8b4d-4402-a508-72f3059d6c4e",
"message": "BadGateway",
"innerError": {
"status": 504,
"message": "Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.\r\nclientRequestId: 921d218a-8b4d-4402-a508-72f3059d6c4e",
"error": {
"message": "Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding."
},
"source": "sql-wus.azconn-wus.p.azurewebsites.net"
}
}
}

4 REPLIES 4
srduval
Advocate V
Advocate V

 
srduval
Advocate V
Advocate V

@Msft @EUG-MSFT  I'm having problems loading the MS support site, it is just spinning on my end and not loading. Is there an alternative way to create a support ticket?

Toltekrom
Frequent Visitor

Hope you found the issue. What I see you are using the wrong Power Automate object - Execute a SQL Query instead of Execute a Store Procedure 

srduval
Advocate V
Advocate V

@Toltekrom The two objects do the same thing in this case depending on how you construct the SQL statement. So it is not the "Wrong" object besides I tried it with both objects and still had the gateway error. The issue is a hardset timeout of 120 seconds that can not be manually overridden. So if automate doesn't get a "progress" report within that 2 minutes, it terminates the workflow. So in this case SQL doesn't communicate anything to Automate while the SP is executing, so it hits the 120 seconds of no communication and terminates the flow.

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (1,867)