Skip to content

Realtime crash on realtime publish #4227

@quick691fr

Description

@quick691fr

Describe the bug

When I publish a message on my realtime channel on local dev environment, the realtime container crash with error :

Server: realtime-dev:4000 (http)

Request: POST /api/broadcast

** (exit) an exception was raised:

    ** (MatchError) no match of right hand side value: [""]

        (realtime 2.41.23) lib/realtime_web/plugs/auth_tenant.ex:45: RealtimeWeb.AuthTenant.access_token/1

        (realtime 2.41.23) lib/realtime_web/plugs/auth_tenant.ex:21: RealtimeWeb.AuthTenant.call/2

        (realtime 2.41.23) RealtimeWeb.Router.secure_tenant_api/2

        (realtime 2.41.23) lib/realtime_web/router.ex:1: RealtimeWeb.Router.__pipe_through7__/1

        (phoenix 1.7.19) lib/phoenix/router.ex:475: Phoenix.Router.__call__/5

        (realtime 2.41.23) lib/realtime_web/endpoint.ex:1: RealtimeWeb.Endpoint.plug_builder_call/2

        (realtime 2.41.23) lib/realtime_web/endpoint.ex:1: RealtimeWeb.Endpoint.call/2

        (plug_cowboy 2.7.2) lib/plug/cowboy/handler.ex:11: Plug.Cowboy.Handler.init/2

14:06:11.428 request_id=GGoUhkklB6I0oeQAAC3h project=realtime-dev external_id=realtime-dev [info] Sent 500 in 3ms

14:06:11.429 [error] #PID<0.3679.0> running RealtimeWeb.Endpoint (connection #PID<0.3671.0>, stream id 5) terminated

I tried recreating environment with supabase stop --no-backup but stil get the same result.

It seems happening since I updated supabase/supabase-js library to 2.58.0.

To Reproduce
Steps to reproduce the behavior:

  1. Create environment with supabase create
  2. Publish a message to a realtime custom channel with supabase/supabase-js library
  3. Check out the logs of realtime container

Expected behavior
Realtime channel pushing message to subscribers

System information
Rerun the failing command with --create-ticket flag.

  • Ticket ID: Couldn't get one
  • Version of OS: Windows 11
  • Version of CLI: v2.47.2
  • Version of Docker: Docker version 28.2.2, build e6534b4
  • Versions of services: [output from supabase services command]
  SERVICE IMAGE          | LOCAL                  | LINKED
  ------------------------|------------------------|------------
   supabase/postgres      | 15.8.1.073             | 15.8.1.073
   supabase/gotrue        | v2.179.0               | v2.179.0
   postgrest/postgrest    | v12.2.3                | v12.2.3
   supabase/realtime      | v2.41.23               | -
   supabase/storage-api   | v1.26.3                | -
   supabase/edge-runtime  | v1.68.3                | -
   supabase/studio        | 2025.08.04-sha-6e99ca6 | -
   supabase/postgres-meta | v0.91.5                | -
   supabase/logflare      | 1.18.3                 | -
   supabase/supavisor     | 2.6.1                  | -

Additional context

  • Version of supabase-js : 2.58.0
  • Version of Node.js : v20.10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions