Realtime stopped working after tenant cleanup – TenantNotFound?

My Supabase project is suddenly throwing TenantNotFound errors non-stop in the logs and Realtime is completely dead. I’m on a tight deadline and really need a fix, so any help or ideas would be massively appreciated. Here’s what’s happening: - Project works normally after initial deployment - After a period of inactivity, I see this in logs:
Tenant qwnszhqhhscwkknnhqxx has been terminated: :shutdown
Tenant has no connected users, database connection will be terminated

Tenant qwnszhqhhscwkknnhqxx has been terminated: :shutdown
Tenant has no connected users, database connection will be terminated

- Twelve minutes later, Realtime tries to reconnect, but all I get is:
TenantNotFound: Tenant not found: qwnszhqhhscwkknnhqxx
TenantNotFound: Tenant not found: qwnszhqhhscwkknnhqxx
...

TenantNotFound: Tenant not found: qwnszhqhhscwkknnhqxx
TenantNotFound: Tenant not found: qwnszhqhhscwkknnhqxx
...

- This error repeats 96 times in a few minutes. Nothing else works.
- Mixed in are 422 UnprocessableEntity errors like:
"UnprocessableEntity: %{messages: [\"is invalid\"]}"
Sent 422 in 23ms

"UnprocessableEntity: %{messages: [\"is invalid\"]}"
Sent 422 in 23ms

- I recreated the Supabase instance from scratch - Checked all publications - both supabase_realtime and supabase_realtime_messages_publication show as present and valid in the dashboard - Verified correct project ID - Submitted a support request, but on the free plan so not sure how soon I’ll get a response - The error usually pops up right after Supabase terminates the tenant for “no connected users” (idle state) - After termination, even recreating the project eventually leads back to the same problem. Realtime totally fails to reconnect and tenant can’t be found by Supabase’s backend - Realtime service just spams TenantNotFound error for every subscription - Connecting from a JS client (For testing) but also Swift Would really appreciate any advice, workarounds, or just visibility from the team/community. Hit this roadblock right before a deadline and not sure what else to try. Thanks a ton for any help!
2 Replies
garyaustin
garyaustin2mo ago
The dashboard realtime monitor gets the same errors? Are you getting the error connecting with a client to a channel? Are you using broadcast or postgres changes? The replications that you show are for postgres-changes and broadcast from DB messages. They should not be directly related to connections using realtime from the clients. Your messages error seems like the broadcast? message packet is not formed. Tenant not found seems like something wrong with the data being sent OR a supabase side issue. Have have you looked at what is being sent out when you get these? You also should look thru here: https://github.com/supabase/realtime/issues And maybe generate an issue there. They seem to be responding reasonably quickly.
GoldenEdit
GoldenEditOP2mo ago
Apologies, looks like this was a problem with the iOS Supabase SDK Abandoning this issue for now and switching to a custom websockets implementation in my backend.

Did you find this page helpful?