Hey,
I am trying to set up mnesia
in my project.
I am using 2 deps.
Everything works fine locally, but when I build a release I get this error:
:mnesia is listed both as a regular application and as an included application from deps
The relevant lines:
I enjoy the interface of this.
],
name: "Mnesiac",
source_url: "https://github.com/beardedeagle/mnesiac",
deps: deps()
]
end
def application do
[
extra_applications: [:logger, :runtime_tools],
included_applications: [:mnesia]
]
end
defp elixirc_paths(env) when env in [:dev, :test], do: ["lib", "test/support"]
defp elixirc_paths(_env), do: ["lib"]
defp deps do
[
{:libcluster, "~> 3.3", optional: true},
{:credo, "~> 1.7", only: [:dev], runtime: false},
I enjoy the easy setup from this.
main: @name,
canonical: "https://hexdocs.pm/#{@app}",
extras: ["README.md"]
]
]
end
# BEAM Application
def application do
[extra_applications: [:logger, :mnesia]]
end
# Dependencies
defp deps do
[
{:ex_doc, ">= 0.0.0", only: :docs},
{:inch_ex, ">= 0.0.0", only: :docs},
]
end
Is there a way to resolve this error?
Thank you
1 Like
Do you also list mnesia
as a dependency in your mix.exs
itself or
is it only coming from these dependencies?
Hey, I am not listing mnesia myself. It is coming from the dependencies.
I think Adding deps to included_applications raises on release · Issue #9683 · elixir-lang/elixir · GitHub explains the same issue as you: like José replied, can you try setting either mnesiac: :load
or memento: :load
in your release configuration?
I would try: setting memento: :load
and then starting Mnesia manually.
If I read memento’s code 1 properly, it just starts Mnesia under the
hood, so only loading it will probably cause less troubles.
Hey,
Thanks for the reply!
I figured that there is one more dep that does the same as memento
with listing mnesia
.
I tried to load them as you said but didn’t seem to help.
I ended up removing everything other than mnesiac
.
1 Like