You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

配置Supabase Wrapper连接SQL Server时出现504网关超时错误

Supabase Wrapper连接SQL Server出现504 Gateway Timeout问题排查

问题概述

配置Supabase Wrapper连接SQL Server数据库,完成配置表单填写和列映射后,在Supabase表编辑器中查看ccusto表时,触发504 Gateway Timeout错误。

配置详情

  • Wrapper名称:nldourum
  • 连接字符串:
    Server=<IP_ADDRESS>,1433;User=<USER>;Password=<PASSWORD>;Database=<DB_NAME>;IntegratedSecurity=false;TrustServerCertificate=true;encrypt=false;ApplicationName=wrappers
    
  • 表与架构映射:
    • SQL Server源表:dbo.ccusto
    • Supabase外部表架构:public
    • Supabase外部表名:ccusto
  • 已配置列映射:
    Name: ccustoNumero, Type: text
    Name: ccustoEmpresa, Type: text
    Name: ccustoNome, Type: text
    Name: ccustoTipocompra, Type: text
    Name: ccustoTipodiverso, Type: text
    Name: ccustoTipovenda, Type: text
    Name: ccustoId, Type: bigint
    

验证情况

SQL Server端通过SSMS执行以下查询可正常返回数据:

SELECT TOP (1000) [ccustoId]
      ,[ccustoNumero]
      ,[ccustoEmpresa]
      ,[ccustoNome]
      ,[ccustoTipocompra]
      ,[ccustoTipodiverso]
      ,[ccustoTipovenda]
  FROM [NLDourum].[dbo].[ccusto]

错误信息

在Supabase表编辑器查看ccusto表时返回:

<html>
  <head><title>504 Gateway Time-out</title></head>
  <body>
    <center><h1>504 Gateway Time-out</h1></center>
  </body>
</html>

已完成的排查步骤

  • 网络连通性:Supabase服务器可ping通SQL Server,telnet 1433端口连接成功
  • SQL Server配置:已启用远程连接,SQL Server Browser服务运行正常,TCP/IP协议已启用
  • 超时设置:调整过SQL Server的超时参数
  • SSL配置:确认TrustServerCertificate=true且SSL相关配置正确
  • 表测试:尝试连接结构更简单的表,问题依旧存在
  • 补充验证(2024年7月15日更新):
    • 使用postgres_fdw连接另一个Supabase PostgreSQL实例正常,排除Supabase FDW基础功能问题
    • 本地PostgreSQL通过tds_fdw连接目标SQL Server正常,排除SQL Server自身功能问题

待解决问题

Supabase Wrapper连接SQL Server时触发504超时的具体原因是什么?该如何修复?

内容的提问来源于stack exchange,提问作者Vitor Rocha Tech Cascata

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 04:57:17