MagicStack / MagicStack/asyncpg
Connect with passwordless DSN does not work
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.1k
- Forks
- 468
- PR merge metrics
- No merged PRs in 30d
Description
Basically as the title says: Trying to connect with a DSN that contains no password does not work
DSN in question:
`
@property
def dsn(self) -> str:
return f"postgresql+asyncpg://{self.pguser}@{self.pghost}:{self.pgport}/{self.pgdatabase}"
`
results, when used with
`
def get_db_url() -> str:
config = get_config()
return config.postgres.dsn
engine = create_async_engine(
get_db_url(),
echo=True,
future=True,
)
`
in the error:
`
ERROR: Traceback (most recent call last): File "asyncpg/protocol/coreproto.pyx", line 168, in asyncpg.protocol.protocol.CoreProtocol._process__auth File "asyncpg/protocol/coreproto.pyx", line 577, in asyncpg.protocol.protocol.CoreProtocol._parse_msg_authentication File "asyncpg/protocol/coreproto.pyx", line 672, in asyncpg.protocol.protocol.CoreProtocol._auth_password_message_cleartext AttributeError: 'NoneType' object has no attribute 'encode'
`
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
Reproduce the failure with the passwordless PostgreSQL DSN shown and the create_async_engine entry point. Trace the password-authentication path around the reported _auth_password_message_cleartext traceback; done means a passwordless connection no longer raises the NoneType encode error, with coverage for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, python, sqlalchemy
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100