bitwalker / distillery

Simplify deployments in Elixir with OTP releases!
MIT License
2.97k stars 398 forks source link

Remote console can't connect when using -sname #516

Closed andreausu closed 6 years ago

andreausu commented 6 years ago

Hello, we've run into an issue after upgrading distillery from 1.5.2 to 2.0.9: remote_console is failing to connect to our application whereas before the upgrade it worked (no config settings were changed).

Steps to reproduce

Given the following vm.args:

## Name of the node
-sname crash@host-machine

## Cookie for distributed erlang
-setcookie ${erlang_cookie}

-kernel inet_dist_listen_min 30038 inet_dist_listen_max 30038

# Enable SMP automatically based on availability
-smp auto

First, I start the app, as you can see REPLACE_OS_VARS and erlang_cookie env variables are properly set:

app@0a9505fc8025:/app$ echo $REPLACE_OS_VARS
true
app@0a9505fc8025:/app$ echo $erlang_cookie
ewua7iequ1eadiudaecomeiThoht8turaefeedee2zoo5feeleZiem8sahj0Iech7Chu5gaeR5akohpha2aiheezeebuech4reiVoubeepoY5biecugei1so7yeiLu0Tai2geexahlaiphoh3Pos7r

app@0a9505fc8025:/app$ /app/bin/crash foreground

From docker exec you can see that the application was started with the proper cookie, however remote_console is failing to connect.

ps auxwww | grep crash
app     17840  0.5  2.6 3778228 207136 ?      Ssl  Aug27  16:35 /app/releases/0.0.0-dev/crash.sh -Bd -- -root /usr/local/lib/erlang -progname app/releases/0.0.0-dev/crash.sh -- -home /root -- -boot_var ERTS_LIB_DIR /usr/local/lib/erlang/lib -config /app/var/sys.config -pa /app/lib/absinthe-1.4.12/ebin /app/lib/absinthe_ecto-0.1.3/ebin /app/lib/absinthe_plug-1.4.4/ebin /app/lib/absinthe_relay-1.4.3/ebin /app/lib/amqp-1.0.3/ebin /app/lib/amqp_client-3.7.5/ebin /app/lib/artificery-0.2.6/ebin /app/lib/bamboo-1.0.0-rc.3/ebin /app/lib/bamboo_smtp-1.5.0-rc.4/ebin /app/lib/base64url-0.0.1/ebin /app/lib/basic_auth-2.2.2/ebin /app/lib/briefly-0.3.0/ebin /app/lib/cachex-3.0.2/ebin /app/lib/certifi-2.3.1/ebin /app/lib/combine-0.10.0/ebin /app/lib/connection-1.0.4/ebin /app/lib/cors_plug-1.5.2/ebin /app/lib/cowboy-1.0.4/ebin /app/lib/cowlib-1.0.2/ebin /app/lib/crash-0.0.0-dev/ebin /app/lib/crontab-1.1.3/ebin /app/lib/csv-2.1.1/ebin /app/lib/db_connection-1.1.3/ebin /app/lib/decimal-1.5.0/ebin /app/lib/distillery-2.0.8/ebin /app/lib/ecto-2.2.10/ebin /app/lib/ecto_enum-1.1.0/ebin /app/lib/eex-1.6.6/ebin /app/lib/elixir-1.6.6/ebin /app/lib/erlsom-1.2.1/ebin /app/lib/eternal-1.2.0/ebin /app/lib/ex_aws-2.0.2/ebin /app/lib/ex_aws_s3-2.0.0/ebin /app/lib/exjsx-3.2.1/ebin /app/lib/exq-0.11.0/ebin /app/lib/exq_ui-0.9.0/ebin /app/lib/fetcher-0.3.0/ebin /app/lib/fun_with_flags-1.0.0/ebin /app/lib/fun_with_flags_ui-0.4.1/ebin /app/lib/gen_smtp-0.12.0/ebin /app/lib/gen_stage-0.14.0/ebin /app/lib/gettext-0.15.0/ebin /app/lib/goldrush-0.1.9/ebin /app/lib/guardian-1.1.0/ebin /app/lib/hackney-1.12.1/ebin /app/lib/http_mock_pal-0.1.0/ebin /app/lib/httpoison-1.1.1/ebin /app/lib/idna-5.1.1/ebin /app/lib/iex-1.6.6/ebin /app/lib/jose-1.8.4/ebin /app/lib/jsx-2.8.2/ebin /app/lib/lager-3.5.1/ebin /app/lib/logger-1.6.6/ebin /app/lib/logger_logstash_backend-5.0.0/ebin /app/lib/mariaex-0.8.4/ebin /app/lib/metrics-1.0.1/ebin /app/lib/mime-1.3.0/ebin /app/lib/mimerl-1.0.2/ebin /app/lib/mix-1.6.6/ebin /app/lib/ok-1.11.0/ebin /app/lib/parallel_stream-1.0.6/ebin /app/lib/phoenix-1.3.3/ebin /app/lib/phoenix_ecto-3.3.0/ebin /app/lib/phoenix_html-2.11.2/ebin /app/lib/phoenix_pubsub-1.0.2/ebin /app/lib/phoenix_pubsub_redis-2.1.4/ebin /app/lib/plug-1.6.2/ebin /app/lib/poison-3.1.0/ebin /app/lib/poolboy-1.5.1/ebin /app/lib/posexional-0.4.2/ebin /app/lib/postgrex-0.13.5/ebin /app/lib/quantum-2.2.7/ebin /app/lib/rabbit_common-3.7.5/ebin /app/lib/ranch-1.5.0/ebin /app/lib/ranch_proxy_protocol-1.5.0/ebin /app/lib/recon-2.3.2/ebin /app/lib/redix-0.6.1/ebin /app/lib/redix_pubsub-0.4.2/ebin /app/lib/soap-1.0/ebin /app/lib/ssl_verify_fun-1.1.1/ebin /app/lib/sweet_xml-0.6.5/ebin /app/lib/timex-3.3.0/ebin /app/lib/tzdata-0.5.16/ebin /app/lib/unicode_util_compat-0.3.1/ebin /app/lib/uuid-1.1.8/ebin -pa /app/lib/crash-0.0.0-dev/consolidated -noshell -noshell -noinput -boot /app/releases/0.0.0-dev/crash -sname crash@host-machine -setcookie ewua7iequ1eadiudaecomeiThoht8turaefeedee2zoo5feeleZiem8sahj0Iech7Chu5gaeR5akohpha2aiheezeebuech4reiVoubeepoY5biecugei1so7yeiLu0Tai2geexahlaiphoh3Pos7r -kernel inet_dist_listen_min 30038 inet_dist_listen_max 30038 -smp auto -mode embedded -extra --

app@0a9505fc8025:/app$ echo $REPLACE_OS_VARS
true
app@0a9505fc8025:/app$ echo $erlang_cookie
ewua7iequ1eadiudaecomeiThoht8turaefeedee2zoo5feeleZiem8sahj0Iech7Chu5gaeR5akohpha2aiheezeebuech4reiVoubeepoY5biecugei1so7yeiLu0Tai2geexahlaiphoh3Pos7r

app@0a9505fc8025:/app$ ERL_EPMD_PORT=20038 /app/bin/crash remote_console
▸  Received 'pang' from crash@host-machine!
▸  Possible reasons for this include:
▸    - The cookie is mismatched between us and the target node
▸    - We cannot establish a remote connection to the node
Node crash@host-machine is not running!

EPMD is indeed reachable:

app@0a9505fc8025:/app$ telnet host-machine 20038
Trying 10.43.55.71...
Connected to host-machine.
Escape character is '^]'.

Verbose Logs

Paste the output of the release command you ran with the --verbose flag below in the summary tags (this helps keep the issue easy to navigate):

``` app@10560086c267:/home/ubuntu/crash$ mix release --env=qa --verbose ==> Loading configuration.. ==> Assembling release.. ==> Building release crash:0.0.0-dev using environment qa ==> Discovered applications: > kernel-5.4.3.1 | | from: /usr/local/lib/erlang/lib/kernel-5.4.3.1 | applications: none | includes: none |_____ > stdlib-3.4.5 | | from: /usr/local/lib/erlang/lib/stdlib-3.4.5 | applications: | :kernel | includes: none |_____ > compiler-7.1.5 | | from: /usr/local/lib/erlang/lib/compiler-7.1.5 | applications: | :kernel | :stdlib | includes: none |_____ > elixir-1.6.6 | | from: /usr/local/lib/elixir/bin/../lib/elixir | applications: | :kernel | :stdlib | :compiler | includes: none |_____ > logger-1.6.6 | | from: /usr/local/lib/elixir/bin/../lib/logger | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > mime-1.3.0 | | from: _build/dev/lib/mime | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > crypto-4.2.2 | | from: /usr/local/lib/erlang/lib/crypto-4.2.2 | applications: | :kernel | :stdlib | includes: none |_____ > plug-1.6.2 | | from: _build/dev/lib/plug | applications: | :kernel | :stdlib | :elixir | :crypto | :logger | :mime | includes: none |_____ > poolboy-1.5.1 | | from: _build/dev/lib/poolboy | applications: | :kernel | :stdlib | includes: none |_____ > decimal-1.5.0 | | from: _build/dev/lib/decimal | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > ecto-2.2.10 | | from: _build/dev/lib/ecto | applications: | :kernel | :stdlib | :elixir | :logger | :decimal | :poolboy | :crypto | includes: none |_____ > phoenix_ecto-3.3.0 | | from: _build/dev/lib/phoenix_ecto | applications: | :kernel | :stdlib | :elixir | :logger | :ecto | :plug | includes: none |_____ > connection-1.0.4 | | from: _build/dev/lib/connection | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > redix-0.6.1 | | from: _build/dev/lib/redix | applications: | :kernel | :stdlib | :elixir | :logger | :connection | includes: none |_____ > exq_ui-0.9.0 | | from: _build/dev/lib/exq_ui | applications: | :kernel | :stdlib | :elixir | :logger | :redix | includes: none |_____ > artificery-0.2.6 | | from: _build/dev/lib/artificery | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > runtime_tools-1.12.5 | | from: /usr/local/lib/erlang/lib/runtime_tools-1.12.5 | applications: | :kernel | :stdlib | includes: none |_____ > distillery-2.0.8 | | from: _build/dev/lib/distillery | applications: | :kernel | :stdlib | :elixir | :runtime_tools | :logger | :artificery | includes: none |_____ > db_connection-1.1.3 | | from: _build/dev/lib/db_connection | applications: | :kernel | :stdlib | :elixir | :logger | :connection | includes: none |_____ > mariaex-0.8.4 | | from: _build/dev/lib/mariaex | applications: | :kernel | :stdlib | :elixir | :logger | :crypto | :decimal | :db_connection | includes: none |_____ > postgrex-0.13.5 | | from: _build/dev/lib/postgrex | applications: | :kernel | :stdlib | :elixir | :logger | :db_connection | :decimal | :crypto | includes: none |_____ > syntax_tools-2.1.4.1 | | from: /usr/local/lib/erlang/lib/syntax_tools-2.1.4.1 | applications: | :stdlib | includes: none |_____ > goldrush-0.1.9 | | from: _build/dev/lib/goldrush | applications: | :kernel | :stdlib | :syntax_tools | :compiler | includes: none |_____ > phoenix_pubsub-1.0.2 | | from: _build/dev/lib/phoenix_pubsub | applications: | :kernel | :stdlib | :elixir | :logger | :crypto | includes: none |_____ > eex-1.6.6 | | from: /usr/local/lib/elixir/bin/../lib/eex | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > poison-3.1.0 | | from: _build/dev/lib/poison | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > phoenix-1.3.3 | | from: _build/dev/lib/phoenix | applications: | :kernel | :stdlib | :elixir | :plug | :poison | :logger | :eex | :phoenix_pubsub | :crypto | includes: none |_____ > cowlib-1.0.2 | | from: _build/dev/lib/cowlib | applications: | :kernel | :stdlib | :crypto | includes: none |_____ > asn1-5.0.5 | | from: /usr/local/lib/erlang/lib/asn1-5.0.5 | applications: | :kernel | :stdlib | includes: none |_____ > public_key-1.5.2 | | from: /usr/local/lib/erlang/lib/public_key-1.5.2 | applications: | :asn1 | :crypto | :kernel | :stdlib | includes: none |_____ > ssl-8.2.6 | | from: /usr/local/lib/erlang/lib/ssl-8.2.6 | applications: | :crypto | :public_key | :kernel | :stdlib | includes: none |_____ > ranch-1.5.0 | | from: _build/dev/lib/ranch | applications: | :kernel | :stdlib | :ssl | includes: none |_____ > cowboy-1.0.4 | | from: _build/dev/lib/cowboy | applications: | :kernel | :stdlib | :ranch | :cowlib | :crypto | includes: none |_____ > basic_auth-2.2.2 | | from: _build/dev/lib/basic_auth | applications: | :kernel | :stdlib | :elixir | :logger | :cowboy | :plug | includes: none |_____ > absinthe-1.4.12 | | from: _build/dev/lib/absinthe | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > absinthe_plug-1.4.4 | | from: _build/dev/lib/absinthe_plug | applications: | :kernel | :stdlib | :elixir | :logger | :plug | :absinthe | includes: none |_____ > uuid-1.1.8 | | from: _build/dev/lib/uuid | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > recon-2.3.2 | | from: _build/dev/lib/recon | applications: | :kernel | :stdlib | includes: none |_____ > ranch_proxy_protocol-1.5.0 | | from: _build/dev/lib/ranch_proxy_protocol | applications: | :kernel | :stdlib | :ranch | includes: none |_____ > jsx-2.8.2 | | from: _build/dev/lib/jsx | applications: | :kernel | :stdlib | includes: none |_____ > lager-3.5.1 | | from: _build/dev/lib/lager | applications: | :kernel | :stdlib | :goldrush | includes: none |_____ > xmerl-1.3.16 | | from: /usr/local/lib/erlang/lib/xmerl-1.3.16 | applications: | :kernel | :stdlib | includes: none |_____ > rabbit_common-3.7.5 | | from: _build/dev/lib/rabbit_common | applications: | :kernel | :stdlib | :compiler | :syntax_tools | :xmerl | :lager | :jsx | :ranch | :ranch_proxy_protocol | :recon | includes: none |_____ > amqp_client-3.7.5 | | from: _build/dev/lib/amqp_client | applications: | :kernel | :stdlib | :xmerl | :rabbit_common | includes: none |_____ > inets-6.5.2.1 | | from: /usr/local/lib/erlang/lib/inets-6.5.2.1 | applications: | :kernel | :stdlib | includes: none |_____ > redix_pubsub-0.4.2 | | from: _build/dev/lib/redix_pubsub | applications: | :kernel | :stdlib | :elixir | :logger | :redix | includes: none |_____ > phoenix_pubsub_redis-2.1.4 | | from: _build/dev/lib/phoenix_pubsub_redis | applications: | :kernel | :stdlib | :elixir | :logger | :poolboy | :redix | :redix_pubsub | :phoenix_pubsub | includes: none |_____ > exq-0.11.0 | | from: _build/dev/lib/exq | applications: | :kernel | :stdlib | :elixir | :logger | :redix | :uuid | includes: none |_____ > bunt-0.2.0 | | from: _build/dev/lib/bunt | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > credo-0.9.3 | | from: _build/dev/lib/credo | applications: | :kernel | :stdlib | :elixir | :bunt | :logger | :inets | includes: none |_____ > absinthe_ecto-0.1.3 | | from: _build/dev/lib/absinthe_ecto | applications: | :kernel | :stdlib | :elixir | :logger | :absinthe | :ecto | includes: none |_____ > metrics-1.0.1 | | from: _build/dev/lib/metrics | applications: | :kernel | :stdlib | includes: none |_____ > ssl_verify_fun-1.1.1 | | from: _build/dev/lib/ssl_verify_fun | applications: | :kernel | :stdlib | :ssl | includes: none |_____ > certifi-2.3.1 | | from: _build/dev/lib/certifi | applications: | :kernel | :stdlib | includes: none |_____ > mimerl-1.0.2 | | from: _build/dev/lib/mimerl | applications: | :kernel | :stdlib | includes: none |_____ > unicode_util_compat-0.3.1 | | from: _build/dev/lib/unicode_util_compat | applications: | :kernel | :stdlib | includes: none |_____ > idna-5.1.1 | | from: _build/dev/lib/idna | applications: | :kernel | :stdlib | :unicode_util_compat | includes: none |_____ > hackney-1.12.1 | | from: _build/dev/lib/hackney | applications: | :kernel | :stdlib | :crypto | :asn1 | :public_key | :ssl | :idna | :mimerl | :certifi | :ssl_verify_fun | :metrics | includes: none |_____ > httpoison-1.1.1 | | from: _build/dev/lib/httpoison | applications: | :kernel | :stdlib | :elixir | :hackney | includes: none |_____ > posexional-0.4.2 | | from: _build/dev/lib/posexional | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > sweet_xml-0.6.5 | | from: _build/dev/lib/sweet_xml | applications: | :kernel | :stdlib | :elixir | :xmerl | includes: none |_____ > phoenix_html-2.11.2 | | from: _build/dev/lib/phoenix_html | applications: | :kernel | :stdlib | :elixir | :logger | :plug | includes: none |_____ > wx-1.8.3 | | from: /usr/local/lib/erlang/lib/wx-1.8.3 | applications: | :stdlib | :kernel | includes: none |_____ > exjsx-3.2.1 | | from: _build/dev/lib/exjsx | applications: | :kernel | :stdlib | :elixir | :jsx | includes: none |_____ > ex_prima_toolbox-0.0.4 | | from: _build/dev/lib/ex_prima_toolbox | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > parallel_stream-1.0.6 | | from: _build/dev/lib/parallel_stream | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > csv-2.1.1 | | from: _build/dev/lib/csv | applications: | :kernel | :stdlib | :elixir | :parallel_stream | includes: none |_____ > hipe-3.17.1 | | from: /usr/local/lib/erlang/lib/hipe-3.17.1 | applications: | :kernel | :stdlib | includes: none |_____ > combine-0.10.0 | | from: _build/dev/lib/combine | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > gettext-0.15.0 | | from: _build/dev/lib/gettext | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > tzdata-0.5.16 | | from: _build/dev/lib/tzdata | applications: | :kernel | :stdlib | :elixir | :hackney | :logger | includes: none |_____ > timex-3.3.0 | | from: _build/dev/lib/timex | applications: | :kernel | :stdlib | :elixir | :logger | :tzdata | :gettext | :combine | includes: none |_____ > logger_logstash_backend-5.0.0 | | from: _build/dev/lib/logger_logstash_backend | applications: | :kernel | :stdlib | :elixir | :logger | :timex | :exjsx | includes: none |_____ > ex_aws-2.0.2 | | from: _build/dev/lib/ex_aws | applications: | :kernel | :stdlib | :elixir | :logger | :crypto | includes: none |_____ > fetcher-0.3.0 | | from: _build/dev/lib/fetcher | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > mix-1.6.6 | | from: /usr/local/lib/elixir/bin/../lib/mix | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > dialyzer-3.2.4 | | from: /usr/local/lib/erlang/lib/dialyzer-3.2.4 | applications: | :compiler | :hipe | :kernel | :stdlib | :wx | includes: none |_____ > dialyxir-0.5.1 | | from: _build/dev/lib/dialyxir | applications: | :kernel | :stdlib | :elixir | :dialyzer | :crypto | :mix | includes: none |_____ > gen_smtp-0.12.0 | | from: _build/dev/lib/gen_smtp | applications: | :kernel | :stdlib | :crypto | :asn1 | :public_key | :ssl | includes: none |_____ > bamboo-1.0.0-rc.3 | | from: _build/dev/lib/bamboo | applications: | :kernel | :stdlib | :elixir | :logger | :hackney | :poison | includes: none |_____ > bamboo_smtp-1.5.0-rc.4 | | from: _build/dev/lib/bamboo_smtp | applications: | :kernel | :stdlib | :elixir | :gen_smtp | :logger | :bamboo | includes: none |_____ > base64url-0.0.1 | | from: _build/dev/lib/base64url | applications: | :kernel | :stdlib | includes: none |_____ > jose-1.8.4 | | from: _build/dev/lib/jose | applications: | :kernel | :stdlib | :elixir | :crypto | :asn1 | :public_key | :base64url | includes: none |_____ > guardian-1.1.0 | | from: _build/dev/lib/guardian | applications: | :kernel | :stdlib | :elixir | :logger | :poison | :jose | :uuid | includes: none |_____ > erlsom-1.2.1 | | from: _build/dev/lib/erlsom | applications: | :kernel | :stdlib | :inets | includes: none |_____ > ecto_enum-1.1.0 | | from: _build/dev/lib/ecto_enum | applications: | :kernel | :stdlib | :elixir | :logger | :ecto | includes: none |_____ > sasl-3.1.2 | | from: /usr/local/lib/erlang/lib/sasl-3.1.2 | applications: | :kernel | :stdlib | includes: none |_____ > http_mock_pal-0.1.0 | | from: _build/dev/lib/http_mock_pal | applications: | :kernel | :stdlib | :elixir | :logger | :cowboy | :plug | includes: none |_____ > eternal-1.2.0 | | from: _build/dev/lib/eternal | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > ok-1.11.0 | | from: _build/dev/lib/ok | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > briefly-0.3.0 | | from: _build/dev/lib/briefly | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > absinthe_relay-1.4.3 | | from: _build/dev/lib/absinthe_relay | applications: | :kernel | :stdlib | :elixir | :logger | :absinthe | includes: none |_____ > gen_stage-0.14.0 | | from: _build/dev/lib/gen_stage | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > crontab-1.1.3 | | from: _build/dev/lib/crontab | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > quantum-2.2.7 | | from: _build/dev/lib/quantum | applications: | :kernel | :stdlib | :elixir | :logger | :crontab | :gen_stage | includes: none |_____ > fun_with_flags-1.0.0 | | from: _build/dev/lib/fun_with_flags | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > fun_with_flags_ui-0.4.1 | | from: _build/dev/lib/fun_with_flags_ui | applications: | :kernel | :stdlib | :elixir | :logger | :fun_with_flags | :plug | includes: none |_____ > amqp-1.0.3 | | from: _build/dev/lib/amqp | applications: | :kernel | :stdlib | :elixir | :lager | :logger | :amqp_client | includes: none |_____ > file_system-0.2.5 | | from: _build/dev/lib/file_system | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > phoenix_live_reload-1.1.5 | | from: _build/dev/lib/phoenix_live_reload | applications: | :kernel | :stdlib | :elixir | :logger | :phoenix | :file_system | includes: none |_____ > cors_plug-1.5.2 | | from: _build/dev/lib/cors_plug | applications: | :kernel | :stdlib | :elixir | :logger | includes: none |_____ > ex_aws_s3-2.0.0 | | from: _build/dev/lib/ex_aws_s3 | applications: | :kernel | :stdlib | :elixir | :logger | :ex_aws | includes: none |_____ > hound-1.0.4 | | from: _build/dev/lib/hound | applications: | :kernel | :stdlib | :elixir | :hackney | :poison | :logger | includes: none |_____ > soap-1.0 | | from: _build/dev/lib/soap | applications: | :kernel | :stdlib | includes: none |_____ > cachex-3.0.2 | | from: _build/dev/lib/cachex | applications: | :kernel | :stdlib | :elixir | :logger | :eternal | includes: none |_____ > short_maps-0.1.2 | | from: _build/dev/lib/short_maps | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > faker-0.10.0 | | from: _build/dev/lib/faker | applications: | :kernel | :stdlib | :elixir | :crypto | includes: none |_____ > crash-0.0.0-dev | | from: _build/dev/lib/crash | applications: | :kernel | :stdlib | :elixir | :logger | :runtime_tools | :bamboo | :bamboo_smtp | :erlsom | :faker | :redix | :redix_pubsub | :short_maps | :gettext | :briefly | :ok | :cachex | :absinthe | :soap | :dialyxir | :fetcher | :csv | :ex_prima_toolbox | :hound | :timex | :logger_logstash_backend | :sweet_xml | :ex_aws | :ex_aws_s3 | :posexional | :httpoison | :credo | :phoenix_pubsub | :cowboy | :phoenix_pubsub_redis | :exq | :mime | :phoenix_html | :absinthe_plug | :http_mock_pal | :cors_plug | :basic_auth | :phoenix | :phoenix_live_reload | :guardian | :amqp | :postgrex | :mariaex | :ecto | :absinthe_relay | :absinthe_ecto | :fun_with_flags | :fun_with_flags_ui | :quantum | :ecto_enum | :distillery | :exq_ui | :phoenix_ecto | includes: none |_____ > iex-1.6.6 | | from: /usr/local/lib/elixir/bin/../lib/iex | applications: | :kernel | :stdlib | :elixir | includes: none |_____ ==> Running validation checks.. > Mix.Releases.Checks.Erts * WARN > Mix.Releases.Checks.Cookie * WARN > Mix.Releases.Checks.LoadedOrphanedApps * PASS IMPORTANT: You have opted to *not* include the Erlang runtime system (ERTS). You must ensure that the version of Erlang this release is built with matches the version the release will be run with once deployed. It will fail to run otherwise. Attention! You did not provide a cookie for the erlang distribution protocol in rel/config.exs For backwards compatibility, the release name will be used as a cookie, which is potentially a security risk! Please generate a secure cookie and use it with `set cookie: ` in rel/config.exs. This will be an error in a future release. ==> Generated overlay vars: release_name=:crash release_version="0.0.0-dev" is_upgrade=false upgrade_from=:latest dev_mode=false include_erts=false include_src=false include_system_libs=false erl_opts="" run_erl_env="" erts_vsn="9.3.3.1" output_dir="_build/dev/rel/crash" ==> Copying applications to _build/dev/rel/crash ==> Generating start_erl.data ==> Generating vm.args from rel/vm.args ==> Generating sys.config from config/config.exs ==> Generating boot scripts ==> Generating RELEASES ==> Applying overlays ==> Applying mkdir overlay dst: releases/0.0.0-dev/hooks ==> Applying mkdir overlay dst: releases/0.0.0-dev/hooks/pre_configure.d ==> Applying mkdir overlay dst: releases/0.0.0-dev/hooks/post_configure.d ==> Applying mkdir overlay dst: releases/0.0.0-dev/hooks/pre_start.d ==> Applying mkdir overlay dst: releases/0.0.0-dev/hooks/post_start.d ==> Applying mkdir overlay dst: releases/0.0.0-dev/hooks/pre_stop.d ==> Applying mkdir overlay dst: releases/0.0.0-dev/hooks/post_stop.d ==> Applying mkdir overlay dst: releases/0.0.0-dev/hooks/pre_upgrade.d ==> Applying mkdir overlay dst: releases/0.0.0-dev/hooks/post_upgrade.d ==> Applying copy overlay src: _build/dev/lib/distillery/priv/libexec dst: releases/0.0.0-dev/libexec ==> Applying mkdir overlay dst: releases/0.0.0-dev/commands ==> Applying copy overlay src: rel/commands/migrate.sh dst: releases/0.0.0-dev/commands/migrate.sh ==> Applying copy overlay src: rel/commands/rebuild_read_model.sh dst: releases/0.0.0-dev/commands/rebuild.sh ==> Applying mkdir overlay dst: config ==> Applying copy overlay src: config/secrets.yml dst: config/secrets.yml ==> Packaging release.. ==> Archiving crash-0.0.0-dev ==> Writing archive to /home/ubuntu/crash/_build/dev/rel/crash/releases/0.0.0-dev/crash.tar.gz ==> Updating archive.. ==> Stripping system libs from release archive since ERTS is not included ==> Saving archive.. ==> Archive saved! Release succesfully built! To start the release you have built, you can use one of the following tasks: # start a shell, like 'iex -S mix' > _build/dev/rel/crash/bin/crash console # start in the foreground, like 'mix run --no-halt' > _build/dev/rel/crash/bin/crash foreground # start in the background, must be stopped with the 'stop' command > _build/dev/rel/crash/bin/crash start If you started a release elsewhere, and wish to connect to it: # connects a local shell to the running node > _build/dev/rel/crash/bin/crash remote_console # connects directly to the running node's console > _build/dev/rel/crash/bin/crash attach For a complete listing of commands and their use: > _build/dev/rel/crash/bin/crash help ```

Description of issue

use Mix.Releases.Config,
  # This sets the default release built by `mix release`
  default_release: :default,
  # This sets the default environment used by `mix release`
  default_environment: :dev

# For a full list of config options for both releases
# and environments, visit https://hexdocs.pm/distillery/configuration.html

# You may define one or more environments in this file,
# an environment's settings will override those of a release
# when building in that environment, this combination of release
# and environment configuration is called a profile

environment :dev do
  set(dev_mode: true)
  set(include_erts: false)

  set(
    commands: [
      migrate: "rel/commands/migrate.sh",
      rebuild: "rel/commands/rebuild_read_model.sh"
    ]
  )
end

environment :qa do
  set(include_erts: false)
  set(include_src: false)

  set(
    commands: [
      migrate: "rel/commands/migrate.sh",
      rebuild: "rel/commands/rebuild_read_model.sh"
    ]
  )
end

environment :staging do
  set(include_erts: false)
  set(include_src: false)

  set(
    commands: [
      migrate: "rel/commands/migrate.sh",
      rebuild: "rel/commands/rebuild_read_model.sh"
    ]
  )
end

environment :production do
  set(include_erts: false)
  set(include_src: false)

  set(
    commands: [
      migrate: "rel/commands/migrate.sh",
      rebuild: "rel/commands/rebuild_read_model.sh"
    ]
  )
end

# You may define one or more releases in this file.
# If you have not set a default release, or selected one
# when running `mix release`, the first release in the file
# will be used by default

release :crash do
  set(version: current_version(:crash))
  set(vm_args: "rel/vm.args")

  set(
    overlays: [
      {:mkdir, "config"},
      {:copy, "config/secrets.yml", "config/secrets.yml"}
    ]
  )
end

We're using the method described here to set the cookie from an env variable: https://hexdocs.pm/distillery/config/vm.args.html and it was working before upgrading to 2.0.9.

Please let me know if you need anything else to debug this.

Thank you!

bitwalker commented 6 years ago

Looking into this - I haven't had trouble with this yet, but I wonder if it has anything to do with the interaction with ERL_EPMD_PORT

bitwalker commented 6 years ago

Looks like the problem is setting -sname using the format name@host - the release_ctl script sees the @ and assumes it is a fully-qualified name. This is technically a bug, since name@shorthost is a valid form for -sname, but you can workaround it by using just -sname name instead. Erlang will infer the short hostname in that case.

andreausu commented 6 years ago

@bitwalker thank you for the extremely quick turnaround on this! I can confirm that https://github.com/bitwalker/distillery/commit/c83332804bce88089f627d4753bfcfb2c31f2504 fixes the issue.