cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
New Member

Re: GatewayTimeout error when running stored procedure

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
Highlighted
Community Support
Community Support

Re: GatewayTimeout error when running stored procedure

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.
Highlighted
New Member

Re: GatewayTimeout error when running stored procedure

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!

Highlighted
New Member

Re: GatewayTimeout error when running stored procedure

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

Highlighted
Advocate III
Advocate III

Re: GatewayTimeout error when running stored procedure

@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
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!

Top Solution Authors
Users online (9,082)