Error Release command failed, deployment aborted

I followed the Elixir tutorial, but I can’t deploy it.

Continuously getting this error. It’s to generic…

My Release file

Runtime.exs

fly.toml

any thoughts?

1 Like

Will try to figure out why it’s not showing better logs, but from what I can see now the deployment is failing at the release command, and the release command runs a database migration.

Has the database already been setup and attached to the app via flyctl or manually with the DATABASE_URL set?

Postgres on Fly has DB setup steps, if you haven’t already seen them.

I followed the tutorial, created the pg and set up the env variable.

That looks fine, do you see anything on flyctl builds logs that might indicate what the problem is?

I recreate the db following the command

$ flyctl postgres create

Try to attach…

Recreating the DB itself isn’t necessary at this point, it looks like you’ve already created and attached a DB correctly.

There seems to be an error during deployment when running the release task, so we want to see what errors happen during the deploy.

I can’t see the logs. What I’m doing wrong?

I don’t think you’re doing anything wrong at all, there does seem to be a bug with the flyctl builds logs command reading the app name. Will debug that and get back to you soon.

Can you try just running flyctl logs in another terminal and trying to deploy again?

Ideally you’ll see something along the lines of

==> Release command
Command: /app/bin/hello_elixir eval HelloElixir.Release.migrate
	 Starting instance
	 Configuring virtual machine
	 Pulling container image
	 Unpacking image
	 Preparing kernel init
	 Configuring firecracker
	 Starting virtual machine
	 Starting init (commit: 50ffe20)...
	 Preparing to run: `/app/bin/hello_elixir eval HelloElixir.Release.migrate` as nobody
	 2021/10/24 14:19:19 listening on [fdaa:0:33b5:a7b:1449:f4c8:707a:2]:22 (DNS: [fdaa::3]:53)
	 Reaped child process with pid: 561 and signal: SIGUSR1, core dumped? false
	 14:19:21.821 [info] == Migrated 20210505214438 in 0.0s
	 Main child exited normally with code: 0
	 Reaped child process with pid: 563 and signal: SIGUSR1, core dumped? false
	 Starting clean up.
Monitoring Deployment

1 desired, 2 placed, 1 healthy, 0 unhealthy [health checks: 2 total, 1 passing]
--> v1 deployed successfully

in the deploy and

2021-10-24T14:19:15.012 runner[f4c8707a] maa [info] Starting instance
2021-10-24T14:19:15.043 runner[f4c8707a] maa [info] Configuring virtual machine
2021-10-24T14:19:15.045 runner[f4c8707a] maa [info] Pulling container image
2021-10-24T14:19:18.899 runner[f4c8707a] maa [info] Unpacking image
2021-10-24T14:19:18.905 runner[f4c8707a] maa [info] Preparing kernel init
2021-10-24T14:19:19.213 runner[f4c8707a] maa [info] Configuring firecracker
2021-10-24T14:19:19.509 runner[f4c8707a] maa [info] Starting virtual machine
2021-10-24T14:19:19.643 app[f4c8707a] maa [info] Starting init (commit: 50ffe20)...
2021-10-24T14:19:19.659 app[f4c8707a] maa [info] Preparing to run: `/app/bin/hello_elixir eval HelloElixir.Release.migrate` as nobody
2021-10-24T14:19:19.672 app[f4c8707a] maa [info] 2021/10/24 14:19:19 listening on [fdaa:0:33b5:a7b:1449:f4c8:707a:2]:22 (DNS: [fdaa::3]:53)
2021-10-24T14:19:20.668 app[f4c8707a] maa [info] Reaped child process with pid: 561 and signal: SIGUSR1, core dumped? false
2021-10-24T14:19:21.805 app[f4c8707a] maa [info] 14:19:21.801 [info] == Running 20210505214438 HelloElixir.Repo.Migrations.CreateAMigrationToRun.change/0 forward
2021-10-24T14:19:21.806 app[f4c8707a] maa [info] 14:19:21.805 [info] create table testing
2021-10-24T14:19:21.821 app[f4c8707a] maa [info] 14:19:21.821 [info] == Migrated 20210505214438 in 0.0s
2021-10-24T14:19:22.670 app[f4c8707a] maa [info] Main child exited normally with code: 0
2021-10-24T14:19:22.672 app[f4c8707a] maa [info] Reaped child process with pid: 563 and signal: SIGUSR1, core dumped? false
2021-10-24T14:19:22.673 app[f4c8707a] maa [info] Starting clean up.

in your flyctl logs.

The deploy failed

logs…

I will try to recreate and re attach the db

I can’t create a database in GRU - SP.

Yeah, the DNS problem looks weird. Let’s get someone on the team to see if there’s a GRU region specific problem, then.

Hey @sudhir.j

This sounds very much like the same issue I’m having.

I tried doing a deploy, but I don’t see what you describe in the logs:
fly deploy:

Deploying xxx-xxx-2877
==> Validating app configuration
--> Validating app configuration done
Services
TCP 80/443 ⇢ 4000

...

--> Pushing image done
Image: registry.fly.io/xxx-xxx-2877:deployment-1635092009
Image size: 32 MB
==> Creating release
Release v32 created
Release command detected: this new release will not be available until the command succeeds.

You can detach the terminal anytime without stopping the deployment
==> Release command
Command: /app/bin/xxx eval XXX.Release.migrate
	 Starting instance
	 Configuring virtual machine
	 Pulling container image
	 Unpacking image
	 Preparing kernel init
	 Setting up volume 'xxx'

Error Release command failed, deployment aborted

fly logs:

2021-10-24T16:13:46.078 runner[a1f57070] fra [info] Starting instance
2021-10-24T16:13:46.105 runner[a1f57070] fra [info] Configuring virtual machine
2021-10-24T16:13:46.106 runner[a1f57070] fra [info] Pulling container image
2021-10-24T16:13:49.069 runner[a1f57070] fra [info] Unpacking image
2021-10-24T16:13:49.471 runner[a1f57070] fra [info] Preparing kernel init
2021-10-24T16:13:49.589 runner[a1f57070] fra [info] Setting up volume 'xxx'

Then nothing. It looks like there is much more stuff happening in your logs.
I’m in the fra region.

I think I know what’s happening, can you try dropping the data volume requirement, or adding another volume into the region? The release command is trying to attach a volume, and I’d assume you only have one volume provisioned in the region and you already have one instance running attached to that volume.

Ah. I had misunderstood how volumes work.
I created a new one with the exact same name:

$ fly volumes list
ID                   NAME           SIZE REGION ATTACHED VM CREATED AT
vol_w1q85vg7e80vzdxe xxx 10GB fra                4 minutes ago
vol_gez1nvxk1wzrmxl7 xxx 10GB fra    f3027b75    2 months ago

and then deployed again, but with the exact same result.
Then I attempted to delete the volumes section from fly.toml, and deploy, but it still attempts to mount the volume. Basically ignoring that I deleted the volume:

$ cat fly.toml
# fly.toml file generated for xxx-xxx-2877 on 2021-08-24T20:28:26+02:00

app = "xxx-xxx-2877"

kill_signal = "SIGTERM"
kill_timeout = 5
processes = []

[env]

[deploy]
  release_command = "echo hello"

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[services]]
  internal_port = 4000
  processes = ["app"]

  [services.concurrency]
    hard_limit = 25
    soft_limit = 20

  [[services.ports]]
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "30s"
    interval = "15s"
    restart_limit = 6
    timeout = "2s"

Also tried to change the release command to just echo hello, so it has nothing to do with either the DB, or anything happening in my app.

$ fly deploy
Deploying xxx-xxx-2877
==> Validating app configuration
--> Validating app configuration done
...

==> Creating release
Release v32 created
Release command detected: this new release will not be available until the command succeeds.

You can detach the terminal anytime without stopping the deployment
==> Release command
Command: echo hello
	 Starting instance
	 Configuring virtual machine
	 Pulling container image
	 Unpacking image
	 Preparing kernel init
	 Setting up volume 'xxx'

Error Release command failed, deployment aborted
$ fly logs
2021-10-24T16:36:12.405 runner[65ae4b43] fra [info] Starting instance
2021-10-24T16:36:12.436 runner[65ae4b43] fra [info] Configuring virtual machine
2021-10-24T16:36:12.437 runner[65ae4b43] fra [info] Pulling container image
2021-10-24T16:36:12.870 runner[65ae4b43] fra [info] Unpacking image
2021-10-24T16:36:12.876 runner[65ae4b43] fra [info] Preparing kernel init
2021-10-24T16:36:13.055 runner[65ae4b43] fra [info] Setting up volume 'xxx'

The problem is in the GRU region, I deleted all apps and follow the tutorial again, this time in the Miami US region and everything works.

1 Like

Thanks for the follow up! :pray:

I’ll wait for the Fly team to take a look at FRA then! :slight_smile:

Hi fellows, I’m facing the same problem when trying to deploy an existing application in the GRU region

1 Like

It works now for me in FRA :heart:

1 Like