Search code examples
pythonpostgresqlsqlalchemyamazon-rdspsycopg2

psycopg2.OperationalError: SSL SYSCALL error: Connection reset by peer (0x00002746/10054) FATAL: no pg_hba.conf entry for host user database


I have changed nothing about my computer - I have, however, left the US for Germany for about two weeks. I can not connect to my database, while on my remote server I can. Is this some odd DNS issue? My coworker in the states can access it fine

--edit for config--

@authcomment@

# TYPE  DATABASE        USER            ADDRESS                 METHOD

@remove-line-for-nolocal@# "local" is for Unix domain socket connections only
@remove-line-for-nolocal@local   all             all                                     @authmethodlocal@
# IPv4 local connections:
host    all             all             127.0.0.1/32            @authmethodhost@
# IPv6 local connections:
host    all             all             ::1/128                 @authmethodhost@
# Allow replication connections from localhost, by a user with the
# replication privilege.
@remove-line-for-nolocal@local   replication     all                                     @authmethodlocal@
host    replication     all             127.0.0.1/32            @authmethodhost@
host    replication     all             ::1/128                 @authmethodhost@

Solution

  • pg_hba.conf controls the client IP's that can connect to a database. You have changed locations so it is telling you that the IP you now connecting from is not authorized in pg_hba.conf. Either you or someone else need to add it to pg_hba.conf or you need to say ssh to a computer that has access and connect from there.