Well, it wasn’t necessarily you who changed it so don’t write this off until you can confirm it is not the problem.
As an example from the memento configuration:
# config/config.exs
config :mnesia,
dir: '.mnesia/#{Mix.env}/#{node()}' # Notice the single quotes
Which means if you change node name or your mix env you will end up with a different directory.
I don’t know if you followed this configuration but that could give an idea why something would change.
Regarding :mnesia.system_info
I would probably just check that the directory
is what you expect, that the node is started and accessible and that the tables are of the type you expect.
Interactive Elixir (1.10.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> Memento.stop
14:34:19.460 [info] Application mnesia exited: :stopped
:ok
iex(2)> Memento.Schema.create([node()])
:ok
iex(3)> Memento.start()
:ok
iex(5)> :mnesia.system_info()
===> System info in version "4.16.1", debug level = none <===
opt_disc. Directory "/home/martink/mnesia/what/Mnesia.nonode@nohost" is used.
use fallback at restart = false
running db nodes = [nonode@nohost]
stopped db nodes = []
master node tables = []
remote = []
ram_copies = []
disc_copies = [schema]
disc_only_copies = []
[{nonode@nohost,disc_copies}] = [schema]
2 transactions committed, 0 aborted, 0 restarted, 0 logged to disc
0 held locks, 0 in queue; 0 local transactions, 0 remote
0 transactions waits for other nodes: []
Gives you some information. Especially the Directory "/home/martink/mnesia/what/Mnesia.nonode@nohost" is used
line shows you where you store the mnesia
datafiles.
You can also double-check that the node is started and that the tables are in fact in :disc_copies
mode.
If you search for schema.Dat
you might find others mnesia schemas being created.
I don’t think so but perhaps if there is some funny race condition? Normally mnesia
will detect that there is a database there already and give you and already_exists
error.