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

Power Automate Execute Stored Procedure (V2) Failure Bad Gateway and Timeout

We are having an issue with scheduling a stored procedure with Power Automate.

 

There is a default of 120 seconds for SQL execution.  If there is no message coming back from SQL Server during that time, Power Automate terminates the process.  In other words, it is not executed asynchronously. Our stored procedure takes at least 30 minutes to run and there is no way that it can send a response to Power Automate before it completes.

 

We need to find a way to change this setting to be greatly increased (ideally unlimited). 

 

This is the error message that we get when running the process “Execute Stored Procedure (V2)” in a flow.  How can we adjust the timeout setting?

{

    "statusCode": 504,

    "headers": {

        "Pragma": "no-cache",

        "x-ms-datasourceerror": "True",

        "x-ms-request-id": "a3f4f525-b024-40c0-8c27-3894e4df111b",

        "Strict-Transport-Security": "max-age=31536000; includeSubDomains",

        "X-Content-Type-Options": "nosniff",

        "X-Frame-Options": "DENY",

        "Timing-Allow-Origin": "*",

        "x-ms-apihub-cached-response": "true",

        "x-ms-apihub-obo": "true",

        "Cache-Control": "no-store, no-cache",

        "Date": "Mon, 25 Jul 2022 16:39:45 GMT",

        "Content-Length": "687",

        "Content-Type": "application/json",

        "Expires": "-1"

    },

    "body": {

        "error": {

            "code": 504,

            "source": "flow-apim-msmanaged-na-eastus-01.azure-apim.net",

            "clientRequestId": "a3f4f525-b024-40c0-8c27-3894e4df111b",

            "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: a3f4f525-b024-40c0-8c27-3894e4df111b",

                "error": {

                    "message": "Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding."

                },

                "source": "sql-eus.azconn-eus.p.azurewebsites.net"

            }

        }

    }

}

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @RickEpstein ,

 

Have a good day. I'm not an expert in SQL Server. 

I researched the official documentation and found it to be a limitation. 

vxiaochenmsft_0-1660617977264.png

 

SQL Server - Connectors | Microsoft Docs

Long-Running SQL Stored Procedures in LogicApps - Microsoft Tech Community

The documentation seems to indicate that the workaround is to configure an agent.

Hope it can helps you.

 

Best Regards,

Wearsky

View solution in original post

1 REPLY 1
v-xiaochen-msft
Community Support
Community Support

Hi @RickEpstein ,

 

Have a good day. I'm not an expert in SQL Server. 

I researched the official documentation and found it to be a limitation. 

vxiaochenmsft_0-1660617977264.png

 

SQL Server - Connectors | Microsoft Docs

Long-Running SQL Stored Procedures in LogicApps - Microsoft Tech Community

The documentation seems to indicate that the workaround is to configure an agent.

Hope it can helps you.

 

Best Regards,

Wearsky

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,501)