Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClickHouseClient.load reports an error: Authentication failed #1114

Closed
mywrong opened this issue Oct 20, 2022 · 1 comment · Fixed by #1282
Closed

ClickHouseClient.load reports an error: Authentication failed #1114

mywrong opened this issue Oct 20, 2022 · 1 comment · Fixed by #1282
Labels
Milestone

Comments

@mywrong
Copy link

mywrong commented Oct 20, 2022

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.

@zhicwu
Copy link
Contributor

zhicwu commented Oct 20, 2022

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

@zhicwu zhicwu added the bug label Oct 20, 2022
@zhicwu zhicwu added this to the 0.4.1 release milestone Jan 20, 2023
@zhicwu zhicwu linked a pull request Mar 16, 2023 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants