Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

"Connection is not acquired" #455

@dswillr

Description

@dswillr

I'm seeing "Connection is not acquired" errors being raised randomly in my multi-task asyncio application, even though database.is_connected is True on databases==5.5.5 with aiopg==1.3.3 and python==3.10.2.

  ... my code
    result = await database.fetch_one(query)
  File "/usr/local/lib/python3.10/site-packages/databases/core.py", line 155, in fetch_one
    return await connection.fetch_one(query, values)
  File "/usr/local/lib/python3.10/site-packages/databases/core.py", line 278, in fetch_one
    return await self._connection.fetch_one(built_query)
  File "/usr/local/lib/python3.10/site-packages/databases/backends/aiopg.py", line 137, in fetch_one
    assert self._connection is not None, "Connection is not acquired"
AssertionError: Connection is not acquired

Could this be an odd side effect of having connections shared across tasks ( #230 )?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions