coolify icon indicating copy to clipboard operation
coolify copied to clipboard

[Bug]: Realtime in Supabase is not working - Coolify overrides a required container_name in docker-compose.yml

Open actraiser opened this issue 2 months ago • 19 comments

Description

When using realtime in Supabase, the Kong-Container receives the request from the client and tries to connect to realtime-dev.supabase-realtime but cannot resolve this. I can see in the docker-compose-file that there is the correct "container_name" under the realtime-section:

  realtime-dev:
    image: 'supabase/realtime:v2.28.23'
    container_name: realtime-dev.supabase-realtime

But when switching to the "show deployable docker compose" view, this is tranformed to:

  realtime-dev:
    image: 'supabase/realtime:v2.28.23'
    container_name: realtime-dev-q4s4w4k

Maybe the underlying problem is the format of "realtime-dev.supabase-realtime" (with the dot inbetween) and Coolify strips off everything after that dot when transforming? Or coolify checks if the service-name is string-included in the container_name and then uses the former. I don't know - probably something obvious to spot.

Anyway, here is the Kong log when trying to access realtime features via web socket:

2024/04/24 10:25:46 [error] 1193#0: *65269 [lua] init.lua:310: execute(): DNS resolution failed: dns server error: 3 name error. Tried: ["(short)realtime-dev.supabase-realtime:(na) - cache-miss","realtime-dev.supabase-realtime:1 - cache-hit/dns server error: 3 name error","realtime-dev.supabase-realtime:5 - cache-hit/dns server error: 3 name error"], client: 172.18.0.21, server: kong, request: "GET /realtime/v1/websocket?apikey=<...>&vsn=1.0.0 HTTP/1.1",

So, I believe when Coolify overrides the container-name, the name that kong expects (realtime-dev.supabase-realtime) to handle/proxx the realtime connections does not exist anymore.

Minimal Reproduction (if possible, example repository)

Install Supabase from Server Enable Realtime on any table and subscribe to the table from a client connected to that supabase instance

Exception or Error

Browser will show failed websocket connections, kong will show resolve errors:

2024/04/24 10:25:46 [error] 1193#0: *65269 [lua] init.lua:310: execute(): DNS resolution failed: dns server error: 3 name error. Tried: ["(short)realtime-dev.supabase-realtime:(na) - cache-miss","realtime-dev.supabase-realtime:1 - cache-hit/dns server error: 3 name error","realtime-dev.supabase-realtime:5 - cache-hit/dns server error: 3 name error"], client: 172.18.0.21, server: kong, request: "GET /realtime/v1/websocket?apikey=<...>&vsn=1.0.0 HTTP/1.1",

Version

v4.0.0-beta.265

actraiser avatar Apr 24 '24 11:04 actraiser

Facing same issue

r3dm4n avatar Apr 24 '24 13:04 r3dm4n

Facing same issue

galacoder avatar Apr 26 '24 17:04 galacoder

Can you change the container name it looks for by way of environment variable?

Geczy avatar Apr 28 '24 23:04 Geczy