An error I see nearly everyone run into when deploying pephub on their own is this one:
psycopg2.OperationalError: could not translate host name "localhost:5432" to address: Name or service not know
AttributeError: 'BaseConnection' object has no attribute 'pg_connection'
It comes from pepdbagent, and occurs when people have improperly configured their environment to connect to the database (i.e. the database connection credentials are wrong/not injected). It looks like pepdbagent is trying to close a connection when it can't connect. When the object is garbage collected away here there is no connection to close.
Anyways, it sort of masks the real error that's occurring and so it would be nice if we could include some checks since it seems like this is a bug that trips up many, many people:
Check for a connection object before closing in the garbage collection
Check that the provided credentials actually connect and raise an exception if not.
An error I see nearly everyone run into when deploying pephub on their own is this one:
It comes from
pepdbagent
, and occurs when people have improperly configured their environment to connect to the database (i.e. the database connection credentials are wrong/not injected). It looks likepepdbagent
is trying to close a connection when it can't connect. When the object is garbage collected away here there is no connection to close.Anyways, it sort of masks the real error that's occurring and so it would be nice if we could include some checks since it seems like this is a bug that trips up many, many people: