No access to DATABASE_URL hostname

Starting 2 days ago, my app stop working (with no updates on my side).
It seems the failure is caused because the app cannot access the postgres db hosted on fly.io, which I access through the DATABASE_URL, automatically set.

The error is: could not translate host name "top2.nearest.of.my-app.internal" to address.
What could I do to fix this?

Thanks for your help!

Hey @tommoral !

That could not translate host name.. error means that your database machine isn’t being returned by DNS, causing your app machine not to be able to reach it. Stopping and starting the database machine should cause it to re-register and get you up and running again. You can do so by:

  1. Run fly machines list -a <database_app_name> to get the machine ID(s)
  2. Run fly machine stop <machine_id> for each machine in your database app
  3. Run fly machine start <machine_id> for each machine in your db app

When the machine restarts, it’ll get re-registered in DNS and your main app should be able to reach it over the .internal address again. We’re looking into what caused it to get unregistered in the first place, but those steps should unblock you for now.

This did the trick and the app is not back online :slight_smile:
Thanks a lot for the fast support!

1 Like

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