Skip to content

Nerves vm.args.eex prevents proper application of cookie through config or env variables #182

@LostKobrakai

Description

@LostKobrakai

Environment

  • Elixir version (elixir -v): 1.10.4

  • Nerves environment: (mix nerves.env --info)
    |nerves_bootstrap| Environment Package List

    No packages found
    |nerves_bootstrap| Loadpaths Start

Nerves environment
MIX_TARGET: host
MIX_ENV: dev

NERVES_SYSTEM is unset
NERVES_TOOLCHAIN is unset
|nerves_bootstrap| Environment Variable List
target: host
toolchain: unset
system: unset
app: …/05_elixir/edith

|nerves_bootstrap| Loadpaths End

  • Additional information about your host, target hardware or environment that
    may help

Current behavior

Running a shoehorn release (on host) results in the cookie being read from $HOME/.erlang.cookie instead of the one configured through the normal mix release means (config or env variable)

❯❯❯❯ RELEASE_BOOT_SCRIPT=shoehorn RELEASE_COOKIE=shoehorn _build/dev/rel/shoehorn/bin/shoehorn start_iex
heart_beat_kill_pid = 3244
heart_beat_timeout = 30
2021-04-26 15:15:47.218544 Multiple -mode given to erl, using the first, ~p
        ["embedded"]
Erlang/OTP 23 [erts-11.1.1] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
=WARNING REPORT==== 26-Apr-2021::15:15:47.218544 ===
Multiple -mode given to erl, using the first, ["embedded"]
[Shoehorn] Init app :nerves_runtime undefined. Skipping
[Shoehorn] Init app :vintage_net undefined. Skipping
:JKIIVXBQQLKXJEANCEZM
…

Removing the -setcookie in vm.args.eex resolves the issue and also doesn't seem to break releases run on targets. Mix releases are always started with an cookie set on the cli. A random cookie is generated when building the release unless a specific one is explicitly set.

Expected behavior

The cookie configured in mix.exs or via the env variables is correctly applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions