I used the fly apps move -a <>
to move both a Django app, and a Timescale DB database from a personal org to a new organisation.
The issue I’m having is that the Django app can no longer connect to the database due to a DNS issue. The error is psycopg2.OperationalError: could not translate host name "<db_app_name>.flycast" to address: Name has no usable address
I’ve confirmed that the database is working correctly by:
- Connecting to the DB app and running queries successfully
- Manually connecting from the Django app machine to the database using an IP instead of the .flycast hostname to connect to the database with PSQL.
From looking through some other posts, I’ve found a few suggestions to resolve, but none of these have works. These include:
- Running
fly image update
on the application and database apps - Detaching and reattaching the database to the app
As a work-around for now, I’m manually overriding the database host to use the IP of the primary DB. It works, but obviously feels fragile.
It seems like there is a DNS issue caused by moving the app. What could have gone wrong, and any suggestions on how to resolve it?