After upgrading ClickHouse from 25.9 to 26.3, JDBC clients started showing unreadable errors for any failed SQL query, using any DB tool (DBeaver, DataGrip, Pycharm).
ClickHouse version:
26.3.12.3-yc.1
Tested JDBC driver versions:
0.8.x
0.9.x
The behavior is the same with all tested versions.
Example query:
SELECT * FROM not_existing_table;
Expected error:
Code: 60. DB::Exception: Unknown table expression identifier 'not_existing_table' ...
Actual JDBC error:
SQL Error [60] [22000]: Code: 60. DB::Exception: <Unreadable error message> (transport error: 200)
The connection goes through chproxy.
With curl, the behavior depends on compress.
Without compress=1:
HTTP/2 404
Code: 60. DB::Exception: Unknown table expression identifier ...
With compress=1:
HTTP/2 200
content-length: 0
x-clickhouse-exception-code: 60
x-clickhouse-query-id: ...
So it looks like ClickHouse reports the error only via X-ClickHouse-Exception-Code, while the JDBC driver treats HTTP 200 as a successful response and then fails to read the error body.
This started only after upgrading ClickHouse from 25.9 to 26.3.
Expected behavior: if the response has X-ClickHouse-Exception-Code, the JDBC driver should treat it as a ClickHouse exception even when the HTTP status is 200, and should expose at least the exception code/query id instead of "Unreadable error message".
Possibly related: ClickHouse/clickhouse-go#1859
Different driver, but similar protocol-level behavior: HTTP 200 OK with X-ClickHouse-Exception-Code should still be treated as a ClickHouse query error.
After upgrading ClickHouse from 25.9 to 26.3, JDBC clients started showing unreadable errors for any failed SQL query, using any DB tool (DBeaver, DataGrip, Pycharm).
ClickHouse version:
26.3.12.3-yc.1
Tested JDBC driver versions:
0.8.x
0.9.x
The behavior is the same with all tested versions.
Example query:
SELECT * FROM not_existing_table;Expected error:
Code: 60. DB::Exception: Unknown table expression identifier 'not_existing_table' ...Actual JDBC error:
SQL Error [60] [22000]: Code: 60. DB::Exception: <Unreadable error message> (transport error: 200)The connection goes through chproxy.
With curl, the behavior depends on compress.
Without compress=1:
With compress=1:
So it looks like ClickHouse reports the error only via X-ClickHouse-Exception-Code, while the JDBC driver treats HTTP 200 as a successful response and then fails to read the error body.
This started only after upgrading ClickHouse from 25.9 to 26.3.
Expected behavior: if the response has X-ClickHouse-Exception-Code, the JDBC driver should treat it as a ClickHouse exception even when the HTTP status is 200, and should expose at least the exception code/query id instead of "Unreadable error message".
Possibly related: ClickHouse/clickhouse-go#1859
Different driver, but similar protocol-level behavior:
HTTP 200 OKwithX-ClickHouse-Exception-Codeshould still be treated as a ClickHouse query error.