Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chetan opened this issue Nov 16, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@chetan
Copy link

chetan commented Nov 16, 2023

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)

@chetan chetan added the bug Something isn't working label Nov 16, 2023
@chetan
Copy link
Author

chetan commented Nov 16, 2023

/cc: @filipecabaco

@filipecabaco
Copy link
Contributor

opening PR 👀 thank you again for flagging this issues

@filipecabaco
Copy link
Contributor

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

@filipecabaco
Copy link
Contributor

ok was able to replicate in the supabase/docker 👍 will test the fix

@filipecabaco
Copy link
Contributor

#739

@filipecabaco
Copy link
Contributor

Merged 🎉

@chetan chetan closed this as completed Nov 16, 2023
@chetan
Copy link
Author

chetan commented Nov 16, 2023

Verified!

@filipecabaco
Copy link
Contributor

thank you so much for reporting and patience 🙏

@Silur
Copy link

Silur commented May 7, 2024

still encountering this on CLI version 1.165.0 and realtime v2.28.32

@Silur
Copy link

Silur commented Jun 16, 2024

still present on CLI 1.176.10 and realtime v2.28.32

@filipecabaco
Copy link
Contributor

@Silur could you share the command and logs so I can try to replicate it?

@filipecabaco filipecabaco reopened this Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants