Skip to content

asyncpg error: “no pg_hba.conf entry for host” in Heroku #582

Open
@Kami-Power

Description

@Kami-Power

I'm using asyncpg to connect my database in Heroku postgresql, using python:

import asyncpg

async def create_db_pool():
   bot.pg_con = await asyncpg.create_pool(dsn="postgres://....", host="....amazonaws.com", user="xxx", database="yyy", port="5432", password="12345")

it was working perfectly until I received an email from heroku advising me of a maintenance:
Maintenance (DATABASE_URL on myappname) is starting now. We will update you when it has completed.

then this error appeared:

asyncpg.exceptions.InvalidAuthorizationSpecificationError: no pg_hba.conf entry for host "123.456.789.10", user "xxx", database "yyy", SSL off

I tried to follow some help, like putting ssl=True but this error appeared:

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1108)

same as putting ssl="allow"

asyncpg.exceptions.InvalidPasswordError: password authentication failed for user "xxx"

what can I do to fix this?

https://stackoverflow.com/questions/62053185/asyncpg-error-no-pg-hba-conf-entry-for-host-in-heroku

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions