NOAUTH error
The server requires a password, and the connection hasn't authenticated.
Redis returns this error when the server requires a password, but your connection hasn't sent one yet. Until the connection authenticates, the server refuses almost every command, even PING.
NOAUTH Authentication required.
If the first command is HELLO, the error also says how to authenticate in the same command: NOAUTH HELLO must be called with the client already authenticated, otherwise the HELLO <proto> AUTH <user> <pass> option can be used to authenticate the client and select the RESP protocol version at the same time.
In client libraries
| Client library | Exception or error type | Message |
|---|---|---|
| redis-py | AuthenticationError |
Authentication required. |
| Jedis | JedisAccessControlException |
NOAUTH Authentication required. |
| node-redis | SimpleErrorTest with err.message.startsWith('NOAUTH') |
NOAUTH HELLO must be called with the client already authenticated, otherwise the HELLO <proto> AUTH <user> <pass> option can be used to authenticate the client and select the RESP protocol version at the same timenode-redis sends HELLO when it connects, so connect() raises this error, and the message names HELLO. |
| Lettuce The async API wraps the exception in an ExecutionException (get()) or a CompletionException (join()). |
RedisConnectionException |
Unable to connect to <host>/<unresolved>:<port>The cause is a RedisCommandExecutionException with the message NOAUTH HELLO must be called with the client already authenticated…. Lettuce authenticates and sends HELLO when it connects, so connect() raises this error. |
| go-redis | redis.ErrorTest with redis.IsAuthError(err) |
NOAUTH Authentication required. |
| ioredis | ReplyErrorTest with err.message.startsWith('NOAUTH') |
NOAUTH Authentication required. |
| StackExchange.Redis NRedisStack uses StackExchange.Redis, so it raises the same exceptions. The sync and async APIs raise the same exceptions. |
RedisConnectionException |
It was not possible to connect to the redis server(s). There was an authentication failure; check that passwords (or client certificates) are configured correctly: (RedisServerException) NOAUTH Returned - connection has not yet authenticatedStackExchange.Redis authenticates when it connects, so Connect raises this error. |
| Predis | Predis\Response\ServerExceptionTest with $e->getErrorType() === 'NOAUTH' |
NOAUTH Authentication required. |
| redis-rb | Redis::CommandError |
NOAUTH HELLO must be called with the client already authenticated, otherwise the HELLO <proto> AUTH <user> <pass> option can be used to authenticate the client and select the RESP protocol version at the same time (redis://<host>:<port>)redis-rb sends HELLO when it connects, so the message names HELLO. |
| redis-rs The sync and async APIs raise the same errors. |
ErrorKind::ExtensionTest with err.code() == Some("NOAUTH") |
"NOAUTH": Authentication required. |
Example
> GET mykey
(error) NOAUTH Authentication required.
> AUTH <password>
OK
> GET mykey
"value"
How to fix it
Authenticate before you send other commands. Use AUTH with a password. If the server has access control list (ACL) users, give a username and a password: AUTH <username> <password>.
- In
redis-cli, give the credentials when you connect:redis-cli --user <username> --pass <password>. To type the password at a prompt instead, use--askpass. - In a client library, set the password, and the username if you have one, in the connection options. Most libraries also accept them in a connection URL:
redis://<username>:<password>@<host>:<port>.
If you sent a password and got a different error, see WRONGPASS. For more about passwords and users, see Authentication.