HELP - Error: UnhandledIoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })

I am receiving this error after trying to deploy to fly.io. I was able to deploy it a month ago with the same project folder. How can I fix this?

--> This release will not be available until the release command succeeds.
         Starting instance
         Configuring virtual machine
         Pulling container image
         Unpacking image
         Preparing kernel init
         Configuring firecracker
         Starting virtual machine
         Starting init (commit: 1780205)...
         Setting up swapspace version 1, size = 536866816 bytes
         UUID=7569deb7-a536-4a8b-9476-61d6c625f924
         Preparing to run: `/srv/app/myproject` as 65532
         Error: UnhandledIoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
         [    0.089661] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
         [    0.090441] CPU: 0 PID: 1 Comm: init Not tainted 5.12.2 #1
         [    0.090996] Call Trace:
         [    0.091256]  show_stack+0x52/0x58
         [    0.091610]  dump_stack+0x6b/0x86
         [    0.091954]  panic+0xfb/0x2bc
         [    0.092260]  do_exit.cold+0x60/0xb0
         [    0.092637]  do_group_exit+0x3b/0xb0
         [    0.093010]  __x64_sys_exit_group+0x18/0x20
         [    0.093435]  do_syscall_64+0x38/0x50
         [    0.093798]  entry_SYSCALL_64_after_hwframe+0x44/0xae
         [    0.094537] RIP: 0033:0x7f0affb641a9
         [    0.098415] RSP: 002b:00007ffce568fa88 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
b0 b0 00 00 00 e9 af ff ff ff 48 63 ff b8 e7 00 00 00 0f 05 <ba> 3c 00 00 00 48 89 d0 0f 05 eb f9 66 2e 0f 1f 84 00 00 00 00 00
         [    0.098415] RSP: 002b:00007ffce568fa88 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
         [    0.103553] RDX: 00007f0affc46520 RSI: 0000000000000000 RDI: 0000000000000001
         [    0.103553] RDX: 00007f0affc46520 RSI: 0000000000000000 RDI: 0000000000000001
         [    0.108666] R1P: 0000000000000001 R08: 0000000000000001 R09: 0000000000000000
         [    0.108666] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffce568fae8
         [    0.111376] R13: 00007ffce568faf8 R14: 0000000000000000 R15: 0000000000000000
         [    0.114434] Kernel Offset: disabled
         [    0.115829] Rebooting in 1 seconds..
Error release command failed, deployment aborted

Here is what my fly.toml I am using.

app = "myproject"
kill_signal = "SIGINT"
kill_timeout = 5

[build]
dockerfile = "Dockerfile"

[env]
PORT = "8080"

[experimental]
allowed_public_ports = []
auto_rollback = true

[[services]]
http_checks = []
internal_port = 8080
processes = ["app"]
protocol = "tcp"
script_checks = []
[services.concurrency]
hard_limit = 25
soft_limit = 20
type = "connections"

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

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

[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"

I started getting this error as well, this evening, was not getting it a few days ago.
I destroyed app/db and builder, tried to rebuild, but build would hang on
mix phx.gen.release --docker
ran that manually, was able to launch new app.

However after, when I try to deploy I again get the same error reported.

I was able to resolve this issue from

  • destroy app, db, builder
  • remove fly.toml/Dockerfile
  • run mix phx.gen.release --docker --ecto

release was successful and now can execute
flyctl deploy
and it worked. Thanks: kernel panic when deploying app