Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL adapter: unexpected message type 'Z' in IDLE state #7471

Closed
aljazerzen opened this issue Jun 19, 2024 · 1 comment · Fixed by #7560
Closed

SQL adapter: unexpected message type 'Z' in IDLE state #7471

aljazerzen opened this issue Jun 19, 2024 · 1 comment · Fixed by #7560

Comments

@aljazerzen
Copy link
Contributor

aljazerzen commented Jun 19, 2024

When querying EdgeDB's SQL adapter with this query:

edgedb=# select 'bad uuid'::uuid;

... the conection is closed from the server side and server reports these logs:

INFO 1198263 - 2024-06-19T19:28:22.179 edb.server: Serving admin on /home/aljaz/.local/share/edgedb/_localdev/.s.EDGE
DB.admin.5656


INFO 1198263 _localdev 2024-06-19T19:28:27.361 edb.server: introspecting database 'main'
================================================================================
SQL Input
================================================================================
SELECT/*<pg.SelectStmt at 0x7f9e2f1483e0>*/
        ('bad uuid')::uuid

================================================================================
SQL Output
================================================================================
SELECT/*<pg.SelectStmt at 0x7f9e25fdc560>*/
        ('bad uuid')::uuid AS "col~1"

WARNING 1198263 _localdev 2024-06-19T19:28:29.033 edb.server: Released an unhealthy pgcon; discard now.
--------------------------- Exception occurred: unexpected message type 'Z' in IDLE state ---------------------------

1. RuntimeError: unexpected message type 'Z' in IDLE state

----------------------------------------------------- Traceback -----------------------------------------------------

    uvloop/handles/stream.pyx, line 837, in uvloop.loop.__uv_stream_on_read_impl

    uvloop/loop.pyx, line 109, in uvloop.loop.run_in_context1
        > none = NoneConstantType()
    edb/server/pgcon/pgcon.pyx, line 3197, in edb.server.pgcon.pgcon.PGConnection.data_received
        > self.fallthrough_idle()
    edb/server/pgcon/pgcon.pyx, line 2849, in edb.server.pgcon.pgcon.PGConnection.fallthrough_idle
        > raise RuntimeError(

RuntimeError: unexpected message type 'Z' in IDLE state
ERROR 1198263 - 2024-06-19T19:28:29.034 asyncio: Fatal error on transport UnixTransport
protocol: <edb.server.pgcon.pgcon.PGConnection object at 0x7f6851fe95d0>
transport: <UnixTransport closed=False reading=False 0x7f6859503e00>
ERROR 1198302 - 2024-06-19T19:28:29.037 postgres: invalid input syntax for type uuid: "bad uuid" at character 54
INFO 1198302 - 2024-06-19T19:28:29.037 postgres: SELECT/*<pg.SelectStmt at 0x7f9e25fdc560>*/
INFO 1198302 - 2024-06-19T19:28:29.038 postgres:                ('bad uuid')::uuid AS "col~1"
INFO 1198263 _localdev 2024-06-19T19:28:29.038 edb.server: Connection discarded to backend database: main
INFO 1198263 _localdev 2024-06-19T19:28:30.051 edb.server: Backend connections to database main: 1 were established i
n at least the last 1.0 seconds.

Found when working on #7462

@aljazerzen
Copy link
Contributor Author

start transaction; select 'bad uuid'::uuid; rollback;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant