Skip to content

Version 25.10 breaks JBDC driver #2636

Closed

Description

@fdmota

Company or project name

No response

Describe the unexpected behaviour

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

Expected behavior

No response

Error message and/or stacktrace

No response

Additional context

No response

Activity

  1. raimannma commented on Nov 2, 2025

    @raimannma

    Yes, version 0.6.3 broke, but version 0.8.6 of the JDBC driver works!

  2. chernser commented on Nov 3, 2025

    @chernser
    Contributor

    Good day, @fdmota !
    What JDBC version do you use?

    Thanks!

  3. fdmota commented on Nov 3, 2025

    @fdmota
    Author

    Good day, @fdmota ! What JDBC version do you use?

    Thanks!

    It broke in 3 different applications we use to connect to the database. One of them is Dbeaver using vesrion 0.7.2.
    Image

    Other applications are out of my control since they are managed by third party vendors.

  4. chernser commented on Nov 3, 2025

    @chernser
    Contributor

    @fdmota

    Upgrading JDBC and DBeaver I think it the only option here.

    1. Would you please send a full stacktrace?
    2. Would you please tell what other applications are broken? Do they have an option to update to a newer version?

    Thanks!

  5. tomnewton commented on Nov 3, 2025

    @tomnewton

    We are really in a bad way with this change too.

    Apache Beam is using a 0.6x version of the JDBC driver.

  6. chernser commented on Nov 3, 2025

    @chernser
    Contributor

    @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.

  7. chernser commented on Nov 3, 2025

    @chernser
    Contributor

    @tomnewton
    btw, do you have a complete stacktrace for the exception?

    It will help me to find a workaround.

  8. tomnewton commented on Nov 3, 2025

    @tomnewton
    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
    
  9. chernser commented on Nov 3, 2025

    @chernser
    Contributor

    Just to note:
    I think, that root cause of the issue is
    ClickHouse/ClickHouse#71591

    Old client sends Accept-Encoding all the time but may wrongly detect what LZ4 implementation should be used.
    Need to verify this.

  10. chernser commented on Nov 3, 2025

    @chernser
    Contributor

    @tomnewton

    As workaround you may disable server compression by setting JDBC settings:

            Properties p = new Properties();
            p.put("compress" , "0");
    

    Or setting on server side:
    enable_http_compression=0

  11. chernser commented on Nov 4, 2025

    @chernser
    Contributor

    @tomnewton

    Another workaround is to disable http compression

            Properties p = new Properties();
            p.put("compress" , "1");
            p.put("custom_http_params" , "enable_http_compression=0");
    

    Or in JDBC url
    custom_http_params=enable_http_compression=0

  12. pinned this issue on Nov 4, 2025
  13. xfernandeztappx commented on Nov 6, 2025

    @xfernandeztappx

    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?

  14. chernser commented on Nov 6, 2025

    @chernser
    Contributor

    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!

  15. xfernandeztappx commented on Nov 12, 2025

    @xfernandeztappx

    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:

    • Access dbViewer (with 0.9.3 plugin)
    • connect to our Clickhouse cluster based on last 25.10 version
    • Execute a query with an error
    • The query fails and the error that appears in dbViewer error panel is always: SQL Error [22000]: Code: 70. DB::Exception: (transport error: 500)

    Just after update to 0.9,4 plugin now appears the detail of the error

    Regards

  16. chernser commented on Nov 12, 2025

    @chernser
    Contributor

    Thank you @xfernandeztappx !
    We are glad to help our user and support them at any time!

    Thank you for providing clear instructions!

  17. unpinned this issue on Feb 24, 2026
  18. added a commit that references this issue on Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigatingInvestigation of a root cause is on goingjdbc-v1JDBC driver

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions