Closed
Description
- asyncpg version: 0.11.0
- PostgreSQL version: 10 Beta
- Python version: 3.6.1 (miniconda)
- Platform: Fedora
- Do you use pgbouncer?: No
- Did you install asyncpg with pip?: Yes
- If you built asyncpg locally, which version of Cython did you use?: -
- Can the issue be reproduced under both asyncio and
uvloop?: yes
Hi, I have random issue with creating pool - sometimes (about one of 5 attempts) password authentication fails =(
Here is code:
import asyncio
import asyncpg
async def init():
pool = await asyncpg.create_pool(
"postgres://postgres:postgres@localhost:5432/postgres", min_size=10, max_size=10)
loop = asyncio.get_event_loop()
loop.run_until_complete(init())
Traceback:
Traceback (most recent call last):
File "asyncio_test.py", line 10, in <module>
loop.run_until_complete(init())
File "/home/user/miniconda3/envs/backend/lib/python3.6/asyncio/base_events.py", line 466, in run_until_complete
return future.result()
File "asyncio_test.py", line 7, in init
"postgres://postgres:postgres@localhost:5432/postgres", min_size=40, max_size=40)
File "/home/user/miniconda3/envs/backend/lib/python3.6/site-packages/asyncpg/pool.py", line 344, in _async__init__
await asyncio.gather(*connect_tasks, loop=self._loop)
File "/home/user/miniconda3/envs/backend/lib/python3.6/site-packages/asyncpg/pool.py", line 133, in connect
connection_class=self._pool._connection_class)
File "/home/user/miniconda3/envs/backend/lib/python3.6/site-packages/asyncpg/connect_utils.py", line 274, in _connect_addr
await asyncio.wait_for(connected, loop=loop, timeout=timeout)
File "/home/user/miniconda3/envs/backend/lib/python3.6/asyncio/tasks.py", line 352, in wait_for
return fut.result()
asyncpg.exceptions.InvalidPasswordError: password authentication failed for user "postgres"
Postgres log:
[12683] [5946c2a0.318b] [2017-06-18 21:12:48.687 MSK] [0]: FATAL: password authentication failed for user "postgres"
[12683] [5946c2a0.318b] [2017-06-18 21:12:48.687 MSK] [0]: DETAIL: Password does not match for user "postgres".
Connection matched pg_hba.conf line 92: "host all all ::/0 md5"
Of course, it may be issue of Postgresql 10 beta.
Thanks.