marocchino

marocchino

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}

Marked As Solved

marocchino

marocchino

It was just endpoint config.

problem resolved. :smile:

Also Liked

marocchino

marocchino

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'}
]

Where Next?

Popular in Questions Top

_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
mgjohns61585
Could someone help me? I’m making my first elixir program, number guessing game. I can’t figure out how to convert the user’s guess from ...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
beno
I will often find my self writing things similar to: case some_value do nil -&gt; something() "" -&gt; something() _ -&gt; somethi...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
hariharasudhan94
Lets say i have map like this fetching from my database %{"_id" =&gt; #BSON.ObjectId&lt;58eb1a7a9ad169198c3dXXXX&gt;, "email" =&gt; "XXX...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Other popular topics Top

chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31142 143
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
Qqwy
Update: How to use the Blogs &amp; Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 126479 1222
New

We're in Beta

About us Mission Statement