Postgrex can’t connect during Fly.io release_command (NXDOMAIN for internal DB)
Hi everyone, I’m deploying a Phoenix app to Fly.io and I’m running into this error when the release_command
tries to run /app/bin/migrate
.
The database is created successfully using fly postgres create
and fly postgres attach
, and the app is configured with the correct DATABASE_URL
pointing to startkit-db.internal:5432
.
However, during deploy I consistently get:
** (DBConnection.ConnectionError) tcp connect (startkit-db.internal:5432): non-existing domain - :nxdomain
This causes the release to fail with:
Could not create schema migrations table...
I confirmed that:
- The database is running
- I can connect manually using
fly proxy
+psql
- The database name and credentials are correct
But Fly’s release machine seems to not be resolving startkit-db.internal
.
Is there a delay before *.internal
or *.flycast
DNS entries become resolvable in the Fly network?
Is there a recommended way to ensure the release machine sees the database immediately after creation?
Thanks in advance for any help!