Deploy failure of elixir app

I’m following a tutorial and I’ve been trying to perform a first deploy of the app. However each time I try I get the results below: [Note: the error "ERROR! Config provider Config.Reader failed with: ** (RuntimeError) environment variable DATABASE_URL is missing." it’s expected and isn’t what I’m asking about. It’s the Error: release command failed - aborting deployment. error release_command machine d891691ce0d648 exited with non-zero status of 1 that is my concern.

--> Building image done
==> Pushing image to fly
The push refers to repository [registry.fly.io/bmvp-nqa]
1da7099c1a77: Pushed
3e48a32ab05e: Pushed
5ee9a3302d69: Pushed
d76c238f1e09: Pushed
06fd3110f897: Pushed
0cc1f0165626: Layer already exists
deployment-01H8WDF21ZM8WF2KPT631XR9YY: digest: sha256:e5b5aaa4228d777dcf3641f947e0cfa7ddf9db5f052fb8826463743b19b432e0 size: 1575
--> Pushing image done
image: registry.fly.io/bmvp-nqa:deployment-01H8WDF21ZM8WF2KPT631XR9YY
image size: 126 MB

Watch your deployment at https://fly.io/apps/bmvp-nqa/monitoring

Running bmvp-nqa release_command: /app/bin/migrate
  Waiting for d891691ce0d648 to get exit event
Error release_command failed running on machine d891691ce0d648 with exit code 1.
Check its logs: here's the last 100 lines below, or run 'fly logs -i d891691ce0d648':
  Pulling container image registry.fly.io/bmvp-nqa:deployment-01H8WDF21ZM8WF2KPT631XR9YY
  Successfully prepared image registry.fly.io/bmvp-nqa:deployment-01H8WDF21ZM8WF2KPT631XR9YY (10.585944598s)
  Configuring firecracker
  [    0.050755] PCI: Fatal: No config space access function found
   INFO Starting init (commit: b437b5b)...
   INFO Preparing to run: `/app/bin/migrate` as nobody
   INFO [fly api proxy] listening at /.fly/api
  2023/08/27 21:14:58 listening on [fdaa:2:7c52:a7b:13e:6fe4:3986:2]:22 (DNS: [fdaa::3]:53)
  ERROR! Config provider Config.Reader failed with:
  ** (RuntimeError) environment variable DATABASE_URL is missing.
  For example: ecto://USER:PASS@HOST/DATABASE
      /app/releases/0.1.0/runtime.exs:26: (file)
      (elixir 1.15.4) src/elixir.erl:376: anonymous fn/4 in :elixir.eval_external_handler/1
      (stdlib 5.0.2) erl_eval.erl:750: :erl_eval.do_apply/7
      (stdlib 5.0.2) erl_eval.erl:494: :erl_eval.expr/6
      (stdlib 5.0.2) erl_eval.erl:136: :erl_eval.exprs/6
      (elixir 1.15.4) src/elixir.erl:361: :elixir.eval_forms/4
      (elixir 1.15.4) lib/module/parallel_checker.ex:112: Module.ParallelChecker.verify/1
      (elixir 1.15.4) lib/code.ex:543: Code.validated_eval_string/3
  Runtime terminating during boot ({,[{elixir_eval,__FILE__,1,[{_},{_}]},{elixir,-eval_external_handler/1-fun-2-,4,[{_},{_},{_}]},{erl_eval,do_apply,7,[{_},{_}]},{erl_eval,expr,6,[{_},{_}]},{erl_eval,exprs,6,[{_},{_}]},{elixir,eval_forms,4,[{_},{_}]},{Elixir.Module.ParallelChecker,verify,1,[{_},{_}]},{Elixir.Code,validated_eval_string,3,[{_},{_}]}]})
  Crash dump is being written to: erl_crash.dump...done
   INFO Main child exited normally with code: 1
   INFO Starting clean up.
   WARN hallpass exited, pid: 267, status: signal: 15 (SIGTERM)
  2023/08/27 21:15:00 listening on [fdaa:2:7c52:a7b:13e:6fe4:3986:2]:22 (DNS: [fdaa::3]:53)
  [    3.571678] reboot: Restarting system
  machine restart policy set to 'no', not restarting
Error: release command failed - aborting deployment. error release_command machine d891691ce0d648 exited with non-zero status of 1

Could you share which tutorial you are following?

It’s a paid video course Peter Ulrich “Build an MVP with Elixir” so I can’t share without his permission.

Does the course include the fly.toml configuration or did you write it? If so, could you share that?

What this likely means is either that you didn’t say “yes” when asked if you wanted a postgres database when running fly launch, or that you didn’t run fly postgres connect · Fly Docs. If you don’t already have a postgresql database, you can create one with fly postgres create · Fly Docs.

it is hard to provide more specific instructions without seeing your tutorial, but it seems likely that if you create and connect a database you will be up and running.

The fly.toml was generated and is as follows:

# fly.toml app configuration file generated for bmvp-nqa on 2023-08-27T21:40:33+01:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = "bmvp-nqa"
primary_region = "lhr"
kill_signal = "SIGTERM"
swap_size_mb = 512

[build]

[deploy]
  release_command = "/app/bin/migrate"

[env]
  PHX_HOST = "bmvp-nqa.fly.dev"
  PORT = "8080"

[http_service]
  internal_port = 8080
  force_https = true
  auto_stop_machines = true
  auto_start_machines = true
  min_machines_running = 0
  processes = ["app"]
  [http_service.concurrency]
    type = "connections"
    hard_limit = 1000
    soft_limit = 1000

Yeah this error is expected and isn’t what I’m seeking help for. It’s the Error: release command failed - aborting deployment. error release_command machine d891691ce0d648 exited with non-zero status of 1 that i’m concerned about. Thanks

Note: that’s the release command that is failing. It seems likely that it is failing because environment variable DATABASE_URL is missing.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.