supabase-community / supabase-on-aws

Self-hosted Supabase on AWS
Apache License 2.0
417 stars 61 forks source link

Realtime WebSocket connection fails #66

Closed salmoro closed 1 year ago

salmoro commented 1 year ago

Bug report

Describe the bug

All works well other than realtime pg connection. browser throws the following Screenshot 2023-07-31 at 6 50 18 PM

When I look on AWS ECS on the RealtimeService logs I see a lot of

project=realtime external_id=realtime [error] Auth error: tenant `realtime` not found`

When I look at the realtime.tenants table I only see one entry and the name is realtime-dev so I suspect this is the issue.

If this is the issue, what's a good way to solve this other than editing this field directly in the DB?

mats16 commented 1 year ago

@salmoro realtime-dev may be the default tenant. https://github.com/supabase/realtime/tree/main#server-setup

You need to use the default tenant or create a new tenant. Can you try it?

salmoro commented 1 year ago

@mats16 I'm having a hard time figuring this out (can't reach REST Api and can't modify tenant in RealtimeClient). is this supposed to work out of the box?

mats16 commented 1 year ago

@salmoro Sorry, I have identified the cause of the problem.

The subdomain of supabase-realtime is used to determine tenat_id. The domain name must be set to something like realtime-dev.supabase.internal.

I already fix it on latest version. Please use it.