supabase / realtime

Broadcast, Presence, and Postgres Changes via WebSockets

Home Page:https://supabase.com/realtime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

supabase realtime not working

bigbizze opened this issue · comments

Bug report

#746

I believe it's related to or the same issue as this.

Describe the bug

image

Connecting the websocket when using supabase realtime fails

To Reproduce

#746 (comment)

I went to 1.113.2 (latest) and this worked. I had to do the following, in this order (if it helps anyone):

  • supabase stop --no-backup
  • brew upgrade supabase
  • supabase start
  • supabase db reset <- my realtime schema was corrupted in 1.112.0

Solved the issue on my end, going to close this.

this did not solve the issue for me.

my supabase version is 1.113.2

after running the above commands, i checked the version for my realtime container by using docker inngest <container id> and it is public.ecr.aws/supabase/realtime:v2.25.35

notably, and similar to the issues here supabase/supabase#12544 both my _realtime and realtime schemas have no tables defined on them when i view them in the studio
image

image

when i run pg_dump "postgresql://supabase_admin:postgres@localhost:54322/postgres" --schema realtime

the output is:

--
-- PostgreSQL database dump
--

-- Dumped from database version 15.1 (Ubuntu 15.1-1.pgdg20.04+1)
-- Dumped by pg_dump version 15.5 (Ubuntu 15.5-1.pgdg22.04+1)

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

--
-- Name: realtime; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA realtime;


ALTER SCHEMA realtime OWNER TO postgres;

--
-- PostgreSQL database dump complete
--

and when i run: pg_dump "postgresql://supabase_admin:postgres@localhost:54322/postgres" --schema _realtime

the output is:

--
-- PostgreSQL database dump
--

-- Dumped from database version 15.1 (Ubuntu 15.1-1.pgdg20.04+1)
-- Dumped by pg_dump version 15.5 (Ubuntu 15.5-1.pgdg22.04+1)

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

--
-- Name: _realtime; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA _realtime;


ALTER SCHEMA _realtime OWNER TO postgres;

SET default_tablespace = '';

SET default_table_access_method = heap;

--
-- Name: extensions; Type: TABLE; Schema: _realtime; Owner: supabase_admin
--

CREATE TABLE _realtime.extensions (
    id uuid NOT NULL,
    type text,
    settings jsonb,
    tenant_external_id text,
    inserted_at timestamp(0) without time zone NOT NULL,
    updated_at timestamp(0) without time zone NOT NULL
);


ALTER TABLE _realtime.extensions OWNER TO supabase_admin;

--
-- Name: schema_migrations; Type: TABLE; Schema: _realtime; Owner: supabase_admin
--

CREATE TABLE _realtime.schema_migrations (
    version bigint NOT NULL,
    inserted_at timestamp(0) without time zone
);


ALTER TABLE _realtime.schema_migrations OWNER TO supabase_admin;

--
-- Name: tenants; Type: TABLE; Schema: _realtime; Owner: supabase_admin
--

CREATE TABLE _realtime.tenants (
    id uuid NOT NULL,
    name text,
    external_id text,
    jwt_secret text,
    max_concurrent_users integer DEFAULT 200 NOT NULL,
    inserted_at timestamp(0) without time zone NOT NULL,
    updated_at timestamp(0) without time zone NOT NULL,
    max_events_per_second integer DEFAULT 100 NOT NULL,
    postgres_cdc_default text DEFAULT 'postgres_cdc_rls'::text,
    max_bytes_per_second integer DEFAULT 100000 NOT NULL,
    max_channels_per_client integer DEFAULT 100 NOT NULL,
    max_joins_per_second integer DEFAULT 500 NOT NULL,
    suspend boolean DEFAULT false
);


ALTER TABLE _realtime.tenants OWNER TO supabase_admin;

--
-- Data for Name: extensions; Type: TABLE DATA; Schema: _realtime; Owner: supabase_admin
--

COPY _realtime.extensions (id, type, settings, tenant_external_id, inserted_at, updated_at) FROM stdin;
58130c7d-9e73-43ec-9e08-af7986875447	postgres_cdc_rls	{"region": "us-east-1", "db_host": "+5JkR7EPoJsAtjz+cdk/ZPFhkdWGR4wQX4lYC4ulOel/kGxTTOC5bwX/RP2J3g7W", "db_name": "sWBpZNdjggEPTQVlI52Zfw==", "db_port": "+enMDFi1J/3IrrquHHwUmA==", "db_user": "uxbEq/zz8DXVD53TOI1zmw==", "slot_name": "supabase_realtime_replication_slot", "ip_version": 4, "db_password": "sWBpZNdjggEPTQVlI52Zfw==", "publication": "supabase_realtime", "ssl_enforced": false, "poll_interval_ms": 100, "poll_max_changes": 100, "poll_max_record_bytes": 1048576}	realtime-dev	2023-11-21 16:47:58	2023-11-21 16:47:58
\.


--
-- Data for Name: schema_migrations; Type: TABLE DATA; Schema: _realtime; Owner: supabase_admin
--

COPY _realtime.schema_migrations (version, inserted_at) FROM stdin;
20210706140551	2023-11-21 16:43:32
20220329161857	2023-11-21 16:43:32
20220410212326	2023-11-21 16:43:32
20220506102948	2023-11-21 16:43:32
20220527210857	2023-11-21 16:43:32
20220815211129	2023-11-21 16:43:32
20220815215024	2023-11-21 16:43:32
20220818141501	2023-11-21 16:43:32
20221018173709	2023-11-21 16:43:32
20221102172703	2023-11-21 16:43:32
20221223010058	2023-11-21 16:43:32
20230110180046	2023-11-21 16:43:32
20230810220907	2023-11-21 16:43:32
20230810220924	2023-11-21 16:43:32
20231024094642	2023-11-21 16:43:32
\.


--
-- Data for Name: tenants; Type: TABLE DATA; Schema: _realtime; Owner: supabase_admin
--

COPY _realtime.tenants (id, name, external_id, jwt_secret, max_concurrent_users, inserted_at, updated_at, max_events_per_second, postgres_cdc_default, max_bytes_per_second, max_channels_per_client, max_joins_per_second, suspend) FROM stdin;
0af72a10-ac6b-40cf-a6b9-620440405dae	realtime-dev	realtime-dev	iNjicxc4+llvc9wovDvqymwfnj9teWMlyOIbJ8Fh6j2WNU8CIJ2ZgjR6MUIKqSmeDmvpsKLsZ9jgXJmQPpwL8w==	200	2023-11-21 16:47:58	2023-11-21 16:47:58	100	postgres_cdc_rls	100000	100	100	f
\.


--
-- Name: extensions extensions_pkey; Type: CONSTRAINT; Schema: _realtime; Owner: supabase_admin
--

ALTER TABLE ONLY _realtime.extensions
    ADD CONSTRAINT extensions_pkey PRIMARY KEY (id);


--
-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: _realtime; Owner: supabase_admin
--

ALTER TABLE ONLY _realtime.schema_migrations
    ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);


--
-- Name: tenants tenants_pkey; Type: CONSTRAINT; Schema: _realtime; Owner: supabase_admin
--

ALTER TABLE ONLY _realtime.tenants
    ADD CONSTRAINT tenants_pkey PRIMARY KEY (id);


--
-- Name: extensions_tenant_external_id_type_index; Type: INDEX; Schema: _realtime; Owner: supabase_admin
--

CREATE UNIQUE INDEX extensions_tenant_external_id_type_index ON _realtime.extensions USING btree (tenant_external_id, type);


--
-- Name: tenants_external_id_index; Type: INDEX; Schema: _realtime; Owner: supabase_admin
--

CREATE UNIQUE INDEX tenants_external_id_index ON _realtime.tenants USING btree (external_id);


--
-- Name: extensions extensions_tenant_external_id_fkey; Type: FK CONSTRAINT; Schema: _realtime; Owner: supabase_admin
--

ALTER TABLE ONLY _realtime.extensions
    ADD CONSTRAINT extensions_tenant_external_id_fkey FOREIGN KEY (tenant_external_id) REFERENCES _realtime.tenants(external_id) ON DELETE CASCADE;


--
-- PostgreSQL database dump complete
--

System information

  • OS: ubuntu
  • Browser chrome
  • Version of supabase-js: 1.113.2
  • Version of Node.js: v21.2.0

Additional context

When i do

psql "postgresql://supabase_admin:postgres@localhost:54322/postgres" <<EOF
  SELECT * FROM _realtime.schema_migrations;
EOF

i can see that the table exists and get data back, so it seems like at least the permissions for supabase studio are off

Upon more investigation, it appears like it's unrelated to the above, and seems to happen when supabase.auth.refreshSession is called on the createBrowserClient client from the "@supabase/ssr" library

Steps to reproduce (using what is basically a copy and paste of your SSR auth tutorial):

  1. User logs in using Google (everything works fine)
  2. Refresh page, call supabase.auth.refreshToken in a useEffect
  3. Regular queries and requests against DB work as expected, but realtime fails to connect

from what I understood in the pg dump you don't have all migrations in the table (should have been 31) so something broke which could be the reason for this weirdness.

are you able to provide the realtime container logs?

Hello @filipecabaco,

I'm having a issue enabling the realtime for some tables in the supabase studio.

When go to replication section get the following screen.
CleanShot 2023-11-22 at 22 48 49@2x

If I try enable from table the realtime getting another issue.
CleanShot 2023-11-22 at 22 49 28@2x

Here is the log of the container realtime-dev.supabase_realtime - public.ecr.aws/supabase/realtime:v2.25.35

2023-11-22 22:36:15 04:36:15.062 [info] create table tenants
2023-11-22 22:36:15 04:36:15.066 [info] create index tenants_external_id_index
2023-11-22 22:36:15 04:36:15.069 [info] == Migrated 20210706140551 in 0.0s
2023-11-22 22:36:15 04:36:15.082 [info] == Running 20220329161857 Realtime.Repo.Migrations.AddExtensionsTable.change/0 forward
2023-11-22 22:36:15 04:36:15.082 [info] create table extensions
2023-11-22 22:36:15 04:36:15.085 [info] create index extensions_tenant_external_id_type_index
2023-11-22 22:36:15 04:36:15.085 [info] == Migrated 20220329161857 in 0.0s
2023-11-22 22:36:15 04:36:15.086 [info] == Running 20220410212326 Realtime.Repo.Migrations.AddTenantMaxEps.up/0 forward
2023-11-22 22:36:15 04:36:15.086 [info] alter table tenants
2023-11-22 22:36:15 04:36:15.092 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.092 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.092 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.092 [info] == Migrated 20220410212326 in 0.0s
2023-11-22 22:36:15 04:36:15.093 [info] == Running 20220506102948 Realtime.Repo.Migrations.RenamePollIntervalToPollIntervalMs.up/0 forward
2023-11-22 22:36:15 04:36:15.094 [warning] Replica region not found, defaulting to Realtime.Repo
2023-11-22 22:36:15 04:36:15.099 [debug] QUERY OK source="extensions" db=0.1ms
2023-11-22 22:36:15 SELECT e0."id", e0."type", e0."settings", e0."tenant_external_id", e0."inserted_at", e0."updated_at" FROM "extensions" AS e0 WHERE (e0."type" = $1) ["postgres_cdc_rls"]
2023-11-22 22:36:15 04:36:15.099 [info] == Migrated 20220506102948 in 0.0s
2023-11-22 22:36:15 04:36:15.100 [info] == Running 20220527210857 Realtime.Repo.Migrations.AddExternalIdUniqIndex.change/0 forward
2023-11-22 22:36:15 04:36:15.100 [info] execute "alter table tenants add constraint uniq_external_id unique (external_id)"
2023-11-22 22:36:15 04:36:15.104 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.104 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.104 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.104 [info] == Migrated 20220527210857 in 0.0s
2023-11-22 22:36:15 04:36:15.104 [info] == Running 20220815211129 Realtime.Repo.Migrations.NewMaxEventsPerSecondDefault.change/0 forward
2023-11-22 22:36:15 04:36:15.104 [info] alter table tenants
2023-11-22 22:36:15 04:36:15.110 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.110 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.110 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.110 [info] == Migrated 20220815211129 in 0.0s
2023-11-22 22:36:15 04:36:15.111 [info] == Running 20220815215024 Realtime.Repo.Migrations.SetCurrentMaxEventsPerSecond.change/0 forward
2023-11-22 22:36:15 04:36:15.111 [info] execute "update tenants set max_events_per_second = 1000"
2023-11-22 22:36:15 04:36:15.111 [info] == Migrated 20220815215024 in 0.0s
2023-11-22 22:36:15 04:36:15.112 [info] == Running 20220818141501 Realtime.Repo.Migrations.ChangeLimitsDefaults.change/0 forward
2023-11-22 22:36:15 04:36:15.112 [info] alter table tenants
2023-11-22 22:36:15 04:36:15.115 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.115 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.115 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.115 [info] == Migrated 20220818141501 in 0.0s
2023-11-22 22:36:15 04:36:15.116 [info] == Running 20221018173709 Realtime.Repo.Migrations.AddCdcDefault.up/0 forward
2023-11-22 22:36:15 04:36:15.116 [info] alter table tenants
2023-11-22 22:36:15 04:36:15.119 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.119 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.119 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.119 [info] == Migrated 20221018173709 in 0.0s
2023-11-22 22:36:15 04:36:15.120 [info] == Running 20221102172703 Realtime.Repo.Migrations.RenamePgType.up/0 forward
2023-11-22 22:36:15 04:36:15.120 [info] execute "update extensions set type = 'postgres_cdc_rls'"
2023-11-22 22:36:15 04:36:15.120 [info] == Migrated 20221102172703 in 0.0s
2023-11-22 22:36:15 04:36:15.121 [info] == Running 20221223010058 Realtime.Repo.Migrations.DropTenantsUniqExternalIdIndex.change/0 forward
2023-11-22 22:36:15 04:36:15.121 [info] execute "ALTER TABLE IF EXISTS tenants DROP CONSTRAINT IF EXISTS uniq_external_id"
2023-11-22 22:36:15 04:36:15.124 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.124 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.124 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.124 [info] == Migrated 20221223010058 in 0.0s
2023-11-22 22:36:15 04:36:15.125 [info] == Running 20230110180046 Realtime.Repo.Migrations.AddLimitsFieldsToTenants.change/0 forward
2023-11-22 22:36:15 04:36:15.125 [info] alter table tenants
2023-11-22 22:36:15 04:36:15.128 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.128 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.128 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.128 [info] == Migrated 20230110180046 in 0.0s
2023-11-22 22:36:15 04:36:15.129 [info] == Running 20230810220907 Realtime.Repo.Migrations.AlterTenantsTableColumnsToText.change/0 forward
2023-11-22 22:36:15 04:36:15.129 [info] alter table tenants
2023-11-22 22:36:15 04:36:15.133 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.133 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.133 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.133 [info] == Migrated 20230810220907 in 0.0s
2023-11-22 22:36:15 04:36:15.133 [info] == Running 20230810220924 Realtime.Repo.Migrations.AlterExtensionsTableColumnsToText.change/0 forward
2023-11-22 22:36:15 04:36:15.133 [info] alter table extensions
2023-11-22 22:36:15 04:36:15.137 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.137 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.137 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.137 [info] == Migrated 20230810220924 in 0.0s
2023-11-22 22:36:15 04:36:15.138 [info] == Running 20231024094642 :"Elixir.Realtime.Repo.Migrations.Add-tenant-suspend-flag".change/0 forward
2023-11-22 22:36:15 04:36:15.138 [info] alter table tenants
2023-11-22 22:36:15 04:36:15.141 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.141 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.141 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.141 [info] == Migrated 20231024094642 in 0.0s
2023-11-22 22:36:15 04:36:15.422 [debug] QUERY OK db=0.5ms queue=60.8ms idle=0.0ms
2023-11-22 22:36:15 begin []
2023-11-22 22:36:15 04:36:15.430 [debug] QUERY OK source="tenants" db=0.2ms
2023-11-22 22:36:15 SELECT t0."id", t0."name", t0."external_id", t0."jwt_secret", t0."postgres_cdc_default", t0."max_concurrent_users", t0."max_events_per_second", t0."max_bytes_per_second", t0."max_channels_per_client", t0."max_joins_per_second", t0."suspend", t0."inserted_at", t0."updated_at" FROM "tenants" AS t0 WHERE (t0."external_id" = $1) ["realtime-dev"]
2023-11-22 22:36:15 04:36:15.451 [debug] QUERY OK db=0.8ms
2023-11-22 22:36:15 INSERT INTO "tenants" ("external_id","jwt_secret","max_bytes_per_second","max_channels_per_client","max_concurrent_users","max_events_per_second","max_joins_per_second","name","suspend","inserted_at","updated_at","id") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12) ["realtime-dev", "iNjicxc4+llvc9wovDvqymwfnj9teWMlyOIbJ8Fh6j2WNU8CIJ2ZgjR6MUIKqSmeDmvpsKLsZ9jgXJmQPpwL8w==", 100000, 100, 200, 100, 100, "realtime-dev", false, ~N[2023-11-23 04:36:15], ~N[2023-11-23 04:36:15], <<170, 107, 4, 168, 98, 247, 75, 111, 167, 183, 8, 138, 72, 196, 95, 145>>]
2023-11-22 22:36:15 04:36:15.455 [debug] QUERY OK db=2.7ms
2023-11-22 22:36:15 INSERT INTO "extensions" ("settings","tenant_external_id","type","inserted_at","updated_at","id") VALUES ($1,$2,$3,$4,$5,$6) [%{"db_host" => "dcYFpB9IQD8+XVW8Neunyw==", "db_name" => "sWBpZNdjggEPTQVlI52Zfw==", "db_password" => "sWBpZNdjggEPTQVlI52Zfw==", "db_port" => "+enMDFi1J/3IrrquHHwUmA==", "db_user" => "uxbEq/zz8DXVD53TOI1zmw==", "ip_version" => 4, "poll_interval_ms" => 100, "poll_max_changes" => 100, "poll_max_record_bytes" => 1048576, "publication" => "supabase_realtime", "region" => "us-east-1", "slot_name" => "supabase_realtime_replication_slot", "ssl_enforced" => false}, "realtime-dev", "postgres_cdc_rls", ~N[2023-11-23 04:36:15], ~N[2023-11-23 04:36:15], <<223, 158, 248, 22, 108, 48, 72, 63, 136, 250, 167, 186, 130, 37, 109, 7>>]
2023-11-22 22:36:15 04:36:15.455 [debug] QUERY OK db=0.6ms
2023-11-22 22:36:15 commit []
2023-11-22 22:36:16 04:36:16.032 [notice]     :alarm_handler: {:set, {:system_memory_high_watermark, []}}
2023-11-22 22:36:16 04:36:16.068 [info] Elixir.Realtime.SignalHandler is being initialized...
2023-11-22 22:36:16 04:36:16.068 [notice] SYN[realtime@127.0.0.1] Adding node to scope <Elixir.Realtime.Tenants.Connect>
2023-11-22 22:36:16 04:36:16.068 [notice] SYN[realtime@127.0.0.1] Creating tables for scope <Elixir.Realtime.Tenants.Connect>
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1|registry<Elixir.Realtime.Tenants.Connect>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1|pg<Elixir.Realtime.Tenants.Connect>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1] Adding node to scope <users>
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1] Creating tables for scope <users>
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1|registry<users>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1|pg<users>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1] Adding node to scope <Elixir.RegionNodes>
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1] Creating tables for scope <Elixir.RegionNodes>
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1|registry<Elixir.RegionNodes>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1|pg<Elixir.RegionNodes>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.069 [warning] Replica region not found, defaulting to Realtime.Repo
2023-11-22 22:36:16 04:36:16.215 [info] Running RealtimeWeb.Endpoint with cowboy 2.10.0 at :::4000 (http)
2023-11-22 22:36:16 04:36:16.222 [info] Access RealtimeWeb.Endpoint at http://realtime.fly.dev
2023-11-22 22:36:16 04:36:16.222 [notice] SYN[realtime@127.0.0.1] Adding node to scope <Elixir.PostgresCdcStream>
2023-11-22 22:36:16 04:36:16.222 [notice] SYN[realtime@127.0.0.1] Creating tables for scope <Elixir.PostgresCdcStream>
2023-11-22 22:36:16 04:36:16.222 [notice] SYN[realtime@127.0.0.1|registry<Elixir.PostgresCdcStream>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.222 [notice] SYN[realtime@127.0.0.1|pg<Elixir.PostgresCdcStream>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.223 [notice] SYN[realtime@127.0.0.1] Adding node to scope <Elixir.Extensions.PostgresCdcRls>
2023-11-22 22:36:16 04:36:16.223 [notice] SYN[realtime@127.0.0.1] Creating tables for scope <Elixir.Extensions.PostgresCdcRls>
2023-11-22 22:36:16 04:36:16.223 [notice] SYN[realtime@127.0.0.1|registry<Elixir.Extensions.PostgresCdcRls>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.223 [notice] SYN[realtime@127.0.0.1|pg<Elixir.Extensions.PostgresCdcRls>] Discovering the cluster
2023-11-22 22:36:19 04:36:19.069 [debug] Tzdata polling for update.
2023-11-22 22:36:19 04:36:19.815 [info] tzdata release in place is from a file last modified Fri, 22 Oct 2021 02:20:47 GMT. Release file on server was last modified Tue, 28 Mar 2023 20:25:39 GMT.
2023-11-22 22:36:19 04:36:19.815 [debug] Tzdata downloading new data from https://data.iana.org/time-zones/tzdata-latest.tar.gz
2023-11-22 22:36:20 04:36:20.366 [debug] Tzdata data downloaded. Release version 2023c.
2023-11-22 22:36:20 04:36:20.678 [info] Tzdata has updated the release from 2021e to 2023c
2023-11-22 22:36:20 04:36:20.678 [debug] Tzdata deleting ETS table for version 2021e
2023-11-22 22:36:20 04:36:20.679 [debug] Tzdata deleting ETS table file for version 2021e

I'm also getting this issue after deleting all containers and running supabase start. Is there a workaround? Container logs are below:

2023-11-23 07:42:05 07:42:05.747 [info] Migrations already up
2023-11-23 07:42:06 07:42:06.355 [debug] QUERY OK db=1.7ms queue=96.8ms idle=0.0ms
2023-11-23 07:42:06 begin []
2023-11-23 07:42:06 07:42:06.381 [debug] QUERY OK source="tenants" db=6.9ms
2023-11-23 07:42:06 SELECT t0."id", t0."name", t0."external_id", t0."jwt_secret", t0."postgres_cdc_default", t0."max_concurrent_users", t0."max_events_per_second", t0."max_bytes_per_second", t0."max_channels_per_client", t0."max_joins_per_second", t0."suspend", t0."inserted_at", t0."updated_at" FROM "tenants" AS t0 WHERE (t0."external_id" = $1) ["realtime-dev-tenant"]
2023-11-23 07:42:06 07:42:06.406 [debug] QUERY OK source="extensions" db=0.4ms
2023-11-23 07:42:06 DELETE FROM "extensions" AS e0 WHERE (e0."tenant_external_id" = $1) ["realtime-dev-tenant"]
2023-11-23 07:42:06 07:42:06.409 [debug] QUERY OK db=0.4ms
2023-11-23 07:42:06 DELETE FROM "tenants" WHERE "id" = $1 [<<169, 56, 97, 15, 147, 116, 74, 187, 187, 104, 204, 81, 212, 40, 140, 210>>]
2023-11-23 07:42:06 07:42:06.427 [debug] QUERY OK db=0.2ms
2023-11-23 07:42:06 INSERT INTO "tenants" ("external_id","jwt_secret","max_bytes_per_second","max_channels_per_client","max_concurrent_users","max_events_per_second","max_joins_per_second","name","suspend","inserted_at","updated_at","id") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12) ["realtime-dev-tenant", "iNjicxc4+llvc9wovDvqymwfnj9teWMlyOIbJ8Fh6j2WNU8CIJ2ZgjR6MUIKqSmeDmvpsKLsZ9jgXJmQPpwL8w==", 100000, 100, 200, 100, 100, "realtime-dev-tenant", false, ~N[2023-11-23 07:42:06], ~N[2023-11-23 07:42:06], <<41, 4, 138, 237, 58, 62, 79, 209, 132, 6, 194, 128, 9, 135, 19, 35>>]
2023-11-23 07:42:06 07:42:06.435 [debug] QUERY OK db=5.1ms
2023-11-23 07:42:06 INSERT INTO "extensions" ("settings","tenant_external_id","type","inserted_at","updated_at","id") VALUES ($1,$2,$3,$4,$5,$6) [%{"db_host" => "WduM1JTp+Ah9s/HVBIpbqg==", "db_name" => "sWBpZNdjggEPTQVlI52Zfw==", "db_password" => "sWBpZNdjggEPTQVlI52Zfw==", "db_port" => "+enMDFi1J/3IrrquHHwUmA==", "db_user" => "sWBpZNdjggEPTQVlI52Zfw==", "ip_version" => 4, "poll_interval_ms" => 100, "poll_max_changes" => 100, "poll_max_record_bytes" => 1048576, "publication" => "supabase_realtime", "region" => "us-east-1", "slot_name" => "supabase_realtime_replication_slot"}, "realtime-dev-tenant", "postgres_cdc_rls", ~N[2023-11-23 07:42:06], ~N[2023-11-23 07:42:06], <<48, 119, 219, 235, 156, 163, 76, 28, 158, 71, 26, 16, 252, 160, 111, 170>>]
2023-11-23 07:42:06 07:42:06.441 [debug] QUERY OK db=6.1ms
2023-11-23 07:42:06 commit []
2023-11-23 07:42:06 07:42:06.441 [debug] QUERY OK db=0.3ms idle=96.1ms
2023-11-23 07:42:06 begin []
2023-11-23 07:42:06 07:42:06.445 [debug] QUERY OK db=1.1ms
2023-11-23 07:42:06 drop publication if exists supabase_realtime []
2023-11-23 07:42:06 07:42:06.446 [debug] QUERY OK db=0.9ms
2023-11-23 07:42:06 drop table if exists public.test_tenant; []
2023-11-23 07:42:06 07:42:06.451 [debug] QUERY OK db=5.3ms
2023-11-23 07:42:06 create table public.test_tenant (
2023-11-23 07:42:06         id SERIAL PRIMARY KEY,
2023-11-23 07:42:06         details text
2023-11-23 07:42:06         ); []
2023-11-23 07:42:06 07:42:06.452 [debug] QUERY OK db=0.2ms
2023-11-23 07:42:06 grant all on table public.test_tenant to anon; []
2023-11-23 07:42:06 07:42:06.452 [debug] QUERY OK db=0.3ms
2023-11-23 07:42:06 grant all on table public.test_tenant to postgres; []
2023-11-23 07:42:06 07:42:06.453 [debug] QUERY OK db=0.3ms
2023-11-23 07:42:06 grant all on table public.test_tenant to authenticated; []
2023-11-23 07:42:06 07:42:06.453 [debug] QUERY OK db=0.3ms
2023-11-23 07:42:06 create publication supabase_realtime for table public.test_tenant []
2023-11-23 07:42:06 07:42:06.455 [debug] QUERY OK db=1.5ms
2023-11-23 07:42:06 commit []
2023-11-23 07:42:07 07:42:07.756 [info] Elixir.Realtime.SignalHandler is being initialized...
2023-11-23 07:42:07 07:42:07.757 [notice] SYN[realtime@127.0.0.1] Adding node to scope <Elixir.Realtime.Tenants.Connect>
2023-11-23 07:42:07 07:42:07.757 [notice] SYN[realtime@127.0.0.1] Creating tables for scope <Elixir.Realtime.Tenants.Connect>
2023-11-23 07:42:07 07:42:07.757 [notice] SYN[realtime@127.0.0.1|registry<Elixir.Realtime.Tenants.Connect>] Discovering the cluster
2023-11-23 07:42:07 07:42:07.757 [notice] SYN[realtime@127.0.0.1|pg<Elixir.Realtime.Tenants.Connect>] Discovering the cluster
2023-11-23 07:42:07 07:42:07.757 [notice] SYN[realtime@127.0.0.1] Adding node to scope <users>
2023-11-23 07:42:07 07:42:07.757 [notice] SYN[realtime@127.0.0.1] Creating tables for scope <users>
2023-11-23 07:42:07 07:42:07.757 [notice] SYN[realtime@127.0.0.1|registry<users>] Discovering the cluster
2023-11-23 07:42:07 07:42:07.758 [notice] SYN[realtime@127.0.0.1|pg<users>] Discovering the cluster
2023-11-23 07:42:07 07:42:07.758 [notice] SYN[realtime@127.0.0.1] Adding node to scope <Elixir.RegionNodes>
2023-11-23 07:42:07 07:42:07.758 [notice] SYN[realtime@127.0.0.1] Creating tables for scope <Elixir.RegionNodes>
2023-11-23 07:42:07 07:42:07.758 [notice] SYN[realtime@127.0.0.1|registry<Elixir.RegionNodes>] Discovering the cluster
2023-11-23 07:42:07 07:42:07.758 [notice] SYN[realtime@127.0.0.1|pg<Elixir.RegionNodes>] Discovering the cluster
2023-11-23 07:42:07 07:42:07.759 [warning] Replica region not found, defaulting to Realtime.Repo
2023-11-23 07:42:07 07:42:07.792 [info] Running RealtimeWeb.Endpoint with cowboy 2.10.0 at :::4000 (http)
2023-11-23 07:42:07 07:42:07.799 [info] Access RealtimeWeb.Endpoint at http://realtime.fly.dev
2023-11-23 07:42:07 07:42:07.800 [notice] SYN[realtime@127.0.0.1] Adding node to scope <Elixir.PostgresCdcStream>
2023-11-23 07:42:07 07:42:07.800 [notice] SYN[realtime@127.0.0.1] Creating tables for scope <Elixir.PostgresCdcStream>
2023-11-23 07:42:07 07:42:07.800 [notice] SYN[realtime@127.0.0.1|registry<Elixir.PostgresCdcStream>] Discovering the cluster
2023-11-23 07:42:07 07:42:07.800 [notice] SYN[realtime@127.0.0.1|pg<Elixir.PostgresCdcStream>] Discovering the cluster
2023-11-23 07:42:07 07:42:07.801 [notice] SYN[realtime@127.0.0.1] Adding node to scope <Elixir.Extensions.PostgresCdcRls>
2023-11-23 07:42:07 07:42:07.802 [notice] SYN[realtime@127.0.0.1] Creating tables for scope <Elixir.Extensions.PostgresCdcRls>
2023-11-23 07:42:07 07:42:07.802 [notice] SYN[realtime@127.0.0.1|registry<Elixir.Extensions.PostgresCdcRls>] Discovering the cluster
2023-11-23 07:42:07 07:42:07.802 [notice] SYN[realtime@127.0.0.1|pg<Elixir.Extensions.PostgresCdcRls>] Discovering the cluster
2023-11-23 07:42:07 07:42:07.919 [warning] Replica region not found, defaulting to Realtime.Repo
2023-11-23 07:42:07 07:42:07.922 [debug] QUERY OK source="tenants" db=1.2ms queue=1.7ms idle=120.6ms
2023-11-23 07:42:07 SELECT t0."id", t0."name", t0."external_id", t0."jwt_secret", t0."postgres_cdc_default", t0."max_concurrent_users", t0."max_events_per_second", t0."max_bytes_per_second", t0."max_channels_per_client", t0."max_joins_per_second", t0."suspend", t0."inserted_at", t0."updated_at" FROM "tenants" AS t0 WHERE (t0."external_id" = $1) ["realtime-dev"]
2023-11-23 07:42:07 07:42:07.923 project=realtime-dev external_id=realtime-dev [error] Auth error: tenant `realtime-dev` not found
2023-11-23 07:42:09 07:42:09.920 project=realtime-dev external_id=realtime-dev [error] Auth error: tenant `realtime-dev` not found
2023-11-23 07:42:11 07:42:11.914 project=realtime-dev external_id=realtime-dev [error] Auth error: tenant `realtime-dev` not found
2023-11-23 07:42:13 07:42:13.916 project=realtime-dev external_id=realtime-dev [error] Auth error: tenant `realtime-dev` not found
2023-11-23 07:42:15 07:42:15.935 project=realtime-dev external_id=realtime-dev [error] Auth error: tenant `realtime-dev` not found
2023-11-23 07:42:17 07:42:17.954 project=realtime-dev external_id=realtime-dev [error] Auth error: tenant `realtime-dev` not found
2023-11-23 07:42:20 07:42:20.016 project=realtime-dev external_id=realtime-dev [error] Auth error: tenant `realtime-dev` not found
2023-11-23 07:42:22 07:42:22.178 project=realtime-dev external_id=realtime-dev [error] Auth error: tenant `realtime-dev` not found

Hello @filipecabaco,

I'm having a issue enabling the realtime for some tables in the supabase studio.

When go to replication section get the following screen. CleanShot 2023-11-22 at 22 48 49@2x

If I try enable from table the realtime getting another issue. CleanShot 2023-11-22 at 22 49 28@2x

Here is the log of the container realtime-dev.supabase_realtime - public.ecr.aws/supabase/realtime:v2.25.35

2023-11-22 22:36:15 04:36:15.062 [info] create table tenants
2023-11-22 22:36:15 04:36:15.066 [info] create index tenants_external_id_index
2023-11-22 22:36:15 04:36:15.069 [info] == Migrated 20210706140551 in 0.0s
2023-11-22 22:36:15 04:36:15.082 [info] == Running 20220329161857 Realtime.Repo.Migrations.AddExtensionsTable.change/0 forward
2023-11-22 22:36:15 04:36:15.082 [info] create table extensions
2023-11-22 22:36:15 04:36:15.085 [info] create index extensions_tenant_external_id_type_index
2023-11-22 22:36:15 04:36:15.085 [info] == Migrated 20220329161857 in 0.0s
2023-11-22 22:36:15 04:36:15.086 [info] == Running 20220410212326 Realtime.Repo.Migrations.AddTenantMaxEps.up/0 forward
2023-11-22 22:36:15 04:36:15.086 [info] alter table tenants
2023-11-22 22:36:15 04:36:15.092 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.092 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.092 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.092 [info] == Migrated 20220410212326 in 0.0s
2023-11-22 22:36:15 04:36:15.093 [info] == Running 20220506102948 Realtime.Repo.Migrations.RenamePollIntervalToPollIntervalMs.up/0 forward
2023-11-22 22:36:15 04:36:15.094 [warning] Replica region not found, defaulting to Realtime.Repo
2023-11-22 22:36:15 04:36:15.099 [debug] QUERY OK source="extensions" db=0.1ms
2023-11-22 22:36:15 SELECT e0."id", e0."type", e0."settings", e0."tenant_external_id", e0."inserted_at", e0."updated_at" FROM "extensions" AS e0 WHERE (e0."type" = $1) ["postgres_cdc_rls"]
2023-11-22 22:36:15 04:36:15.099 [info] == Migrated 20220506102948 in 0.0s
2023-11-22 22:36:15 04:36:15.100 [info] == Running 20220527210857 Realtime.Repo.Migrations.AddExternalIdUniqIndex.change/0 forward
2023-11-22 22:36:15 04:36:15.100 [info] execute "alter table tenants add constraint uniq_external_id unique (external_id)"
2023-11-22 22:36:15 04:36:15.104 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.104 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.104 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.104 [info] == Migrated 20220527210857 in 0.0s
2023-11-22 22:36:15 04:36:15.104 [info] == Running 20220815211129 Realtime.Repo.Migrations.NewMaxEventsPerSecondDefault.change/0 forward
2023-11-22 22:36:15 04:36:15.104 [info] alter table tenants
2023-11-22 22:36:15 04:36:15.110 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.110 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.110 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.110 [info] == Migrated 20220815211129 in 0.0s
2023-11-22 22:36:15 04:36:15.111 [info] == Running 20220815215024 Realtime.Repo.Migrations.SetCurrentMaxEventsPerSecond.change/0 forward
2023-11-22 22:36:15 04:36:15.111 [info] execute "update tenants set max_events_per_second = 1000"
2023-11-22 22:36:15 04:36:15.111 [info] == Migrated 20220815215024 in 0.0s
2023-11-22 22:36:15 04:36:15.112 [info] == Running 20220818141501 Realtime.Repo.Migrations.ChangeLimitsDefaults.change/0 forward
2023-11-22 22:36:15 04:36:15.112 [info] alter table tenants
2023-11-22 22:36:15 04:36:15.115 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.115 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.115 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.115 [info] == Migrated 20220818141501 in 0.0s
2023-11-22 22:36:15 04:36:15.116 [info] == Running 20221018173709 Realtime.Repo.Migrations.AddCdcDefault.up/0 forward
2023-11-22 22:36:15 04:36:15.116 [info] alter table tenants
2023-11-22 22:36:15 04:36:15.119 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.119 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.119 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.119 [info] == Migrated 20221018173709 in 0.0s
2023-11-22 22:36:15 04:36:15.120 [info] == Running 20221102172703 Realtime.Repo.Migrations.RenamePgType.up/0 forward
2023-11-22 22:36:15 04:36:15.120 [info] execute "update extensions set type = 'postgres_cdc_rls'"
2023-11-22 22:36:15 04:36:15.120 [info] == Migrated 20221102172703 in 0.0s
2023-11-22 22:36:15 04:36:15.121 [info] == Running 20221223010058 Realtime.Repo.Migrations.DropTenantsUniqExternalIdIndex.change/0 forward
2023-11-22 22:36:15 04:36:15.121 [info] execute "ALTER TABLE IF EXISTS tenants DROP CONSTRAINT IF EXISTS uniq_external_id"
2023-11-22 22:36:15 04:36:15.124 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.124 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.124 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.124 [info] == Migrated 20221223010058 in 0.0s
2023-11-22 22:36:15 04:36:15.125 [info] == Running 20230110180046 Realtime.Repo.Migrations.AddLimitsFieldsToTenants.change/0 forward
2023-11-22 22:36:15 04:36:15.125 [info] alter table tenants
2023-11-22 22:36:15 04:36:15.128 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.128 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.128 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.128 [info] == Migrated 20230110180046 in 0.0s
2023-11-22 22:36:15 04:36:15.129 [info] == Running 20230810220907 Realtime.Repo.Migrations.AlterTenantsTableColumnsToText.change/0 forward
2023-11-22 22:36:15 04:36:15.129 [info] alter table tenants
2023-11-22 22:36:15 04:36:15.133 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.133 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.133 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.133 [info] == Migrated 20230810220907 in 0.0s
2023-11-22 22:36:15 04:36:15.133 [info] == Running 20230810220924 Realtime.Repo.Migrations.AlterExtensionsTableColumnsToText.change/0 forward
2023-11-22 22:36:15 04:36:15.133 [info] alter table extensions
2023-11-22 22:36:15 04:36:15.137 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.137 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.137 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.137 [info] == Migrated 20230810220924 in 0.0s
2023-11-22 22:36:15 04:36:15.138 [info] == Running 20231024094642 :"Elixir.Realtime.Repo.Migrations.Add-tenant-suspend-flag".change/0 forward
2023-11-22 22:36:15 04:36:15.138 [info] alter table tenants
2023-11-22 22:36:15 04:36:15.141 [info] about to masking role vault.secrets vault.decrypted_secrets
2023-11-22 22:36:15 04:36:15.141 [info] trigger "secrets_encrypt_secret_trigger_secret" for relation "vault.secrets" does not exist, skipping
2023-11-22 22:36:15 04:36:15.141 [info] drop cascades to trigger secrets_encrypt_secret_trigger_secret on table vault.secrets
2023-11-22 22:36:15 04:36:15.141 [info] == Migrated 20231024094642 in 0.0s
2023-11-22 22:36:15 04:36:15.422 [debug] QUERY OK db=0.5ms queue=60.8ms idle=0.0ms
2023-11-22 22:36:15 begin []
2023-11-22 22:36:15 04:36:15.430 [debug] QUERY OK source="tenants" db=0.2ms
2023-11-22 22:36:15 SELECT t0."id", t0."name", t0."external_id", t0."jwt_secret", t0."postgres_cdc_default", t0."max_concurrent_users", t0."max_events_per_second", t0."max_bytes_per_second", t0."max_channels_per_client", t0."max_joins_per_second", t0."suspend", t0."inserted_at", t0."updated_at" FROM "tenants" AS t0 WHERE (t0."external_id" = $1) ["realtime-dev"]
2023-11-22 22:36:15 04:36:15.451 [debug] QUERY OK db=0.8ms
2023-11-22 22:36:15 INSERT INTO "tenants" ("external_id","jwt_secret","max_bytes_per_second","max_channels_per_client","max_concurrent_users","max_events_per_second","max_joins_per_second","name","suspend","inserted_at","updated_at","id") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12) ["realtime-dev", "iNjicxc4+llvc9wovDvqymwfnj9teWMlyOIbJ8Fh6j2WNU8CIJ2ZgjR6MUIKqSmeDmvpsKLsZ9jgXJmQPpwL8w==", 100000, 100, 200, 100, 100, "realtime-dev", false, ~N[2023-11-23 04:36:15], ~N[2023-11-23 04:36:15], <<170, 107, 4, 168, 98, 247, 75, 111, 167, 183, 8, 138, 72, 196, 95, 145>>]
2023-11-22 22:36:15 04:36:15.455 [debug] QUERY OK db=2.7ms
2023-11-22 22:36:15 INSERT INTO "extensions" ("settings","tenant_external_id","type","inserted_at","updated_at","id") VALUES ($1,$2,$3,$4,$5,$6) [%{"db_host" => "dcYFpB9IQD8+XVW8Neunyw==", "db_name" => "sWBpZNdjggEPTQVlI52Zfw==", "db_password" => "sWBpZNdjggEPTQVlI52Zfw==", "db_port" => "+enMDFi1J/3IrrquHHwUmA==", "db_user" => "uxbEq/zz8DXVD53TOI1zmw==", "ip_version" => 4, "poll_interval_ms" => 100, "poll_max_changes" => 100, "poll_max_record_bytes" => 1048576, "publication" => "supabase_realtime", "region" => "us-east-1", "slot_name" => "supabase_realtime_replication_slot", "ssl_enforced" => false}, "realtime-dev", "postgres_cdc_rls", ~N[2023-11-23 04:36:15], ~N[2023-11-23 04:36:15], <<223, 158, 248, 22, 108, 48, 72, 63, 136, 250, 167, 186, 130, 37, 109, 7>>]
2023-11-22 22:36:15 04:36:15.455 [debug] QUERY OK db=0.6ms
2023-11-22 22:36:15 commit []
2023-11-22 22:36:16 04:36:16.032 [notice]     :alarm_handler: {:set, {:system_memory_high_watermark, []}}
2023-11-22 22:36:16 04:36:16.068 [info] Elixir.Realtime.SignalHandler is being initialized...
2023-11-22 22:36:16 04:36:16.068 [notice] SYN[realtime@127.0.0.1] Adding node to scope <Elixir.Realtime.Tenants.Connect>
2023-11-22 22:36:16 04:36:16.068 [notice] SYN[realtime@127.0.0.1] Creating tables for scope <Elixir.Realtime.Tenants.Connect>
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1|registry<Elixir.Realtime.Tenants.Connect>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1|pg<Elixir.Realtime.Tenants.Connect>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1] Adding node to scope <users>
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1] Creating tables for scope <users>
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1|registry<users>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1|pg<users>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1] Adding node to scope <Elixir.RegionNodes>
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1] Creating tables for scope <Elixir.RegionNodes>
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1|registry<Elixir.RegionNodes>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.069 [notice] SYN[realtime@127.0.0.1|pg<Elixir.RegionNodes>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.069 [warning] Replica region not found, defaulting to Realtime.Repo
2023-11-22 22:36:16 04:36:16.215 [info] Running RealtimeWeb.Endpoint with cowboy 2.10.0 at :::4000 (http)
2023-11-22 22:36:16 04:36:16.222 [info] Access RealtimeWeb.Endpoint at http://realtime.fly.dev
2023-11-22 22:36:16 04:36:16.222 [notice] SYN[realtime@127.0.0.1] Adding node to scope <Elixir.PostgresCdcStream>
2023-11-22 22:36:16 04:36:16.222 [notice] SYN[realtime@127.0.0.1] Creating tables for scope <Elixir.PostgresCdcStream>
2023-11-22 22:36:16 04:36:16.222 [notice] SYN[realtime@127.0.0.1|registry<Elixir.PostgresCdcStream>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.222 [notice] SYN[realtime@127.0.0.1|pg<Elixir.PostgresCdcStream>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.223 [notice] SYN[realtime@127.0.0.1] Adding node to scope <Elixir.Extensions.PostgresCdcRls>
2023-11-22 22:36:16 04:36:16.223 [notice] SYN[realtime@127.0.0.1] Creating tables for scope <Elixir.Extensions.PostgresCdcRls>
2023-11-22 22:36:16 04:36:16.223 [notice] SYN[realtime@127.0.0.1|registry<Elixir.Extensions.PostgresCdcRls>] Discovering the cluster
2023-11-22 22:36:16 04:36:16.223 [notice] SYN[realtime@127.0.0.1|pg<Elixir.Extensions.PostgresCdcRls>] Discovering the cluster
2023-11-22 22:36:19 04:36:19.069 [debug] Tzdata polling for update.
2023-11-22 22:36:19 04:36:19.815 [info] tzdata release in place is from a file last modified Fri, 22 Oct 2021 02:20:47 GMT. Release file on server was last modified Tue, 28 Mar 2023 20:25:39 GMT.
2023-11-22 22:36:19 04:36:19.815 [debug] Tzdata downloading new data from https://data.iana.org/time-zones/tzdata-latest.tar.gz
2023-11-22 22:36:20 04:36:20.366 [debug] Tzdata data downloaded. Release version 2023c.
2023-11-22 22:36:20 04:36:20.678 [info] Tzdata has updated the release from 2021e to 2023c
2023-11-22 22:36:20 04:36:20.678 [debug] Tzdata deleting ETS table for version 2021e
2023-11-22 22:36:20 04:36:20.679 [debug] Tzdata deleting ETS table file for version 2021e

Thie studio UI is fixed for me once i upgraded to the latest cli version (1.115.4), purged my containers and images. Lastly did a clean supabase start download.

I am still having the same logs for my realtime server and i am still getting the websocket connection failed even with the new cli. Would appreciate any help with this!

Yeah this feels like it was from Studio UI. CC @semics-tech @calonzolg .

The logs themselves look ok for initialisation of the Realtime tenant information 🤔

What is the error you are seeing in the websocket connection @Deelaw97 ?

I am seeing this too; 431 Request Header Fields Too Large when trying to connect.

Yeah this feels like it was from Studio UI. CC @semics-tech @calonzolg .

The logs themselves look ok for initialisation of the Realtime tenant information 🤔

What is the error you are seeing in the websocket connection @Deelaw97 ?

image
err is undefined but status shows as channel error

@Deelaw97 have you managed to fix it ?
I am having the same error, CHANNEL_ERROR.

what version of cli are you using?

cc @ismael-su @Deelaw97

@mrolafsson can you show the request header when you try to upgrade the websocket?

@filipecabaco I'm using self hosted docker. I pull yesterday and restarted the compose stack, now it works.
I also suspect it had something to do with my nginx configuration.
To add more context, I use nginx as reverse proxy for SSL certificate purpose, then I redirect from nginx to kong.
Anyway it works fine now

I think that it might also be connected with some issues we had on our side where the tenant data was not being set properly so the only fix for that was deletion / modification of the tenant data 😞

But glad to know it worked @ismael-su!

If you have further issues do ping

@filipecabaco

supabase --version
1.115.4

@Deelaw97 and what appears in the studio logs?

Would you like my studio logs when I start the websocket connection, or at another time?
@filipecabaco

when the socket tries to start please

image
Above is the kong docker logs (im assuming you meant kong logs)
image
Above is the realtime logs
image
Above is studio logs

@filipecabaco The realtime container doesn't seem to be connected

just tried locally with fresh install and worked 🤔 what code are you using to connect?

here's my code using deno:

import {
  createClient,
  RealtimeChannel,
} from "npm:@supabase/supabase-js@2.38.5";

const url = "http://127.0.0.1:54321";
const apikey = "<api_key>";

const supabase = createClient(url, apikey);
const config = { broadcast: { self: true } };
const channel = supabase.channel("test", { config });

const event = "test";
const payload = { message: "msg" };

const n_messages = 1;
const interval = 1000;

const send = () => {
  [...Array(n_messages).keys()].map(() =>
    channel
      .send({ event, payload, type: "broadcast" })
      .then(console.log)
      .catch(console.error)
  );
};

function connect(channel: RealtimeChannel, interval: number) {
  channel.subscribe((status: string) => {
    console.log(status);
    if (status !== "SUBSCRIBED") throw new Error("not subscribed");
    setInterval(() => send(), interval);
  });
}

connect(channel, interval);
commented

Same for me with supabase@1.115.4
status Channel Error with error undefined.

const channel = supabase
  .channel(`public:room_log:record_id=eq.${current_record.id}`)
  .on(
  'postgres_changes',
  {
	  event: '*',
	  schema: 'public',
	  table: 'room_log',
	  filter: `record_id=eq.${current_record.id}`
  },
  (payload) => {
	  console.log(payload);
  }
  )
  .subscribe((status, error) => {
  console.log(status);
  console.log(error);
	});
  useEffect(() => {
    const channel = supabase
      .channel("realtime_activities")
      .on(
        "postgres_changes",
        {
          event: "INSERT",
          schema: "public",
          table: "event",
        },
        payload => {
          console.log(payload);
        }
      )
      .subscribe();

    return () => {
      supabase.removeChannel(channel);
    };
  }, [queryClient]);

@filipecabaco One of my usecases. This is based on how supabase docs says to use realtime connections in https://supabase.com/docs/guides/realtime

commented

@Deelaw97 @filipecabaco
This issue resolves when I change supabase URL for supabaseClient from http://localhost:54321 to http://127.0.0.1:54321

THAT DID IT!! Realtime wokrs locally!!! @JunsikChoi Thanks for the tip! Cc: @filipecabaco

awesome!!! thank you @JunsikChoi 🙏

that is quite an interesting weird thing still 🤔 I wonder if this would be better to set in the docs in some way

will close the issue for now

thank you all for the report, help and patience ❤️

@filipecabaco Thank you for taking the time to investigate it!!!! Really appreciate it!