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

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

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

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

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

@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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (8,164)