-
Notifications
You must be signed in to change notification settings - Fork 272
Description
Is your feature request related to a problem? Please describe.
When attempting to connect to ClickHouse via chproxy using the clickhouse-go driver, the connection fails with the following error:
failed to query server hello: failed to query server hello info: readData: block decode: raw: read str: unexpected EOF
This appears to happen because chproxy does not proxy the client_protocol_version parameter to ClickHouse. As a result, the server and client protocol versions become mismatched, leading to a failed handshake. clickhouse-go client set client_protocol_version parameter here.
Steps to Reproduce:
-
Run ClickHouse server.
-
Start chproxy in front of ClickHouse.
-
Connect via the clickhouse-go driver:
import (
"database/sql"
_ "github.com/ClickHouse/clickhouse-go/v2" // Import the ClickHouse driver
)
func main() {
dsn := `http://chproxy:8123/db?username=USER&password=PASS`
conn, err := sql.Open("clickhouse", dsn)
if err != nil {
panic(err)
}
if err := conn.Ping(); err != nil {
panic(err)
}
}
Describe the solution you'd like
Add client_protocol_version to allowedParams
Describe alternatives you've considered
Workaround: hardcode client_protocol_version in param_groups
param_groups:
- name: "protocol_version"
params:
- key: "client_protocol_version"
value: "54460"
Additional context
chproxy version v1.28.0
clickhouse-go version v2.40.1
clickhouse version v25.3.6.56