Phoenix Deploy Using `fly launch`

Hi I am trying to deploy my second phoenix app using the cli. The first one went smooth (mostly) but I keep getting this error with what I assume is an updated version of the cli.

I am using this guide:

❯ flyctl version
flyctl v0.0.323 darwin/arm64 Commit: c4d6328 BuildDate: 2022-04-24T11:13:19Z

==> Creating release
Release v2 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/migrate
         Starting instance
         Configuring virtual machine
         Pulling container image
         Unpacking image
         Preparing kernel init
         Configuring firecracker
         Preparing to run: `/app/bin/migrate` as nobody
         [    0.087338] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
         [    0.088849] Call Trace:
         [    0.089104]  show_stack+0x52/0x58
         [    0.089770]  panic+0xfb/0x2bc
         [    0.090075]  do_exit.cold+0x60/0xb0
         [    0.090870]  __x64_sys_exit_group+0x18/0x20
         [    0.092218] RIP: 0033:0x6fea55
         [    0.095954] RDX: 0000000000000fda RBX: 00000000005d0250 RCX: 00000000006fea55
         [    0.095954] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001
         [    0.099165] Kernel Offset: disabled
         [    0.099539] Rebooting in 1 seconds..
Error Release command failed, deployment aborted

Any guidance would be appreciated,

Edit: Using Phoenix 1.6.7

Is this in the lhr region by any chance? If so, there is an ongoing issue with a host being resolved today

If not, not sure. I’ve not seen that error before. Hopefully someone from Fly will be able to assist.

1 Like

I’ve tried ewr(Secaucus) yesterday and miami today with no luck on either

Works now, that must of been it

Still getting that on EWR

That error is not the most intuitive, but it might mean there’s no /app/bin/migrate file (or it’s not marked as executable). Are you running Docker locally? If you are, you can run:

docker build . -t my-app
docker run --rm -ti my-app /bin/bash

Then ls -la /app/bin/ and see what’s listed.

Also, was this originally a Phoenix 1.6.7 app, or did you upgrade?

This was a fresh app I just generated this weekend, always 1.6.7

nobody@f2d406ca0fbe:/app$ ls -la /app/bin/
total 32
drwxr-xr-x 2 nobody root 4096 Apr 24 22:55 .
drwxr-xr-x 1 nobody root 4096 Apr 24 22:55 ..
-rwxr-xr-x 1 nobody root   87 Apr 24 22:55 server
-rwxr-xr-x 1 nobody root   57 Apr 24 22:55 server.bat
-rwxr-xr-x 1 nobody root 5318 Apr 24 22:55 my_app
-rwxr-xr-x 1 nobody root 6471 Apr 24 22:55 my_app.bat
nobody@f2d406ca0fbe:/app$

It looks like it’s missing the migration script. That should get done automatically when you generate the project. Are you sure it’s the generator has been updated phoenix 1.6.7? Last time I tried this I forgot to run mix archive.install hex phx_new.

You can try running mix phx.gen.release --ecto to see if it generates the migrate script.

mix archive.install hex phx_new
....
Found existing entry: /Users/john/.asdf/installs/elixir/1.13.4-otp-24/.mix/archives/phx_new-1.6.7
Are you sure you want to replace it with "phx_new-1.6.7.ez"? [Yn] n
See https://hexdocs.pm/mix/Mix.Tasks.Release.html for more information about Elixir releases.

Here are some useful release commands you can run in any release environment:

    # To build a release
    mix release

    # To start your system with the Phoenix server running
    _build/dev/rel/my-app/bin/server

    # To run migrations
    _build/dev/rel/my-app/bin/migrate

with mix release the migrate file isn’t generated automatically I guess?