镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

ClickHouseClient.load reports an error: Authentication failed #1114

Closed

Description

@SuperTigerPro

I have the following code 1:

ClickHouseNode server = ClickHouseNode.builder()
    .host("X.X.X.X")
    .port(18123)
    .database("default")
    .credentials(ClickHouseCredentials.fromUserAndPassword("default", "password")).build();
ClickHouseClient.load(server, "table_name",
    ClickHouseFormat.CSV, ClickHouseCompression.NONE, "csv_name.csv").get();

it will prompt:

java.util.concurrent.ExecutionException: com.clickhouse.client.ClickHouseException: Code: 516. DB::Exception: default: Authentication failed: password is incorrect or there is no user with such name. (AUTHENTICATION_FAILED) (version 22.3.6.5 (official build))
, server ClickHouseNode [uri=http://X.X.X.X:18123/default]

However, the following code 2 work fine:

ClickHouseNode server = ClickHouseNode.of("http://X.X.X.X:18123/default?user=default&password=password");
ClickHouseClient.load(server, "table_name",
    ClickHouseFormat.CSV, ClickHouseCompression.NONE, "csv_name.csv").get();

The clickhouse-jdbc version is 0.3.2-patch11, X.X.X.X is a node in the CK cluster.
I guess there are some problems with ClickHouseNode.Builder or ClickHouseClient.load.

Activity

  1. zhicwu commented on Oct 20, 2022

    @zhicwu
    Contributor

    Thank you @mywrong it does look like a bug and sorry for the inconvenience at your end. Will fix it in next release.

  2. added this to the 0.4.1 release milestone on Jan 20, 2023
  3. linked a pull request that will close this issueRepsect node-specific credentials #1282on Mar 16, 2023
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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions