I'm trying to configure a Supabase wrapper to connect to my SQL Server database. After filling out the configuration form in Supabase and adding the columns for the table, I receive a 504 Gateway Timeout error when trying to view the table in the Supabase table editor.
Configuration Details:
Wrapper Name: nldourum
Connection String:
Server=<IP_ADDRESS>,1433;User=<USER>;Password=<PASSWORD>;Database=<DB_NAME>;IntegratedSecurity=false;TrustServerCertificate=true;encrypt=false;ApplicationName=wrappers
Table and Schema Selection:
Microsoft SQL Server Table: dbo.ccusto Schema for the foreign table: public Table name: ccusto MSSQL Table: dbo.ccusto
Configured Columns:
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 Query:
Using Microsoft SQL Server Management Studio (SSMS), I ran the following query and successfully retrieved data:
SELECT TOP (1000) [ccustoId]
,[ccustoNumero]
,[ccustoEmpresa]
,[ccustoNome]
,[ccustoTipocompra]
,[ccustoTipodiverso]
,[ccustoTipovenda]
FROM [NLDourum].[dbo].[ccusto]
Error:
When trying to view the ccusto table in the Supabase table editor, I get the following error:
<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
</body>
</html>
Question:
What could be causing the 504 Gateway Timeout error when trying to view the ccusto table in Supabase, and how can I resolve it?
Troubleshooting Steps Taken:
Network Connectivity: Verified that the server hosting the Supabase instance can connect to the SQL Server (ping and telnet to port 1433 are successful).
SQL Server Configuration:
Enabled remote connections in SQL Server. Verified that SQL Server Browser service is running. Ensured TCP/IP is enabled in SQL Server Configuration Manager.
- Timeout Settings:
Checked and adjusted timeout settings in SQL Server.
- SSL and Certificates:
Ensured TrustServerCertificate=true and correct SSL configurations.
- Test with Simple Connection:
Attempted to connect with a simpler table to rule out table-specific issues.
UPDATE 15/07/2024
Tried to connect a Supabase project to another Supabase PostgreSQL database using postgres_fdw and it worked perfectly. This indicates that the issue is specific to the SQL Server connection.
I also tried to connect to the SQL Server database using tds_fdw from a local PostgreSQL instance and it worked, confirming that my SQL Server database is functional. The issue seems to be related to the Supabase wrapper's ability to connect to the SQL Server.
Any suggestions or insights on resolving the connection issue with the Supabase wrapper would be greatly appreciated