Skip to content

[jdbc-v2] Documented driver property clickhouse.jdbc.v1 makes the connection fail: Unknown and unmapped config properties #3436

Backlog

Description

@claude

Description

clickhouse.jdbc.v1 is listed in the Driver properties table of the JDBC docs
(docs/clickhouse-docs/jdbc.mdx:82, default false). When an application passes it as a connection
property or as a URL query parameter, jdbc-v2 does not create the connection: the key is not in
DriverProperties, so JdbcConfiguration.buildFinalProperties forwards it to client-v2, and
client-v2's strict validator rejects it.

java.sql.SQLException: Failed to create connection
Caused by: com.clickhouse.client.api.ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1]

This is the same class of problem as #3218 (disable_frameworks_detection, fixed by #3282) — a
property that the docs list as a driver property is forwarded into the unknown-key validator and
kills connection creation. disable_frameworks_detection now works; clickhouse.jdbc.v1 is the
remaining row of that table with no DriverProperties entry.

It is reachable through the combined driver too: com.clickhouse.jdbc.ClickHouseDriver.isV2(url)
(clickhouse-jdbc/src/main/java/com/clickhouse/jdbc/ClickHouseDriver.java:61) only routes to V1 when
the URL contains clickhouse.jdbc.v1=true. A user who writes the documented clickhouse.jdbc.v1=false
explicitly (to opt into V2) is routed to V2 with the parameter still in the URL, and the connection fails.

Note the docs are inconsistent with themselves: jdbc.mdx:52 says clickhouse.jdbc.v1 is a system
property, while jdbc.mdx:82 lists it in the driver-properties table.

ClickHouse server version

26.11.2.4 (the failure happens during connect, before any server request).

Reproduction

TestNG test in jdbc-v2 (jdbc-v2/src/test/java/com/clickhouse/jdbc/...), run against a local server
on http://localhost:8123:

package com.clickhouse.jdbc;

import org.testng.annotations.Test;

import java.sql.Connection;
import java.util.Properties;

public class V1PropTest {

    private static final String URL = "jdbc:clickhouse://localhost:8123/default";

    @Test
    public void documentedV1PropertyInUrl() throws Exception {
        try (Connection c = new Driver().connect(URL + "?clickhouse.jdbc.v1=false", new Properties())) {
            assert c != null;
        }
    }

    @Test
    public void documentedV1PropertyInProperties() throws Exception {
        Properties props = new Properties();
        props.setProperty("clickhouse.jdbc.v1", "false");
        try (Connection c = new Driver().connect(URL, props)) {
            assert c != null;
        }
    }
}

Expected: both connections are created (the property is documented, and the V2 driver is already the
implementation being asked for).

Actual (main @ 67775d0d3, 0.12.0-rc1-SNAPSHOT):

Tests run: 2, Failures: 2, Errors: 0, Skipped: 0
java.sql.SQLException: Failed to create connection
Caused by: com.clickhouse.client.api.ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1]
java.sql.SQLException: Failed to create connection
Caused by: com.clickhouse.client.api.ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1]

A wider run of the same setup, for comparison (same build, printing the root cause instead of asserting):

Case Result
no properties OK
URL ?clickhouse.jdbc.v1=false ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1]
URL ?clickhouse.jdbc.v1=true ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1]
Properties clickhouse.jdbc.v1=false ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1]
Properties disable_frameworks_detection=true OK (fixed by #3282)

Root cause

  • jdbc-v2/src/main/java/com/clickhouse/jdbc/DriverProperties.java: no entry for clickhouse.jdbc.v1.
  • jdbc-v2/src/main/java/com/clickhouse/jdbc/internal/JdbcConfiguration.java:397-401: a key that is not
    in DRIVER_PROP_KEYS goes into clientProperties and is sent to Client.Builder.
  • client-v2/src/main/java/com/clickhouse/client/api/ClientConfigProperties.java:552-560
    (parseConfigMap): an unknown key throws ClientMisconfigurationException unless
    ignore_unknown_config_key=true.

Suggested fix

Pick one spelling of the contract and make code and docs agree, as was done for
disable_frameworks_detection:

  1. Add a DriverProperties entry for clickhouse.jdbc.v1 (default false) so buildFinalProperties
    keeps it in driverProperties and does not forward it to the client; the V2 driver can then ignore
    it (the V1/V2 choice is already made by ClickHouseDriver.isV2), or
  2. Remove the row from the driver-properties table in docs/clickhouse-docs/jdbc.mdx:82 and keep only
    the system-property description at jdbc.mdx:52 — but then a URL with the documented
    clickhouse.jdbc.v1=false still fails, so option 1 is the safer one.

Behavior that must not change: other unknown keys must still throw ClientMisconfigurationException
(#2712).

Link

Found while checking whether ClickHouse/clickhouse-js#1215 (documented URL parameter application_id
rejected by the strict unknown-parameter validator) applies to this client. The JS issue itself does not
apply here (the Java client name property is client_name and it matches the docs), but the same bug
class does, with clickhouse.jdbc.v1.

Activity

  1. polyglotAI-bot commented on Nov 26, 2026

    @polyglotAI-bot
    Collaborator

    Recommendation: Keep open — maintainer decision
    Decide whether clickhouse.jdbc.v1 is a connection property or only a system property (jdbc.mdx says both), then make the code or the docs agree. No open PR.

    • Category: Bug
    • Classification: impact: none · area: Configuration (driver properties)
    • Status on main: Reproduced on main — the issue's two cases fail as it shows; the key also fails through DriverManager (ClickHouseDriver), and clickhouse.jdbc.v1=true in Properties does not select v1.
    • Breaking change: No.
    • Duplicates / related: No others.

    Analysis: DriverProperties has no entry for clickhouse.jdbc.v1, so JdbcConfiguration.java:393-401 passes it to client-v2, which rejects unknown keys (ClientConfigProperties.java:554-558). ClickHouseDriver.isV2 (clickhouse-jdbc/src/main/java/com/clickhouse/jdbc/ClickHouseDriver.java:50-74) reads the flag only from the system property and the URL text, so the key in Properties never selects v1. docs/clickhouse-docs/jdbc.mdx:52 calls it a system property; the driver-property table at :82 lists it.

    Reproduction: complete program and output

    Changed from the issue's steps: the two TestNG cases as a main, with a password; added the key through DriverManager, clickhouse.jdbc.v1=true in Properties, and a contrast case.

    import java.sql.Connection;
    import java.sql.DriverManager;
    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 JDBC_URL = "jdbc:clickhouse:" + URL.replaceFirst("^https?:", "") + "/default";
    
        static Properties props() {
            Properties p = new Properties();
            p.setProperty("user", "default");
            p.setProperty("password", PASSWORD);
            return p;
        }
    
        static void run(String label, java.sql.Driver driver, String url, Properties p) {
            try (Connection c = driver != null ? driver.connect(url, p) : DriverManager.getConnection(url, p)) {
                System.out.println(label + ": OK " + c.getClass().getSimpleName());
            } catch (Exception e) {
                Throwable root = e;
                while (root.getCause() != null) root = root.getCause();
                System.out.println(label + ": ERROR " + e.getClass().getSimpleName() + ": " + e.getMessage()
                        + " | root: " + root.getClass().getSimpleName() + ": " + root.getMessage());
            }
        }
    
        public static void main(String[] args) throws Exception {
            // the issue's two cases (jdbc-v2 Driver)
            run("jdbc-v2 Driver, URL ?clickhouse.jdbc.v1=false", new com.clickhouse.jdbc.Driver(), JDBC_URL + "?clickhouse.jdbc.v1=false", props());
            Properties p = props();
            p.setProperty("clickhouse.jdbc.v1", "false");
            run("jdbc-v2 Driver, Properties clickhouse.jdbc.v1=false", new com.clickhouse.jdbc.Driver(), JDBC_URL, p);
            // the same through DriverManager (ClickHouseDriver of the clickhouse-jdbc artifact)
            run("DriverManager, URL ?clickhouse.jdbc.v1=false", null, JDBC_URL + "?clickhouse.jdbc.v1=false", props());
            Properties p1 = props();
            p1.setProperty("clickhouse.jdbc.v1", "true");
            run("DriverManager, Properties clickhouse.jdbc.v1=true", null, JDBC_URL, p1);
            // contrast: no property
            run("DriverManager, no property", null, JDBC_URL, props());
        }
    }

    Output on main (8480ca001), ClickHouse 26.11.2.4:

    jdbc-v2 Driver, URL ?clickhouse.jdbc.v1=false: ERROR SQLException: Failed to create connection | root: ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1]
    jdbc-v2 Driver, Properties clickhouse.jdbc.v1=false: ERROR SQLException: Failed to create connection | root: ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1]
    DriverManager, URL ?clickhouse.jdbc.v1=false: ERROR SQLException: Failed to create connection | root: ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1]
    DriverManager, Properties clickhouse.jdbc.v1=true: ERROR SQLException: Failed to create connection | root: ClientMisconfigurationException: Unknown and unmapped config properties: [clickhouse.jdbc.v1]
    DriverManager, no property: OK ConnectionImpl
    

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

  2. added
    configuration
    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

    bugconfigurationdocumentationjdbc

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions