[deployment] Error release command failed, deployment aborted

Deployment is failing for no discernible reason:

2022-10-30T21:57:45Z runner[49564942] sea [info]Starting instance
2022-10-30T21:57:46Z runner[49564942] sea [info]Configuring virtual machine
2022-10-30T21:57:46Z runner[49564942] sea [info]Pulling container image
2022-10-30T21:57:52Z runner[49564942] sea [info]Unpacking image
2022-10-30T21:57:57Z runner[49564942] sea [info]Preparing kernel init
2022-10-30T21:57:57Z runner[49564942] sea [info]Configuring firecracker
2022-10-30T21:57:57Z runner[49564942] sea [info]Starting virtual machine
2022-10-30T21:57:58Z app[49564942] sea [info]Starting init (commit: ce4cf1b)...
2022-10-30T21:57:58Z app[49564942] sea [info]Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
2022-10-30T21:57:58Z app[49564942] sea [info]no label, UUID=66b68de3-1a75-434b-a4c4-a69abbf02646
2022-10-30T21:57:58Z app[49564942] sea [info]Preparing to run: `docker-entrypoint.sh npx prisma migrate deploy` as root
2022-10-30T21:57:58Z runner[49564942] sea [info]Virtual machine started successfully
2022-10-30T21:57:58Z app[49564942] sea [info]2022/10/30 21:57:58 listening on [fdaa:0:c990:a7b:bcab:4956:4942:2]:22 (DNS: [fdaa::3]:53)
2022-10-30T21:58:01Z app[49564942] sea [info]Prisma schema loaded from prisma/schema.prisma
2022-10-30T21:58:01Z app[49564942] sea [info]Datasource "db": PostgreSQL database "dequency", schema "public" at "dq-db-preview.internal:5432"
2022-10-30T21:58:01Z app[49564942] sea [info]2 migrations found in prisma/migrations
2022-10-30T21:58:03Z app[49564942] sea [info]No pending migrations to apply.
2022-10-30T21:58:04Z app[49564942] sea [info]Starting clean up.

OK, it looks like until the first time an app is deployed, using release_command will cause the deploy to fail.

I commented out release_command and the deploy went through. This seems like a bug?

Interesting, can you share your fly.toml file? I’m going to try to see if I can reproduce the issue

# fly.toml file generated for dq-home-preview on 2022-10-28T16:16:30-07:00
app = "dq-home-preview"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[build]
image = "registry.fly.io/dq-home-preview:latest"

[deploy]
release_command = "npx prisma migrate deploy"

[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"

Hmmm, I tried deploying a next app with prisma with the release command and it doesn’t give me the same error as you’re describing. I wonder if there might be an issue with something in the docker entrypoint file? Perhaps something in this line docker-entrypoint.sh npx prisma migrate deploy as root`

The exact same Dockerfile has been deploying just fine after that first initial hiccup. :woman_shrugging:

The migration command is run every time the deploy happens.