bitwalker / distillery

Simplify deployments in Elixir with OTP releases!
MIT License
2.96k stars 396 forks source link

Unable to ping or remote_console into application after upgrading to 2.0 #699

Open jeremyowensboggs opened 4 years ago

jeremyowensboggs commented 4 years ago

Steps to reproduce

Our vm.args.eex

## Name of the node
-sname blaster

## Cookie for distributed erlang
-setcookie <%= release.profile.cookie %>

# Enable SMP automatically based on availability
-smp auto

Verbose Logs

This doesn't work:

sudo ./blaster2 ping Automatically converted short name (blaster) to long name (blaster@k--3652t)! It is recommended that you set a fully-qualified name in vm.args instead ▸ Received 'pang' from blaster@k--3652t! ▸ Possible reasons for this include: ▸ - The cookie is mismatched between us and the target node ▸ - We cannot establish a remote connection to the node

But this does

sudo ./blaster2 ping --name blaster@k--3652t.local Automatically converted short name (blaster) to long name (blaster@k--3652t)! It is recommended that you set a fully-qualified name in vm.args instead pong

Unfortunately, the remote_console does not allow the --name options, so I still cannot connect to the remote_console

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: Mix.env()

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

If you are running Phoenix, you should make sure that

server: true is set and the code reloader is disabled,

even in dev mode.

It is recommended that you build with MIX_ENV=prod and pass

the --env flag to Distillery explicitly if you want to use

dev mode.

set(dev_mode: true) set(include_erts: false) set(cookie: :"randomstringofstuff" end

environment :stage do set(include_erts: true) set(include_src: false) set(cookie: :"randomstringofstuff") end

environment :prod do set(include_erts: true) set(include_src: false) set(cookie: :"randomstringofstuff") 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 :blaster2 do set(version: current_version(:blaster)) set(vm_args: "rel/config/vm.args.eex")

set( applications: [ :runtime_tools, blaster: :permanent, blaster_web: :permanent, devices: :permanent ] )

set( commands: [ "setup.couchdb": "rel/commands/setup_couchdb.sh", "setup.blaster": "rel/commands/setup_blaster.sh", "configure.rankone": "rel/commands/configure_rankone.sh" ] ) end


- Is there documentation that says one thing, but Distillery does
  another? If so, please link the doc here so it can be updated if
  it's a documentation issue, or so that the fix can be based around
  what's documented.
- If this is a runtime configuration issue, please also provide your config file 
  (with any sensitive information stripped of course). This is almost
  always necessary to understand why some configuration may not be working.

If you do not provide the above information and I need it to help troubleshoot, it may delay things significantly,
as I will have to ask you for all of these things anyway. Help me help you!
nifoc commented 4 years ago

We're facing the exact same issue. To add a new observation:

For ping the --name argument is specified twice and for remote_console it's only specified once.

# ping
/home/username/appname/erts-10.4/bin/erl \
-boot_var ERTS_LIB_DIR /home/username/appname/lib \
-boot /home/username/appname/bin/start_clean \
-config /home/username/appname/var/sys.config -noshell \
-s elixir start_cli -logger handle_sasl_reports false -extra \
-e Distillery.Releases.Runtime.Control.main \
--logger-sasl-reports false -- ping --name=appname \
--cookie=appname --name=appname@username
# remote_console
/home/username/appname/erts-10.4/bin/erl \
-boot_var ERTS_LIB_DIR /home/username/appname/lib \
-boot /home/username/appname/bin/start_clean \
-config /home/username/appname/var/sys.config -noshell \
-s elixir start_cli -logger handle_sasl_reports false -extra \
-e Distillery.Releases.Runtime.Control.main \
--logger-sasl-reports false -- ping --name=appname \
--cookie=appname