Issues moving app and database to new organisation

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:

  1. Connecting to the DB app and running queries successfully
  2. 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?

Hi… I would try just releasing and then reallocating the Flycast address, I think.


I’m fairly surprised that the initial relocation worked to any extent, incidentally: the docs say that fly apps move isn’t supported for Fly Postgres. Maybe this was an instance that was put together ad hoc—and hence lacked the automatic metadata that would have been added by fly pg create / fly launch?

Added postgres, proxy

Thank you, that worked.

I did set up the cluster with fly pg create. Using fly apps move on the postgresql/timescale cluster did have other issues, so I wouldn’t recommend it. Both the replicas has issues syncing with the primary DB and had to be manually fixed after being moved. I fixed those, and then had this issue with the internal hostnames.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.