You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our Clickhouse database was updated to 25.10.1, all applications using JDBC driver stopped working with the following error:
Error connecting to data source.
Please check your connection details and user permissions, then try again, or save as draft.
Database Error: java.sql.SQLException: java.io.IOException: Magic is not correct - expect [-126] but got [37] traceId: 7597c5fea5fa48e1a4fa252db3ad9048
reverting to 25.9 works fine.
Is it a bug? A needed parameter adjustment?
Which ClickHouse versions are affected?
25.10
How to reproduce
Start Clickhouse with version 25.10.1 and try to connect with a jdbc driver
Something like: jdbc:clickhouse://localhost:8123/datawarehouse
Caused by: java.lang.RuntimeException: java.sql.SQLException: java.io.IOException: Magic is not correct - expect [-126] but got [-96]
at org.apache.beam.sdk.io.clickhouse.ClickHouseIO.getTableSchema(ClickHouseIO.java:544)
at ky.***.dataflow.generic.integration.GenericSchemaIntegrationTest.runPreFlightChecks(GenericSchemaIntegrationTest.java:249)
... 19 more
Caused by: java.sql.SQLException: java.io.IOException: Magic is not correct - expect [-126] but got [-96]
at com.clickhouse.jdbc.SqlExceptionUtils.create(SqlExceptionUtils.java:45)
at com.clickhouse.jdbc.SqlExceptionUtils.handle(SqlExceptionUtils.java:90)
at com.clickhouse.jdbc.ClickHouseResultSet.<init>(ClickHouseResultSet.java:136)
at com.clickhouse.jdbc.internal.ClickHouseStatementImpl.updateResult(ClickHouseStatementImpl.java:458)
at com.clickhouse.jdbc.internal.ClickHouseStatementImpl.getLastResponse(ClickHouseStatementImpl.java:153)
at com.clickhouse.jdbc.internal.ClickHouseStatementImpl.executeQuery(ClickHouseStatementImpl.java:541)
at org.apache.beam.sdk.io.clickhouse.ClickHouseIO.getTableSchema(ClickHouseIO.java:509)
... 20 more
Caused by: java.io.IOException: Magic is not correct - expect [-126] but got [-96]
at com.clickhouse.data.stream.Lz4InputStream.updateBuffer(Lz4InputStream.java:66)
at com.clickhouse.data.stream.AbstractByteArrayInputStream.available(AbstractByteArrayInputStream.java:79)
at com.clickhouse.data.format.ClickHouseRowBinaryProcessor.readColumns(ClickHouseRowBinaryProcessor.java:263)
at com.clickhouse.data.ClickHouseDataProcessor$DefaultSerDe.<init>(ClickHouseDataProcessor.java:48)
at com.clickhouse.data.ClickHouseDataProcessor.getInitializedSerDe(ClickHouseDataProcessor.java:288)
at com.clickhouse.data.ClickHouseDataProcessor.getColumns(ClickHouseDataProcessor.java:455)
at com.clickhouse.client.ClickHouseStreamResponse.getColumns(ClickHouseStreamResponse.java:135)
at com.clickhouse.jdbc.ClickHouseResultSet.<init>(ClickHouseResultSet.java:130)
... 24 more
I don't know if someone can help me to understand if this is the same issue. Using in dbViewer the clickhouse jdbc driver againts a 25.8 cluster if I do an issue in a query the error is perfectly showed.
But if I do the same with 25.10 cluster (even I update the driver to 0.9.3 version i just see a generic error;
Activity
raimannma commentedon Nov 2, 2025
Yes, version 0.6.3 broke, but version 0.8.6 of the JDBC driver works!
chernser commentedon Nov 3, 2025
Good day, @fdmota !
What JDBC version do you use?
Thanks!
fdmota commentedon Nov 3, 2025
It broke in 3 different applications we use to connect to the database. One of them is Dbeaver using vesrion 0.7.2.

Other applications are out of my control since they are managed by third party vendors.
chernser commentedon Nov 3, 2025
@fdmota
Upgrading JDBC and DBeaver I think it the only option here.
Thanks!
tomnewton commentedon Nov 3, 2025
We are really in a bad way with this change too.
Apache Beam is using a 0.6x version of the JDBC driver.
chernser commentedon Nov 3, 2025
@tomnewton
Thank you for the response!
Version seems was not updated for a long
https://github.com/apache/beam/blob/master/sdks/java/io/clickhouse/build.gradle
We will see what can be done.
chernser commentedon Nov 3, 2025
@tomnewton
btw, do you have a complete stacktrace for the exception?
It will help me to find a workaround.
tomnewton commentedon Nov 3, 2025
chernser commentedon Nov 3, 2025
Just to note:
I think, that root cause of the issue is
ClickHouse/ClickHouse#71591
Old client sends
Accept-Encodingall the time but may wrongly detect what LZ4 implementation should be used.Need to verify this.
chernser commentedon Nov 3, 2025
@tomnewton
As workaround you may disable server compression by setting JDBC settings:
Or setting on server side:
enable_http_compression=0chernser commentedon Nov 4, 2025
@tomnewton
Another workaround is to disable http compression
Or in JDBC url
custom_http_params=enable_http_compression=0xfernandeztappx commentedon Nov 6, 2025
Hi
I don't know if someone can help me to understand if this is the same issue. Using in dbViewer the clickhouse jdbc driver againts a 25.8 cluster if I do an issue in a query the error is perfectly showed.
But if I do the same with 25.10 cluster (even I update the driver to 0.9.3 version i just see a generic error;
SQL Error [22000]: Code: 70. DB::Exception: (transport error: 500)
Is it the same case?
chernser commentedon Nov 6, 2025
good day, @xfernandeztappx !
Would you please give more information on how to reproduce the issue?
Do you use V1 or V2 JDBC driver? What properties do you have.
Thanks!
xfernandeztappx commentedon Nov 12, 2025
Hi @chernser
First of all, many thanks. The last 0.9.4 plugin releasesd solved the problem.
But just to help people, the steps to reproduce:
Just after update to 0.9,4 plugin now appears the detail of the error
Regards
chernser commentedon Nov 12, 2025
Thank you @xfernandeztappx !
We are glad to help our user and support them at any time!
Thank you for providing clear instructions!
Testcontainers: Add ClickHouse JDBC test (#97)
Bump clickhouse-jdbc dirver version (#56)
Testcontainers: Add ClickHouse JDBC test (apache#97)
Testcontainers: Add ClickHouse JDBC test (apache#97)
Testcontainers: Add ClickHouse JDBC test (#97)