PHX 1.6.0-rc.0 restart released daemon issue

I am hesitant to file a bug officially since I am new to Phoenix, but it seems that generating a new project and deploying with releases will leave you with a build that doesn’t restart properly. The stable release did not have this problem. This is with PHX 1.6.0-rc.0 and Elixir 1.12.3 (and the previous minor release as well).

I am following the basic steps and uncommenting start: true for the default endpoint in config/runtime.exs

mix phx.new --no-ecto phx_test
cd phx_test
# mix may ask to install rebar
mix phx.gen.secret
export SECRET_KEY_BASE=$(mix phx.gen.secret)
mix deps.get --only prod
MIX_ENV=prod mix compile
MIX_ENV=prod mix assets.deploy
# uncomment that one line for starting endpoint in runtime.exs
MIX_ENV=prod mix release
_build/prod/rel/phx_test/bin/phx_test daemon
_build/prod/rel/phx_test/bin/phx_test restart
# tail _build/prod/rel/phx_test/tmp/log/erlang.log.1

It will crash on restart. Something is wrong with loading the config. If you use the remote / rpc console to call System.restart, it’s the same.

{"init terminating in do_boot",{<<"aborting boot">>,[{'Elixir.Config.Provider',boot,2,[]}]}}
init terminating in do_boot ({,[{Elixir.Config.Provider,boot,2,[]}]})

Crash dump is being written to: erl_crash.dump...done

You can also get this error if you have a project that uses includes prod.secret.exs or something. I am not sure about the exact conditions though. I am running as the same user that created and built the files in a home directory, so permissions shouldn’t be an issue.

ERROR! Got infinite loop when running Config.Provider. Please make sure "/home/user/phx_test/_build/prod/rel/phx_test/releases/0.1.0/sys.config" is writable and accessible or choose a different path
{"init terminating in do_boot",{<<"aborting boot">>,[{'Elixir.Config.Provider',boot,2,[]}]}}
init terminating in do_boot ({,[{Elixir.Config.Provider,boot,2,[]}]})

Is anyone else having the same problem or do you have other ways to restart your daemon?

2 Likes

Fixed on Elixir master. Thank you for the report.

6 Likes