// ClickHouse error reference

516: AUTHENTICATION_FAILED (code 516)

The user name, password, certificate or Kerberos identity did not check out at login.

エラーコード
516
名前
AUTHENTICATION_FAILED
カテゴリ
Authentication and access
エラーメッセージ
{user}: Authentication failed: password is incorrect, or there is no user with such name

意味

AUTHENTICATION_FAILED (516) is the modern ClickHouse login failure. It covers a wrong password and an unknown user with one message by design, so the error does not leak which of the two failed. Older or other errors you may see alongside are UNKNOWN_USER (192) and WRONG_PASSWORD (193).

よくある原因

  • The password is wrong, was rotated, or the app config still holds an old value.
  • The user does not exist on that server, for example a replica without replicated access control synced.
  • The user exists but its auth type (no_password, certificate, Kerberos) does not match how the client connected.

Find the cause

`system.users` for existence and auth type, `system.query_log` has no rows for failed logins so use the server log, which records each failure with the user name and code 516. The failure line does not include the source address on this build, so take the IP from connection or proxy logs.

修正方法

  1. Confirm the user and its auth type on the server you reached.

    SELECT name, auth_type FROM system.users;
  2. Reset the password if rotation broke it.

    ALTER USER app_user IDENTIFIED BY 'new_password';
  3. Test the credentials from the client host to rule out the wrong server.

    clickhouse-client --host my_host --user app_user --password

Other ways to handle it

SHOW USERS lists names fast. For access control stored in ZooKeeper, verify all replicas run the same access_management settings.

安全に再現する

CREATE USER scratch_u IDENTIFIED BY 'pw'; then clickhouse-client --user scratch_u --password wrong returns 516.

質問

Why does the message not say whether the user exists?

On purpose. A single message stops attackers from enumerating user names.

Users vanish after restart?

They were defined in a local access control file while other replicas use replicated access control; align the user_directories configuration across the replicas so each node reads the same store. The access_management setting does not select storage; it grants SQL-driven access control and account management to a user.

関連エラー

コードとメッセージのテキストは、 ClickHouse documentation (system.errors)。全容は次で参照 ClickHouse error list または すべてのデータベースエラーを検索.

// エラーが減り、修正も速く

Work on ClickHouse in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for ClickHouse and the other databases you use.

このページのテキストとデータ: CC BY 4.0、出典は SQLly (sqlly.app) と明記してください。 コードと SQL スニペット: MIT. ライセンスの詳細 引用したエラーメッセージの文言は、各データベースベンダーに帰属します。