Skip to content

connection.close is throwing protocol error #490

Open
@immohsin

Description

@immohsin

asyncpg version: 0.18.1
PostgreSQL version: 9.5.10
Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?: using google cloud sql pg instance
Python version: 3.6.5
Platform: Ubuntu
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?: No

I have been facing this error for quite sometime intermittently asyncpg.exceptions._base.InternalClientError: got result for unknown protocol state 0

The entire stack trace:

 File "/repo/server/schema_db.py", line 345, in read
    await connection.close()

  File "/usr/local/lib/python3.6/dist-packages/asyncpg/connection.py", line 1082, in close
    await self._protocol.close(timeout)

  File "asyncpg/protocol/protocol.pyx", line 560, in close

  File "asyncpg/protocol/protocol.pyx", line 814, in asyncpg.protocol.protocol.BaseProtocol._dispatch_result

asyncpg.exceptions._base.InternalClientError: got result for unknown protocol state 0

Can someone explain when this exception is thrown and for what reason?
If i know the reason this exception is thrown, i can figure out the issue myself.
I'm not able to reproduce locally or in my stage environment.

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