App unable to connect to postgres db

I have a telegram bot (on Fly), which uses a Fly Postgres DB as well. I connect to the postgres DB via sqlalchemy, and it has been working well for the past 1 year, until today when I got this error:

sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name “top2.nearest.of.[postgres app name]” to address: Name has no usable address

I have a separate app/db for testing purposes, and it is working fine. As a temporary workaround, I have detached my main postgres db, and attached the test postgres db to my main app, and it seems to work fine.

Does anyone have any insights on this?

Hi… This can happen when the Postgres machine has shut down.

(Running out of disk space is one common cause of that, particularly for apps that have been working for many months.)

You can gather more information via…

fly m list      -a db-app-name
fly checks list -a db-app-name
fly logs        -a db-app-name

Hope this helps a little!

Added postgres

Hi,

We found an issue on DNS and deployed a fix:

Thanks for reporting too!

  • Daniel

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