erlang 22.0.7
elixir 1.9.1
I am trying to test release.
I can success with build. but, It can not start with some error messages.
{"init terminating in do_boot",{'cannot get bootfile','/Users/marocchino/Documents/backend/_build/prod/rel/backend/bin/start.boot'}}
init terminating in do_boot ({cannot get bootfile,/Users/marocchino/Documents/backend/_build/prod/rel/backend/bin/start.boot})
Crash dump is being written to: erl_crash.dump...done
BTW, start.boot file was exists in release directory.
$ ls _build/prod/rel/backend/bin
backend backend.bat
$ ls _build/prod/rel/backend/releases/0.1.0/
backend.rel elixir env.sh releases.exs start.script start_clean.script vm.args
consolidated env.bat iex start.boot start_clean.boot sys.config
Do I need more path setting?
Full log is below:
$ mix compile
==> deferred_config
Compiling 2 files (.ex)
warning: variable "k" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/replacing_walk.ex:70: ReplacingWalk.walk/3
warning: variable "v" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/replacing_walk.ex:70: ReplacingWalk.walk/3
Generated deferred_config app
==> file_system
Compiling 7 files (.ex)
Generated file_system app
==> connection
Compiling 1 file (.ex)
Generated connection app
==> gettext
Compiling 1 file (.erl)
Compiling 20 files (.ex)
Generated gettext app
===> Compiling ranch
===> Compiling telemetry
==> decimal
Compiling 1 file (.ex)
Generated decimal app
==> jason
Compiling 8 files (.ex)
Generated jason app
==> peerage
Compiling 6 files (.ex)
Generated peerage app
==> db_connection
Compiling 14 files (.ex)
Generated db_connection app
==> ecto
Compiling 54 files (.ex)
Generated ecto app
==> phoenix_pubsub
Compiling 13 files (.ex)
Generated phoenix_pubsub app
===> Compiling cowlib
===> Compiling cowboy
==> mime
Compiling 2 files (.ex)
Generated mime app
==> postgrex
Compiling 61 files (.ex)
Generated postgrex app
==> ecto_sql
Compiling 25 files (.ex)
Generated ecto_sql app
==> plug_crypto
Compiling 4 files (.ex)
Generated plug_crypto app
==> plug
Compiling 1 file (.erl)
Compiling 39 files (.ex)
warning: System.stacktrace/0 outside of rescue/catch clauses is deprecated. If you want to support only Elixir v1.7+, you must access __STACKTRACE__ inside a rescue/catch. If you want to support earlier Elixir versions, move System.stacktrace/0 inside a rescue/catch
lib/plug/conn/wrapper_error.ex:23
Generated plug app
==> phoenix_html
Compiling 8 files (.ex)
Generated phoenix_html app
==> plug_cowboy
Compiling 6 files (.ex)
Generated plug_cowboy app
==> phoenix
Compiling 67 files (.ex)
Generated phoenix app
==> phoenix_live_reload
Compiling 4 files (.ex)
Generated phoenix_live_reload app
==> phoenix_ecto
Compiling 6 files (.ex)
Generated phoenix_ecto app
==> backend
Compiling 13 files (.ex)
Generated backend app
$ MIX_ENV=prod mix release
==> deferred_config
Compiling 2 files (.ex)
warning: variable "k" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/replacing_walk.ex:70: ReplacingWalk.walk/3
warning: variable "v" is unused (if the variable is not meant to be used, prefix it with an underscore)
lib/replacing_walk.ex:70: ReplacingWalk.walk/3
Generated deferred_config app
==> connection
Compiling 1 file (.ex)
Generated connection app
==> gettext
Compiling 1 file (.erl)
Compiling 20 files (.ex)
Generated gettext app
===> Compiling ranch
===> Compiling telemetry
==> decimal
Compiling 1 file (.ex)
Generated decimal app
==> jason
Compiling 8 files (.ex)
Generated jason app
==> peerage
Compiling 6 files (.ex)
Generated peerage app
==> db_connection
Compiling 14 files (.ex)
Generated db_connection app
==> ecto
Compiling 54 files (.ex)
Generated ecto app
==> phoenix_pubsub
Compiling 13 files (.ex)
Generated phoenix_pubsub app
===> Compiling cowlib
===> Compiling cowboy
==> mime
Compiling 2 files (.ex)
Generated mime app
==> postgrex
Compiling 61 files (.ex)
Generated postgrex app
==> ecto_sql
Compiling 25 files (.ex)
Generated ecto_sql app
==> plug_crypto
Compiling 4 files (.ex)
Generated plug_crypto app
==> plug
Compiling 1 file (.erl)
Compiling 39 files (.ex)
warning: System.stacktrace/0 outside of rescue/catch clauses is deprecated. If you want to support only Elixir v1.7+, you must access __STACKTRACE__ inside a rescue/catch. If you want to support earlier Elixir versions, move System.stacktrace/0 inside a rescue/catch
lib/plug/conn/wrapper_error.ex:23
Generated plug app
==> phoenix_html
Compiling 8 files (.ex)
Generated phoenix_html app
==> plug_cowboy
Compiling 6 files (.ex)
Generated plug_cowboy app
==> phoenix
Compiling 67 files (.ex)
Generated phoenix app
==> phoenix_ecto
Compiling 6 files (.ex)
Generated phoenix_ecto app
==> backend
Compiling 13 files (.ex)
Generated backend app
* assembling backend-0.1.0 on MIX_ENV=prod
* using config/releases.exs to configure the release at runtime
* creating _build/prod/rel/backend/releases/0.1.0/vm.args
* creating _build/prod/rel/backend/releases/0.1.0/env.sh
* creating _build/prod/rel/backend/releases/0.1.0/env.bat
* skipping elixir.bat for windows (bin/elixir.bat not found in the Elixir installation)
* skipping iex.bat for windows (bin/iex.bat not found in the Elixir installation)
Release created at _build/prod/rel/backend!
# To start your system
_build/prod/rel/backend/bin/backend start
Once the release is running:
# To connect to it remotely
_build/prod/rel/backend/bin/backend remote
# To stop it gracefully (you may also send SIGINT/SIGTERM)
_build/prod/rel/backend/bin/backend stop
To list all commands:
_build/prod/rel/backend/bin/backend
$ DB_URL=ecto://postgres:postgres@localhost/backend_dev \
> RELEASE_COOKIE=foo \
> SECRET_KEY_BASE=foo \
> HOSTNAME=127.0.0.1 \
> SERVICE_NAME=localhost.svc \
> APP_HOST=localhost \
> PORT=4000 \
> _build/prod/rel/backend/bin/backend start
{"init terminating in do_boot",{'cannot get bootfile','/Users/marocchino/Documents/backend/_build/prod/rel/backend/bin/start.boot'}}
init terminating in do_boot ({cannot get bootfile,/Users/marocchino/Documents/backend/_build/prod/rel/backend/bin/start.boot})
Crash dump is being written to: erl_crash.dump...done
# mix.exs
defmodule Backend.MixProject do
use Mix.Project
def project do
[
app: :backend,
version: "0.1.0",
elixir: "~> 1.9",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps()
]
end
# Configuration for the OTP application.
#
# Type `mix help compile.app` for more information.
def application do
[
mod: {Backend.Application, []},
extra_applications: [:logger, :runtime_tools, :peerage]
]
end
# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
# Specifies your project dependencies.
#
# Type `mix help deps` for examples and options.
defp deps do
[
{:phoenix, "~> 1.4.9"},
{:phoenix_pubsub, "~> 1.1"},
{:phoenix_ecto, "~> 4.0"},
{:ecto_sql, "~> 3.1"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 2.11"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:gettext, "~> 0.11"},
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.0"},
{:peerage, "~> 1.0"}
]
end
# Aliases are shortcuts or tasks specific to the current project.
# For example, to create, migrate and run the seeds file at once:
#
# $ mix ecto.setup
#
# See the documentation for `Mix` for more info on aliases.
defp aliases do
[
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate", "test"]
]
end
end
# config/releases.exs
import Config
service_name = System.fetch_env!("SERVICE_NAME")
db_url = System.fetch_env!("DB_URL")
secret_key_base = System.fetch_env!("SECRET_KEY_BASE")
port = System.fetch_env!("PORT")
config :backend, Backend.Repo, url: db_url
config :backend, BackendWeb.Endpoint,
http: [port: port],
secret_key_base: secret_key_base,
url: [host: {:system, "APP_HOST"}, port: {:system, "PORT"}]
config :peerage,
via: Peerage.Via.Dns,
dns_name: service_name,
app_name: "backend"
rel/env.sh.eex
#!/bin/sh
# Sets and enables heart (recommended only in daemon mode)
# case $RELEASE_COMMAND in
# daemon*)
# HEART_COMMAND="$RELEASE_ROOT/bin/$RELEASE_NAME $RELEASE_COMMAND"
# export HEART_COMMAND
# export ELIXIR_ERL_OPTIONS="-heart"
# ;;
# *)
# ;;
# esac
# Set the release to work across nodes. If using the long name format like
# the one below (my_app@127.0.0.1), you need to also uncomment the
# RELEASE_DISTRIBUTION variable below.
export RELEASE_DISTRIBUTION=backend
export RELEASE_NODE=<%= @release.name %>@${HOSTNAME}