supabase/realtime

Startup error running migrations: table identifier does not refer to an existing ETS table

chetan opened this issue ยท 11 comments

chetan commented

Bug report

Migrations fail to run properly. Appears to be due to the use of Mix.env() introduced in #736.

supabase-realtime  | Setting RLIMIT_NOFILE to 100000
supabase-realtime  | 13:58:43.351 [info] Migrations already up
supabase-realtime  | ** (ArgumentError) errors were found at the given arguments:
supabase-realtime  |
supabase-realtime  |   * 1st argument: the table identifier does not refer to an existing ETS table
supabase-realtime  |
supabase-realtime  |     (stdlib 4.3) :ets.lookup(Mix.State, :env)
supabase-realtime  |     lib/mix/state.ex:31: Mix.State.get/2
supabase-realtime  |     /app/lib/realtime-2.25.32/priv/repo/seeds.exs:5: (file)
supabase-realtime  |     nofile:1: (file)
supabase-realtime  |     (stdlib 4.3) erl_eval.erl:748: :erl_eval.do_apply/7
supabase-realtime  |     (stdlib 4.3) erl_eval.erl:492: :erl_eval.expr/6
supabase-realtime  |     (stdlib 4.3) erl_eval.erl:136: :erl_eval.exprs/6
supabase-realtime  | erl_child_setup: failed with error 32 on line 281

I took a look at fixing this but don't know elixir at all. According to the docs, Mix.env() shouldn't be used in production code (i.e., outside the build system), but I do see it being used in other places in the codebase. Not sure why it's throwing here and not elsewhere.

To Reproduce

Run the latest realtime image supabase/realtime:v2.25.32 on an existing instance (likely throws on fresh data as well)

opening PR ๐Ÿ‘€ thank you again for flagging this issues

@chetan where are you running the image? supabase docker compose or cli?

ok was able to replicate in the supabase/docker ๐Ÿ‘ will test the fix

Merged ๐ŸŽ‰

chetan commented

Verified!

thank you so much for reporting and patience ๐Ÿ™