【问题标题】:Logic Apps - Bad Gateway 502 executing SQL Server stored procedure逻辑应用程序 - 执行 SQL Server 存储过程的错误网关 502
【发布时间】:2023-04-06 14:34:01
【问题描述】:

我正在尝试在本地执行一个存储过程,该过程一次从逻辑应用程序插入 1000 条记录。我已经单独测试了存储过程,插入数据只需不到一秒钟的时间,并且我还通过另一个过程从逻辑应用程序测试了本地网关连接。当我运行从另一个 Web 服务以 JSON 格式获取数据并传递到本地 SQL Server 存储过程的逻辑应用程序时,我收到了错误的网关 (502) 错误。

我确实看到了 similar question,但 Stack Overflow 上没有回答。由于我没有从错误中看到太多有用的信息,任何人都可以建议如何解决此问题吗?我所看到的只是该命令不受支持。感谢您的帮助!

{
  "error": {
    "code": 502,
    "source": "logic-apis-centralus.azure-apim.net",
    "clientRequestId": "xxxxxxx",
    "message": "BadGateway",
    "innerError": {
      "status": 502,
      "message": **"The command '**[   AzureConnection = [gateway=\"true\",server=\"xxx.com\",database=\"xxx\"],\r\n    request = [Connection = AzureConnection],\r\n    dataSet = \"default\",\r\n    procedure = \"[dbo].[UpsertEventData]\",\r\n    parameters = [jsonObject=[\r\n  {\r\n    \"eventId\": \"a835795db0f7a13ab03be8e41bde7f56bc9b772905d82e7c111252d998a002be\",\r\n    \"startTime\": \"2018-09-26T00:23:06+00:00\",\r\n    \"endTime\": \"2018-09-26T00:24:50+00:00\",\r\n    \"userId\": \"6aa080743b27d1a9a67afd2683ede38a\",\r\n    \"channelId\": \"987fb87a4f7b4d867c1f391d38ec98b2\",\r\n    \"shareId\": null,\r\n    \"deviceId\": \"bdf8ada28095551a705737900d7c5bf3\",\r\n    \"divisionId\": null,\r\n,\r\n    \"contactId\": null,\r\n    \"type\": \"asset-in-app-viewed\",\r\n    \"page\": 1\r\n  },  **isn't supported.**\r\n     **inner exception:** The command '[   AzureConnection = [gateway=\"true\",server=\"xxx.com\",database=\"xxx\"],\r\n    request = [Connection = AzureConnection],\r\n    dataSet = \"default\",\r\n    procedure = \"[dbo].[UpsertEventData]\",\r\n    parameters = [jsonObject=[\r\n  {\r\n    \"eventId\": \"a835795db0f7a13ab03be8e41bde7f56bc9b772905d82e7c111252d998a002be\",\r\n    \"startTime\": \"2018-09-26T00:23:06+00:00\",\r\n    \"endTime\": \"2018-09-26T00:24:50+00:00\",\r\n    \"userId\": \"6aa080743b27d1a9a67afd2683ede38a\",\r\n    \"channelId\": \"987fb87a4f7b4d867c1f391d38ec98b2\",\r\n    \"shareId\": null,\r\n    \"deviceId\": \"bdf8ada28095551a705737900d7c5bf3\",\r\n    \"divisionId\": null,\r\n    \"assetId\": \"44ecbff1f7427e1fdc2bc3e1ad47f827\",\r\n    \"contactId\": null,\r\n    \"type\": \"asset-in-app-viewed\",\r\n    \"page\": 1\r\n  },\r\n  {\r\n    \"eventId\": \"a835795db0f7a13ab03be8e41bde7f5666f3195ab9eaf651a159d6ce22b04cc7\",\r\n    \"startTime\": \"2018-09-26T00:25:45+00:00\",\r\n    \"endTime\": \"2018-09-26T00:25:49+00:00\",\r\n    \"userId\": \"6aa080743b27d1a9a67afd2683ede38a\",\r\n    \"channelId\": \"7ae82...**' isn't supported.**\r\nclientRequestId: 7d9cbf4d-b50f-4905-8825-554f7e48d54c",
      "source": "sql-logic-cp-centralus.logic-ase-centralus.p.azurewebsites.net"
    }
  }
}

【问题讨论】:

    标签: sql-server-2016 azure-logic-apps


    【解决方案1】:

    最后我能够通过对逻辑应用和存储过程进行一些调试来解决这个问题。

    修复:问题在于将逻辑应用的“解析 JSON”输出作为输入传递给存储过程。我使用字符串转换功能来解决这个问题。

    我希望 Logic Apps 未来版本能够提供更具体的异常详细信息,而不是一般的网关错误错误。

    【讨论】:

    • 非常感谢您。错误说网关不好,所以我什至没有注意其他任何事情。我的问题原来是试图将 REST XML 输出放入 SQL Server 中的 XML 类型列。当我将列更改为期望字符串时,不再出现错误。
    • 很高兴它有帮助!
    猜你喜欢
    • 2019-05-25
    • 2011-11-04
    • 1970-01-01
    • 1970-01-01
    • 2016-05-20
    • 2019-04-20
    • 2011-11-07
    • 1970-01-01
    • 2013-12-05
    相关资源
    最近更新 更多