Incident Response

Redis "NOAUTH Authentication required" and WRONGPASS: Causes and Fixes

NOAUTH means the connection never authenticated; WRONGPASS means it tried and failed. Both usually appear right after someone sets a password, turns on ACLs or rotates a secret, and the fix depends on which one you see.

· 14 min read · AG Data Team

"NOAUTH Authentication required" is Redis telling a client that this connection has not authenticated and the server requires it. Its sibling WRONGPASS means the client did try AUTH, but the username and password did not match an enabled user. Both texts are the same in Redis and in Valkey, which forked from it.

127.0.0.1:6379> GET session:42
(error) NOAUTH Authentication required.

127.0.0.1:6379> AUTH app wrong-secret
(error) WRONGPASS invalid username-password pair or user is disabled.

When Redis demands authentication

Since Redis 6 every connection belongs to an ACL user. By default there is one user, default, configured as on nopass ~* &* +@all, and with nopass on the default user new connections are authenticated automatically, without any AUTH (ACL guide). In the source the rule is exactly that: authentication is required when the default user is not nopass or is disabled, and the connection has not authenticated yet. Until then every command except AUTH, HELLO and a few others gets NOAUTH.

So NOAUTH starts the moment one of these happens:

Fixing NOAUTH

NOAUTH is almost always on the client side: it never sent credentials, or sent them on a different connection.

  1. The client config has no password. Someone enabled auth on the server and not every service got the secret. Find which ones are still trying with CLIENT LIST on the server or the error logs of each service.
  2. The password is in the wrong place. For a URL, the format is redis://user:password@host:port/db; special characters must be percent-encoded, as in the documentation's p%40ssw0rd example (redis-cli). For authentication without a username, the documented username is default.
  3. Reconnects without credentials. In our experience, hand-written connection code that sends AUTH once after connecting, but not after an automatic reconnect, produces NOAUTH bursts after every network blip or failover. Configure credentials in the client library, not as a command you send yourself.
  4. Scripts and cron jobs. redis-cli without -a, --user or REDISCLI_AUTH connects as nobody and gets NOAUTH on the first command.

Fixing WRONGPASS

The full message is WRONGPASS invalid username-password pair or user is disabled. (acl.c). It covers several different problems:

Find out who is failing

# safer than -a: the password does not end up in shell history or ps output
export REDISCLI_AUTH='...'
redis-cli -h cache1 --user admin PING

# or type it in
redis-cli -h cache1 --user admin --askpass

ACL LIST              # users, on/off, nopass, and password hashes
ACL WHOAMI            # who this connection is authenticated as
ACL LOG 10            # recent failed AUTH attempts and denied commands
CONFIG GET aclfile    # if set, requirepass is ignored

ACL LOG is the most useful command here. It lists recent failed authentications with AUTH or HELLO (reason auth) and commands denied by ACL rules, with the username, a count of events within a 60-second window and full client-info, including the client address (ACL LOG). That address tells you which host or pod still has the old secret.

For redis-cli, the documentation recommends passing the password through the REDISCLI_AUTH environment variable rather than -a; --askpass prompts for it with a mask, and --user sends the two-argument ACL form of AUTH (redis-cli).

Do not "fix" NOAUTH by removing the password. Redis is designed for trusted networks, and the documentation is explicit that a single FLUSHALL from an outside client can delete the whole dataset (Redis security). Since version 3.2 protected mode limits an instance with the default configuration and no password to loopback clients; switching it off together with the password exposes the instance.

Set it up properly once

# one user per application, no access to dangerous commands
ACL SETUSER app on >PASSWORD_FROM_ACL_GENPASS ~app:* &app:* +@all -@dangerous

# persist it: ACL SAVE with an aclfile, CONFIG REWRITE with users in redis.conf
ACL SAVE

Give each application its own ACL user with only the keys and commands it needs. Every user can have any number of passwords, Redis stores them as SHA-256 hashes, and ACL GENPASS generates a 256-bit random password (ACL guide). The documentation asks for long random passwords because Redis can test a lot of them in parallel in a very short time (AUTH). Note that AUTH itself travels unencrypted unless you use TLS.

Replicas, Sentinel and Cluster

Turning on authentication on the primary also breaks replication if replicas do not know the credentials: the master refuses the replica's sync request. Replicas authenticate with masterauth, and with ACLs also masteruser, which makes them send AUTH <username> <password> (redis.conf). Valkey calls them primaryauth and primaryuser and accepts the old names as aliases (Valkey config.c). The replication user needs only PSYNC, REPLCONF and PING on the master (ACL rules for replicas).

# redis.conf on EVERY node, masters and replicas alike
# (Valkey: primaryuser / primaryauth, the old names still work)
masteruser replica-user
masterauth <replica-user password>

# sentinel.conf
sentinel auth-user mymaster sentinel-user
sentinel auth-pass mymaster <sentinel-user password>

With Sentinel, roles change on failover, so the documentation says to set requirepass and masterauth on all instances, masters and replicas, and Sentinel itself needs sentinel auth-user and sentinel auth-pass (Sentinel). A replica without requirepass that gets promoted becomes an open primary; one without masterauth cannot follow the new primary. In our experience the same applies to Redis Cluster: every node needs the same users and replication credentials. More on Sentinel setups in Redis Sentinel high availability.

What changes with many clients and nodes

On one laptop instance, changing a password is a single command. On a production fleet with dozens of services, hundreds of connections and several nodes:

# 1. add the new password, the old one keeps working
ACL SETUSER app >NEW_SECRET

# 2. roll out NEW_SECRET to every client, wait until ACL LOG is quiet

# 3. remove the old password
ACL SETUSER app <OLD_SECRET
ACL SAVE

Key takeaways

Redis Valkey Errors Security ACL
Work with us

Locking down Redis without breaking clients?

We roll out ACL users and passwords across replicas, Sentinel and Cluster, rotate secrets without downtime and find the clients that still connect without credentials.

Get in touch More from the blog