clickhouse-rs icon indicating copy to clipboard operation
clickhouse-rs copied to clipboard

"Driver error: `Unknown packet 0x48.`"

Open alexanderspevak opened this issue 1 year ago • 3 comments

I am having trouble connecting to clickhouse running locally in docker image. I am using version "1.0.0-alpha.1". I get following error:

Error: Io(Custom { kind: Other, error: "Driver error: `Unknown packet 0x48.`" })

when calling this part of code:

    let pool = Pool::new("tcp://localhost:8124?compression=lz4");
    let mut client = pool.get_handle().await?;

alexanderspevak avatar Nov 01 '23 22:11 alexanderspevak

Try to use tcp://localhost:9000?compression=lz4

suharev7 avatar Nov 02 '23 00:11 suharev7

yes, its working now, but its bypassing chproxy Screenshot 2023-11-02 at 7 48 01

alexanderspevak avatar Nov 02 '23 06:11 alexanderspevak

clickhouse-rs works with binary protocol (by default port: 9000) and chproxy works with HTTP protocol (by default port: 8123), so:

  • If you would like to work through binary protocol with multiple clickhouse instances, you may specify multiple hosts in url: tcp://host1:9000?alt_hosts=host2:9000,host3:9000
  • If you would like to work through the HTTP protocol with chproxy you need to use http clickhouse client library, for example https://crates.io/crates/clickhouse

suharev7 avatar Nov 02 '23 10:11 suharev7