lpvm
Init terminating in do_boot - distillery migrations
I’m trying to have migrations automatically configured to be setup in the build and production servers as mentioned in Running Migrations, etc. – distillery v1.5.2
The module, the command and the configuration were done.
In the build server, after successful build, when tried to run bin/myapp migrate it failed.
Read this topic made the change me = :orif in the above mentioned module, as suggested but it is not possible to migrate.
The error is:
{"init terminating in do_boot",{{badmatch,{error,{already_loaded,orif}}},[{'Elixir.Orif.ReleaseTasks',seed,0,[{file,"lib/orif/release_tasks.ex"},{line,20}]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ()
Crash dump is being written to: erl_crash.dump...done
Read elsewhere that this could happen because of different versions of elixir and erlang.
In fact, my development is done in Linux with:
Elixir 1.7.3 (compiled with Erlang/OTP 21)
and my build box is FreeBSD running:
Elixir 1.7.3 (compiled with Erlang/OTP 19)
Installed the erlang-runtime21: 21.1 package, modified the PATH to have access to the new installed runtime:
Elixir 1.7.3 (compiled with Erlang/OTP 19)
and
Eshell V10.1 (abort with ^G)
"21"
But the same error is daunting me.
What to do to solve this issue?
First Post!
NobbZ
The OTP version doesn’t seem to be an issue according to the error message, for me it seems as if you were starting your application twice when it should be started only once.
As I’m not using distillery, I can’t give you much more hints, but you probably need to reveal a bit of your distillery config/scripts.
Last Post!
pierreabreup
You dont need to run bin/orif/ foregound or bin/orif start. You only need run your task. In my case, I have this task
defmodule ContentProxy.ReleaseTasks do
@otp_app :content_proxy
defp init(app) do
IO.puts "Starting dependencies.."
{:ok, _} = Application.ensure_all_started(app)
end
def seed do
init(@otp_app)
seed_data = seed_file_path(@otp_app)
|> File.read!()
|> Jason.decode!()
Enum.each seed_data, fn(content) ->
ContentProxy.Resources.create_content(content)
IO.puts("DOCUMENT #{content["name"]} INSERTED")
end
stop()
end
defp seed_file_path(app),
do: priv_dir(app, ["seed_data", "contents.json"])
defp priv_dir(app, path) when is_list(path) do
case :code.priv_dir(app) do
priv_path when is_list(priv_path) or is_binary(priv_path) ->
Path.join([priv_path] ++ path)
{:error, :bad_name} ->
raise ArgumentError, "unknown application: #{inspect app}"
end
end
defp stop do
IO.puts "Success!"
:init.stop()
end
end
inside of the terminal session, I run my task typing _build/prod/rel/content_proxy/bin/content_proxy command "Elixir.ContentProxy.ReleaseTasks" seed and its works like a charm!
It is worth noting {:ok, _} = Application.ensure_all_started(app) already start to you all children process that you’ve configured in application.ex
I’ve notice that if I run the app with start or foreground before run command, when I run command "Elixir.ContentProxy.ReleaseTasks" seed I get the following error:
22:01:18.737 [error] Failed to start Ranch listener ContentProxyWeb.Endpoint.HTTP in :ranch_tcp:listen([{:cacerts, :...}, {:key, :...}, {:cert, :...}, :inet6, {:port, 4000}]) for reason :eaddrinuse (address already in use)
22:01:18.759 [info] Application content_proxy exited: ContentProxy.Application.start(:normal, []) returned an error: shutdown: failed to start child: ContentProxyWeb.Endpoint
** (EXIT) shutdown: failed to start child: {:ranch_listener_sup, ContentProxyWeb.Endpoint.HTTP}
** (EXIT) shutdown: failed to start child: :ranch_acceptors_sup
** (EXIT) {:listen_error, ContentProxyWeb.Endpoint.HTTP, :eaddrinuse}
22:01:18.762 [info] Application mongodb exited: :stopped
22:01:18.772 [info] Application db_connection exited: :stopped
22:01:18.772 [info] Application connection exited: :stopped
22:01:18.773 [info] Application gettext exited: :stopped
22:01:18.773 [info] Application poolboy exited: :stopped
22:01:18.773 [info] Application absinthe_relay exited: :stopped
22:01:18.773 [info] Application jason exited: :stopped
22:01:18.774 [info] Application atomic_map exited: :stopped
22:01:18.774 [info] Application absinthe_plug exited: :stopped
22:01:18.774 [info] Application absinthe exited: :stopped
22:01:18.774 [info] Application phoenix exited: :stopped
22:01:18.775 [info] Application eex exited: :stopped
22:01:18.775 [info] Application phoenix_pubsub exited: :stopped
22:01:18.775 [info] Application distillery exited: :stopped
22:01:18.776 [info] Application runtime_tools exited: :stopped
22:01:18.776 [info] Application artificery exited: :stopped
22:01:18.777 [info] Application plug_cowboy exited: :stopped
22:01:18.777 [info] Application cowboy exited: :stopped
22:01:18.777 [info] Application cowlib exited: :stopped
22:01:18.778 [info] Application ranch exited: :stopped
22:01:18.778 [info] Application ssl exited: :stopped
22:01:18.778 [info] Application public_key exited: :stopped
22:01:18.779 [info] Application asn1 exited: :stopped
22:01:18.779 [info] Application phoenix_ecto exited: :stopped
22:01:18.779 [info] Application plug exited: :stopped
22:01:18.780 [info] Application mime exited: :stopped
22:01:18.780 [info] Application plug_crypto exited: :stopped
22:01:18.780 [info] Application ecto exited: :stopped
=INFO REPORT==== 27-Jan-2019::22:01:18.817574 ===
application: logger
exited: stopped
type: temporary
{"init terminating in do_boot",{{badmatch,{error,{content_proxy,{{shutdown,{failed_to_start_child,'Elixir.ContentProxyWeb.Endpoint',{shutdown,{failed_to_start_child,{ranch_listener_sup,'Elixir.ContentProxyWeb.Endpoint.HTTP'},{shutdown,{failed_to_start_child,ranch_acceptors_sup,{listen_error,'Elixir.ContentProxyWeb.Endpoint.HTTP',eaddrinuse}}}}}}},{'Elixir.ContentProxy.Application',start,[normal,[]]}}}}},[{'Elixir.ContentProxy.ReleaseTasks',init,1,[{file,"lib/content_proxy/release_tasks.ex"},{line,7}]},{'Elixir.ContentProxy.ReleaseTasks',seed,0,[{file,"lib/content_proxy/release_tasks.ex"},{line,16}]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({{badmatch,{error,{content_proxy,{_}}}},[{Elixir.ContentProxy.ReleaseTasks,init,1,[{_},{_}]},{Elixir.ContentProxy.ReleaseTasks,seed,0,[{_},{_}]},{init,start_em,1,[]},{init
Crash dump is being written to: erl_crash.dump...done
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









