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
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:
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?