Skip to content

Missing Windows dynamic library for zstd #3339

Open

Description

@davidpatel0

I get an error when trying to use this on windows with compression on:
Failed to open resource /win/amd64/libzstd-jni-1.5.7-23.dll as stream: Unsupported OS/arch, cannot find /win/amd64/libzstd-jni-1.5.7-23.dll or load libzstd-jni-1.5.7-23.dll from system libraries.

I am using this jar: clickhouse-jdbc-0.11.1-all-dependencies.jar, and when looking into it, it has linux and darwin directories with libszstd so-s/dylib for linux / mac, but it does not have them for windows

Activity

  1. chernser commented on Nov 11, 2026

    @chernser
    Contributor

    Thank you for reporting this!

    We will look into it soon.

  2. added
    environment
    and removed on Nov 26, 2026
  3. polyglotAI-bot commented on Nov 26, 2026

    @polyglotAI-bot
    Collaborator

    Recommendation: Close — duplicate of #3175
    Same cause and same error as #3175, where a maintainer answered on 2026-10-14 that the limitation will be documented. #3175 stays open.

    • Category: Bug
    • Classification: impact: none · area: Environment (zstd-jni, Windows)
    • Status on main: Reproduced on main — the all-dependencies jar built from main has no Windows zstd library, and a query with default settings loads that library.
    • Breaking change: No.
    • Duplicates / related: No others.
    • Workaround: Add compress=false to the JDBC URL: the query then does not load the zstd library.

    Analysis: client-v2/pom.xml:65 takes zstd-jni with the cloud classifier, which has libraries only for linux/amd64, linux/aarch64, and darwin/aarch64, and the shaded jars copy them. With compress=true (default), the server sends ZSTD blocks (the default network_compression_method), so CompressedBlockInputStream.java:156 needs the library. docs/integration-client.md:1314 tells users to call disableNativeCompression(true) when JNI libraries cannot load, but that option changes only LZ4 (Client.java:234).

    Reproduction: complete program and output
    import com.github.luben.zstd.util.Native;
    
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.util.Properties;
    
    public class Repro {
        static final String URL = System.getenv().getOrDefault("CLICKHOUSE_URL", "http://localhost:8123");
        static final String PASSWORD = System.getenv().getOrDefault("CLICKHOUSE_PASSWORD", "");
        static final String LIB = "libzstd-jni-1.5.7-23";
    
        public static void main(String[] args) {
            // zstd-jni native libraries in the jar
            for (String path : new String[] {"win/amd64/" + LIB + ".dll", "darwin/x86_64/" + LIB + ".dylib",
                    "linux/amd64/" + LIB + ".so"}) {
                System.out.println("resource " + path + ": "
                        + (Repro.class.getClassLoader().getResource(path) != null ? "found" : "missing"));
            }
    
            // the zstd-jni loader, as it runs on Windows x86-64
            String os = System.getProperty("os.name");
            System.setProperty("os.name", "Windows 10");
            try {
                Native.load();
                System.out.println("load on Windows: OK");
            } catch (Throwable e) {
                System.out.println("load on Windows: " + e.getClass().getName() + ": " + e.getMessage());
            } finally {
                System.setProperty("os.name", os);
            }
    
            // does a query need the zstd library?
            query("compress=false", "?compress=false");
            query("default settings", "");
        }
    
        static void query(String name, String params) {
            Properties props = new Properties();
            props.setProperty("user", "default");
            props.setProperty("password", PASSWORD);
            String jdbcUrl = "jdbc:clickhouse:" + URL.replaceFirst("^https?:", "") + "/default" + params;
            try (Connection conn = DriverManager.getConnection(jdbcUrl, props);
                 ResultSet rs = conn.createStatement().executeQuery("SELECT version()")) {
                rs.next();
                System.out.println(name + ": server " + rs.getString(1) + ", zstd library loaded: " + Native.isLoaded());
            } catch (Exception e) {
                System.out.println(name + ": " + e.getClass().getName() + ": " + e.getMessage());
            }
        }
    }

    Output on main (8480ca001), ClickHouse 26.11.2.4, with clickhouse-jdbc-0.12.0-rc1-SNAPSHOT-all-dependencies.jar built from main:

    resource win/amd64/libzstd-jni-1.5.7-23.dll: missing
    resource darwin/x86_64/libzstd-jni-1.5.7-23.dylib: missing
    resource linux/amd64/libzstd-jni-1.5.7-23.so: found
    load on Windows: java.lang.UnsatisfiedLinkError: Failed to open resource /win/amd64/libzstd-jni-1.5.7-23.dll as stream:
    Unsupported OS/arch, cannot find /win/amd64/libzstd-jni-1.5.7-23.dll or load zstd-jni-1.5.7-23 from system libraries. …
    compress=false: server 26.11.2.4, zstd library loaded: false
    default settings: server 26.11.2.4, zstd library loaded: true
    

    Automated triage by Polyglot AI. A maintainer makes the final decision.

  4. added
    client
    documentation
    jdbc
    on Nov 26, 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

    bugclientdocumentationduplicateenvironmentjdbc

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions