Redis is configured to require password authentication, but your client connected without providing credentials. This error occurs when the requirepass directive is set on the server and clients attempt to execute commands without first authenticating with the AUTH command.
The NOAUTH Authentication required error indicates that your Redis server has password protection enabled via the requirepass directive, but your client has not provided authentication credentials. Redis refuses to execute any command from unauthenticated clients when authentication is enforced. This is a security feature that prevents unauthorized access to your Redis instance.
Connect to Redis using redis-cli with the -a flag to provide authentication:
redis-cli -h 127.0.0.1 -p 6379 -a your-passwordReplace your-password with your actual Redis password.
If you are already connected to Redis, you can authenticate mid-session using the AUTH command:
AUTH your-passwordAfter successful authentication, you can execute any Redis command.
For most Redis client libraries, include the password in the connection URL:
Node.js (node-redis):
const redis = require('redis');
const client = redis.createClient({
url: 'redis://:[email protected]:6379'
});
await client.connect();Python (redis-py):
import redis
r = redis.Redis(host='127.0.0.1', port=6379, password='your-password')Java (Jedis):
Jedis jedis = new Jedis("127.0.0.1", 6379);
jedis.auth("your-password");Go (go-redis):
rdb := redis.NewClient(&redis.Options{
Addr: "127.0.0.1:6379",
Password: "your-password",
})Check that the Redis server has requirepass configured in /etc/redis/redis.conf:
grep requirepass /etc/redis/redis.confThe output should show something like:
requirepass your-passwordIf requirepass is commented out or absent, no authentication is required. If the password on the server differs from what you are using in your client, update one to match the other.
If changing the password, use a strong, randomly generated password. You can generate one with openssl:
openssl rand -base64 32Update the requirepass setting in redis.conf and restart Redis:
sudo systemctl restart redis-serverThen verify connection with the new password.
In Redis 6.0+, you can use ACLs (Access Control Lists) for more granular authentication with multiple users. While the traditional password-only AUTH still works, ACLs provide better security for multi-tenant or microservices environments. For cloud-hosted Redis (AWS ElastiCache, Azure Cache, Upstash, etc.), authentication is usually enabled by default. Ensure your connection parameters match the provider's format. Some cloud providers require SSL/TLS connections in addition to password authentication. If you accidentally set requirepass and then reset your server, you may need to remove the requirepass line from redis.conf and restart Redis to regain access.
ERR Unbalanced XREAD list of streams
How to fix "ERR Unbalanced XREAD list" in Redis
ERR syntax error
How to fix "ERR syntax error" in Redis
ConnectionError: Error while reading from socket
ConnectionError: Error while reading from socket in redis-py
ERR unknown command
How to fix ERR unknown command in Redis
Command timed out
How to fix 'Command timed out' in ioredis