MagicStack / MagicStack/asyncpg
asyncpg error: “no pg_hba.conf entry for host” in Heroku
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.1k
- Forks
- 468
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No project files or tests are named. Start by examining the asyncpg.create_pool call, the Heroku PostgreSQL maintenance notice, and the three connection errors; determine whether the failure is reproducible in asyncpg or specific to the Heroku database configuration, with a verified connection outcome as the completion criterion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, python
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100