// Redis error reference

NOAUTH: Authentication required

The server requires a password and the connection has not authenticated yet, so every command except AUTH, HELLO and QUIT is refused.

Error prefix
NOAUTH
类别
Connection and auth
错误信息
NOAUTH Authentication required.

它的意思

NOAUTH means the connection reached Redis but never proved who it is. The server has requirepass set or an ACL setup that demands a login, and until the client sends a successful AUTH (or connects with credentials in the URL), every command except AUTH and QUIT is refused with this exact prefix. HELLO is refused too unless it carries the AUTH option, as in HELLO 3 AUTH default s3cret.

It is almost always a client-side configuration gap: the application has no password configured, the credentials went to one pool but a second app or job runner opened its own unauthenticated connection, or a monitoring tool connects directly. The error appears on the first data command rather than at connect time, because RESP does not require authentication up front.

常见原因

  • The server has requirepass or ACL authentication enabled and the client connected without sending AUTH.
  • The credentials are missing from one specific client, such as a job runner or dashboard, while the main application authenticates fine.
  • A proxy or connection pooler forwards commands from a client that never authenticates.

Find the cause

# Does this connection need auth? Run it without credentials:
redis-cli -h db.example.com PING
# (error) NOAUTH Authentication required.
# What the server requires:
redis-cli -a s3cret CONFIG GET requirepass
redis-cli -a s3cret ACL LIST

如何修复它

  1. Authenticate the connection right after opening it, or put the credentials in the connection string:

    redis-cli -h db.example.com -a s3cret PING
    # or, inside an existing session:
    AUTH s3cret
  2. Check what the server actually requires before guessing at passwords. On the server host:

    redis-cli -a s3cret CONFIG GET requirepass
    redis-cli -a s3cret ACL LIST
  3. Prefer a named ACL user over the legacy global password when you control the server, so each application can be rotated on its own:

    ACL SETUSER app on >s3cret ~app:* +@read +@write
    AUTH app s3cret

Other ways to handle it

Putting the credentials in a redis:// URL keeps the username and password out of a separate AUTH line: redis://default:[email protected]:6379. Typed inline, the URL still lands in shell history just as -a does, so keep it in a config or environment file where that matters. For fleets, named ACL users beat the single requirepass because each application can be re-passworded without touching the others.

安全地复现它

redis-server --port 7300 --requirepass s3cret --save '' &
redis-cli -p 7300 PING
# (error) NOAUTH Authentication required.
redis-cli -p 7300 -a s3cret PING
# PONG

问题

NOAUTH or WRONGPASS: which one means the password was wrong?

NOAUTH means no credentials were sent at all. WRONGPASS means a password or username was sent and the server rejected it.

Why does my client report NOAUTH only on the first query?

RESP lets a client open a connection and start sending immediately. Redis defers the rejection to the first command that needs auth, so pools that authenticate lazily surface the error on the first real command.

Can I just turn auth off?

You can clear it with CONFIG SET requirepass "", but the safer fix is keeping auth on and adding the credentials to the client that is missing them.

相关错误

代码和消息文本来自 Redis documentation and source code。浏览完整的 Redis error list 或者 搜索每个数据库错误.

// 错误更少,修复更快

Work on Redis in SQLly

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

本页文字和数据: CC BY 4.0,请注明出处 SQLly (sqlly.app)。 代码和 SQL 片段: MIT. 许可详情 引用的错误消息文本归其数据库厂商所有。