Init terminating in do_boot in Elixir 1.9

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}

update: that part was wrong. I update that It is little progress.

export RELEASE_DISTRIBUTION=name

but still hanging on start. I can call with rpc but, no 4000 port response.
It occurs when I generate a project with --no-webpack option.

$ 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=4001 _build/prod/rel/backend/bin/backend start
# no response after this.
# another terminal
$ 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=4001 _build/prod/rel/backend/bin/backend rpc 'IO.inspect Application.loaded_applications'
[
  {:plug_cowboy, 'A Plug adapter for Cowboy', '2.1.0'},
  {:kernel, 'ERTS  CXC 138 10', '6.4.1'},
  {:eex, 'eex', '1.9.1'},
  {:plug_crypto, 'Crypto-related functionality for the web, used by Plug.',
   '1.0.0'},
  {:gettext, 'Internationalization and localization through gettext', '0.17.0'},
  {:sasl, 'SASL  CXC 138 11', '3.4'},
  {:peerage,
   'Easy clustering, pluggable discovery: via DNS (for Kubernetes, Weave, discoverd, Swarm and others), UDP multicast, or a plain list of nodes. Easy extensibility for custom Providers.\n',
   '1.0.3'},
  {:phoenix_pubsub, 'Distributed PubSub and Presence platform', '1.1.2'},
  {:telemetry, 'Dynamic dispatching library for metrics and instrumentations',
   '0.4.0'},
  {:crypto, 'CRYPTO', '4.5.1'},
  {:elixir, 'elixir', '1.9.1'},
  {:ecto, 'A toolkit for data mapping and language integrated query for Elixir',
   '3.1.7'},
  {:postgrex, 'PostgreSQL driver for Elixir', '0.15.0'},
  {:ranch, 'Socket acceptor pool for TCP protocols.', '1.7.1'},
  {:mime, 'A MIME type module for Elixir', '1.3.1'},
  {:logger, 'logger', '1.9.1'},
  {:decimal, 'Arbitrary precision decimal arithmetic.', '1.8.0'},
  {:deferred_config,
   'Seamless runtime config with one line of code. No special accessors or mappings. Full support for \'{:system...} tuple\' and \'{m,f,a}\' runtime config patterns.',
   '0.1.1'},
  {:ssl, 'Erlang/OTP SSL application', '9.3.5'},
  {:phoenix_html, 'Phoenix view functions for working with HTML templates',
   '2.13.3'},
  {:db_connection,
   'Database connection behaviour for database transactions and connection pooling\n',
   '2.1.1'},
  {:plug,
   'A specification and conveniences for composable modules between web applications',
   '1.8.3'},
  {:stdlib, 'ERTS  CXC 138 10', '3.9.2'},
  {:connection, 'Connection behaviour for connection processes\n', '1.0.4'},
  {:public_key, 'Public key infrastructure', '1.6.7'},
  {:compiler, 'ERTS  CXC 138 10', '7.4.4'},
  {:runtime_tools, 'RUNTIME_TOOLS', '1.13.3'},
  {:phoenix,
   'Productive. Reliable. Fast. A productive web framework that\ndoes not compromise speed or maintainability.\n',
   '1.4.9'},
  {:jason, 'A blazing fast JSON parser and generator in pure Elixir.\n',
   '1.1.2'},
  {:cowlib, 'Support library for manipulating Web protocols.', '2.7.3'},
  {:phoenix_ecto, 'Integration between Phoenix & Ecto', '4.0.0'},
  {:ecto_sql, 'SQL-based adapters for Ecto and database migrations', '3.1.6'},
  {:cowboy, 'Small, fast, modern HTTP server.', '2.6.3'},
  {:backend, 'backend', '0.1.0'},
  {:asn1, 'The Erlang ASN1 compiler version 5.0.9', '5.0.9'}
]
1 Like

It was just endpoint config.

problem resolved. :smile:

4 Likes