Closed faithandbrave closed 7 years ago
Have you set RELEASE_CONFIG_DIR
, RELEASE_MUTABLE_DIR
, VM_ARGS_PATH
or SYS_CONFIG_PATH
in the environment of the host you are deploying to? If these are set globally, it will not be possible to run two releases on the same host, those env vars must be set in the context of the release itself only.
No changed.
@faithandbrave I don't understand, are you saying you unset these globally and there was no change to the issue; or are you saying you didn't change them in the first place? Can you describe in more detail how you are deploying and running the releases?
I don't set environment variables. I'll provide sample project.
I created sample project. Please see:
https://github.com/faithandbrave/distillery_issue254_sample
The project is faithandbrave/elixir-phoenix-chunked-response-example based.
@faithandbrave It looks like your first problem is that you are running the app from the same directory the release is built in - you should not be doing that, you need to deploy the tarball (releases/<version>/<app>.tar.gz
) to some directory, and run your app from there. Distillery can't guarantee things will work as expected when running from the release build directory because things can change underneath the app. It is actually explicitly called out in the documentation that you cannot perform hot upgrades in that directory.
Secondly, you aren't checking the exit code of the stop
command you are issuing. If something is failing there, then the subsequent start
command will naturally conflict with the release which is already running.
Lastly, stopping the daemon may not immediately be noticed by epmd
, and thus when the next version is started the name may still appear to be registered. One approach would be to run epmd -kill && epmd -daemon
after stop
to ensure that it's flushed, but I would recommend instead sleeping for a second (e.g. sleep 1
) before issuing the start
command to avoid the race here.
If you resolve all of the above and you are still able to reproduce this problem, feel free to reopen this issue, and I'll look further, but for now there doesn't appear to be an actionable issue with Distillery here yet.
@bitwalker Thanks a lot! I'll redesign my application.
Steps to reproduce
There are 2 servers:
Both servers uses Distillery.
When release application server by admin site server (execute deploy shell script), application server's
sys_config
andvm_args
path be admin site path.When start the application server, shutdown admin site.
Verbose Logs
Description of issue
What are the expected results?
What OS, Erlang/Elixir versions are you seeing this issue on?
If possible, also provide your
rel/config.exs
, as it is often my first troubleshooting question, and you'll save us both time :)admin site
rel/config.exs
:app server
rel/config.exs
:sys_config
andvm_args
paths toapp_server/rel/config.exs
. However, no effect.