Open rschooley opened 7 years ago
Can you show what shell commands do you run? Basically whenever a table is created we should insert a new record into id_seq
table that will store sequence number. And it looks like record or whole table does not exist (was not created on migration).
@AndrewDryga
mix ecto.migrate then running my umbrella project with mix phx.server when i do then insert/get whatever something I get the id_seq error
edit: @AndrewDryga if you need anymore infos please tell me and btw im using windows 10
@AndrewDryga might help: https://github.com/gallexme/ElixirTest
@gallexme thanks, I'll look into it.
@gallexme you need to create directory for Mnesia files first, try to call mix ecto.create
. If it fails, just manually create this path. (You can persist in in git by adding empty .gitkeep
file into it.)
Also you will need to add config :crypto_exchange_web, ecto_repos: []
to crypto_exchange_web
application, to tell ecto migrator that you don't have repos in this app.
The Patch exists on my pc and Actually what I found out is that when I use the Mix task it create The folder under crypto_exchange_data/priv And when I run The umbrella and use mnesia.info it shows a different Patch umbrella/priv
And the other issue is just a warning it shouldnt matter as the Web App doesn't even have ecto
Sorry was written on my phone Patch means path
I'm getting this similar error {:aborted, {:no_exists, :id_seq}}
In my case the error is triggered when starting my node named
.
# It works
$ elixir --cookie cookie123 -S mix phoenix.server
# Does not work (triggers the error)
$ elixir --name web00@127.0.0.1 --cookie cookie123 -S mix phoenix.server
This is a serious limitation, and it should probably be addressed!
Cheers!
@walkr try to:
sname
instead of name
.In general, It's not an adapter limitation, rather you should dig deeper into Mnesia details.
@AndrewDryga Thanks!
I've actually ended up fixing the problem, but bumped into another one.
I've solved the problem by supplying the settings on the adapter in the config.exs
instead of :ecto_mnesia
as it is suggested in the README.
Example
config :my_app, MyApp.Mnesia.Repo,
adapter: EctoMnesia.Adapter,
priv: "priv/repo_mnesia",
host: {:system, :atom, "MNESIA_HOST", Kernel.node()},
storage_type: {:system, :atom, "MNESIA_STORAGE_TYPE", :disc_copies}
However, now I'm bumping into the same {:aborted, {:no_exists, :id_seq}}
when I'm using ram_copies
.
For RAM copies you need to make sure that you run migrations on each time Erlang VM node starts. And this is a adapters part that could be automated. I'll add separate issue for it.
my migration is (I've tried
:set
as well)I see an
id_seq
table in mnesia, but it is empty. Does it need to be seeded with something or did I do something else wrong? Thanks for the help.