pgcat: Pgcat is not working with asyncpg python client and I am getting this error in logs ERROR `pgcat::client] Unexpected code: H`

** Pgcat is not working with asyncpg python client, but working psycopg2 python client** Basically i am going to say pgcat not working with synchronisation with python

To Reproduce Steps to reproduce the behavior:

  1. use this image and deploy either in docker or kubernets ghcr.io/postgresml/pgcat:latest

  2. And use bellow config to run deployment pgcat_config.txt

  3. by running this code you will get issue pgcat_test.txt

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 15
  • Comments: 16 (3 by maintainers)

Most upvoted comments

Ooof I just hit this error after investing the time in getting it stood up. How about adding a disclaimer to the README for the time being so that prospective users are aware before choosing this package?

Same feeling here. is there any plan to support Async one day?

Ooof I just hit this error after investing the time in getting it stood up. How about adding a disclaimer to the README for the time being so that prospective users are aware before choosing this package?

Just wanted to bump this. I’d love to use pgcat but we rely on asyncg so we need this feature before we can do so. Thanks!

Adding to this, hoping to give the issue some more attention. 😇

We are running into the same issue (pgcat-1 | 2024-08-02T09:15:29.638103Z ERROR ThreadId(07) pgcat::client: Unexpected code: H) and then hangs.

Our stack:

  • FastAPI (async)
  • SqlAlchemy
  • asyncpg

It works fine using Flask (sync).

We’d love to start using PgCat!

I have the same problem, missing async support makes this project non-viable for a lot of users so it would be great to have

My application with https://github.com/porsager/postgres library is not working also. I tried different pool modes (session and transaction) with prepared_statements_cache_size set to 0 or any number, still the queries fail with this error.

@levkk As you sugguested i have run deployment with RUST_LOG=debug here is the log [2023-04-10T07:21:56.208307Z DEBUG pgcat::client] Password authentication successful [2023-04-10T07:21:56.208456Z INFO pgcat::client] Client 127.0.0.1:57072 connected (plain) [2023-04-10T07:21:56.498748Z DEBUG pgcat::query_router] Query parser enabled: false [2023-04-10T07:21:56.498775Z DEBUG pgcat::client] Waiting for connection from pool [2023-04-10T07:21:56.498780Z DEBUG pgcat::pool] Address { id: 0, host: "db-cluster-ha.postgresql.svc.cluster.local", port: 5432, shard: 0, database: "test", role: Primary, replica_number: 0, address_index: 0, username: "temp_test4", pool_name: "temp", mirrors: [], stats: AddressStats { total_xact_count: 1, total_query_count: 3, total_received: 666, total_sent: 234, total_xact_time: 0, total_query_time: 2, total_wait_time: 29218, total_errors: 0, avg_query_count: 0, avg_query_time: 0, avg_recv: 41, avg_sent: 14, avg_errors: 0, avg_xact_time: 0, avg_xact_count: 0, avg_wait_time: 1826 } } is ok [2023-04-10T07:21:56.498805Z DEBUG pgcat::client] Got connection from pool [2023-04-10T07:21:56.498810Z DEBUG pgcat::client] Client 127.0.0.1:57072 talking to server Address { id: 0, host: "db-cluster-ha.postgresql.svc.cluster.local", port: 5432, shard: 0, database: "test", role: Primary, replica_number: 0, address_index: 0, username: "temp_test4", pool_name: "temp", mirrors: [], stats: AddressStats { total_xact_count: 1, total_query_count: 3, total_received: 666, total_sent: 234, total_xact_time: 0, total_query_time: 2, total_wait_time: 29221, total_errors: 0, avg_query_count: 0, avg_query_time: 0, avg_recv: 41, avg_sent: 14, avg_errors: 0, avg_xact_time: 0, avg_xact_count: 0, avg_wait_time: 1826 } } [2023-04-10T07:21:56.498823Z ERROR pgcat::client] Unexpected code: H

And output of python script is hungs for ever