Coder Social home page Coder Social logo

Supabase Realtime Subscript Fails With Undefined Error (Possibly: `Auth error: tenant 'realtime-dev' not found` about realtime HOT 15 CLOSED

nbarrow-inspire-labs avatar nbarrow-inspire-labs commented on June 18, 2024 1
Supabase Realtime Subscript Fails With Undefined Error (Possibly: `Auth error: tenant 'realtime-dev' not found`

from realtime.

Comments (15)

filipecabaco avatar filipecabaco commented on June 18, 2024 1

the cli team will set 1.113.0 as stable to quickly fix this

from realtime.

filipecabaco avatar filipecabaco commented on June 18, 2024 1

and above all thank you for reporting 🙏

from realtime.

filipecabaco avatar filipecabaco commented on June 18, 2024 1

@JunsikChoi can you confirm the solution was the one you shared in #748 ?

from realtime.

JunsikChoi avatar JunsikChoi commented on June 18, 2024 1

@JunsikChoi can you confirm the solution was the one you shared in #748 ?

Yes, it resolved completely for now. Realtime works great in local dev.

from realtime.

nbarrow-inspire-labs avatar nbarrow-inspire-labs commented on June 18, 2024

More recent issues possibly related to this have been reported in supabase/supabase-js#679

from realtime.

nbarrow-inspire-labs avatar nbarrow-inspire-labs commented on June 18, 2024

Not sure if this is related, but I'm noticing that even after running supabase db reset the realtime schema does not have any tables (when it probably should have tables like schema_migrations, channels, etc)

Screenshot 2023-11-19 at 7 31 02 PM

from realtime.

filipecabaco avatar filipecabaco commented on June 18, 2024

Yes seems related 🤔 and that external id in the logs seems wrong ( realtime-dev-tenant ) as it should be realtime-dev.

tenant_name = "realtime-dev"

it's also still adding the public.tenant which was fixed on version 2.25.35 which is available with the CLI version in the brew beta channel

related issue #745

from realtime.

guilhermezdev avatar guilhermezdev commented on June 18, 2024

Also facing the same thing, even the example on the supabase docs fail. It was working before updating the CLI.

  const channel = _supabaseClient
    .channel("room1", {
      config: {
        broadcast: {
          ack: true,
          self: true,
        },
      },
    })
    .on("broadcast", { event: "cursor-pos" }, (payload) => {
      console.log("Cursor position received!", payload);
    })
    .subscribe((status, error) => {
      console.log("Channel status:", status, error);
      if (status === "SUBSCRIBED") {
        channel.send({
          type: "broadcast",
          event: "cursor-pos",
          payload: { x: Math.random(), y: Math.random() },
        });
      }
    });

This will always log Channel status: CHANNEL_ERROR undefined

Supabase CLI version: 1.112.0

from realtime.

nbarrow-inspire-labs avatar nbarrow-inspire-labs commented on June 18, 2024

Yeah same here I only began experiencing this after going to CLI version 1.112.0.

from realtime.

nbarrow-inspire-labs avatar nbarrow-inspire-labs commented on June 18, 2024

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.

from realtime.

nbarrow-inspire-labs avatar nbarrow-inspire-labs commented on June 18, 2024

Thanks for the help @filipecabaco !!

from realtime.

filipecabaco avatar filipecabaco commented on June 18, 2024

no worries, sorry again for such a big inconvenient

from realtime.

bigbizze avatar bigbizze commented on June 18, 2024

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

running the above commands, and the version for my realtime container 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 -f realtime.sql

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 -f _realtime.sql

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
--

from realtime.

JunsikChoi avatar JunsikChoi commented on June 18, 2024

I have same issue with [email protected]

from realtime.

filipecabaco avatar filipecabaco commented on June 18, 2024

😌 glad it worked! again big thank you for finding the solution 🙏

from realtime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.