cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JoHacker
New Member

GatewayTimeout error when running stored procedure

I am trying to create a flow which will run a stored procedure on an Azure database.  When running the procedure on the server, it takes approximately 1 minute to complete.  When I run it using either the SQL server or Azure Data Warehouse actions to Execute Stored Procedure, I get a timeout error.

 

Even though the settings say that the item is running asynchronously, it doesn't seem to have actually started the procedure as no data is updated on the server.  I don't actually need a result set, so if it's possible to get it run truely async, that would do as a solution, or if I can get the timeout increased.

 

I have run a simple SQL statement (select getDate()) on the connection so there is no problem reaching or getting responses from the server.

1 ACCEPTED SOLUTION

Accepted Solutions
JoHacker
New Member

For anyone looking at this via Google, it turned out this was being caused by the Flow using a corrupted query plan that's not used by SSMS.  To fix it, I switched to using an SQL query (rather than the exec stored proc task) and set the query to "set arithabort on; exec stored_proc_name;" and that worked like a charm.

View solution in original post

4 REPLIES 4
v-bacao-msft
Community Support
Community Support

Hi @JoHacker ,

 

Could you share the details of the Flow configuration?

I can't reproduce a similar issue on my side.

You could try to update the connection and check if a similar problem still exists.

 

Best Regards,

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

Sure.  Here is what the flow itself looks like:

 

Flow configurationAnd here are the settings for the Execute stored procedure task:

 

Settings for the exec action

When I've got the exec part working, the manual trigger will be replaced with a schedule, but for the moment, I just want to get this part working!

JoHacker
New Member

For anyone looking at this via Google, it turned out this was being caused by the Flow using a corrupted query plan that's not used by SSMS.  To fix it, I switched to using an SQL query (rather than the exec stored proc task) and set the query to "set arithabort on; exec stored_proc_name;" and that worked like a charm.

View solution in original post

@v-bacao-msft I'm having the same problem as the original poster. Using the execute stored procedure action, it runs forever before finally timing out with a gateway error. sp only takes a minute or two on the azure server directly 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,390)