How to fix WRONGPASS invalid username-password pair in Redis

RedisINTERMEDIATEHIGHUpdated Dec 29, 2025ยท 495 views

Redis rejected your authentication credentials. This occurs when you provide an incorrect password, wrong username, or use an invalid credential format when connecting to a Redis instance with ACL (Access Control List) authentication enabled.

Quick fix

Fixes WRONGPASS invalid username-password pair

redis-cli -a your-password
redis-cli -h 127.0.0.1 -p 6379 -a your-password
  1. Verify your password is correct
  2. Check the authentication format for your Redis version
  3. URL-encode special characters in your password
  4. Update your application connection string
redis โ€” error
redis-cli -a your-password
redis-cli -h 127.0.0.1 -p 6379 -a your-password
WRONGPASS invalid username-password pair

What this error means

The WRONGPASS invalid username-password pair error indicates that your Redis server rejected the authentication credentials you provided. In Redis 6.0+, this error is typically related to the ACL (Access Control List) system, which manages user-based authentication. Unlike the simpler NOAUTH error that occurs when no credentials are provided, WRONGPASS means credentials were sent but they don't match what the server has configured. This is a security measure that prevents unauthorized access to your Redis data.

Typical symptoms

  • Connection attempt fails immediately with WRONGPASS error
  • Redis CLI commands fail even with password flag specified
  • Application cannot establish a connection to Redis after credentials are provided
  • Error message appears after attempting the first command or during connection handshake
  • Credentials work on one Redis instance but not another

Common causes

  1. Password is incorrect or does not match the server's requirepass or ACL user password
  2. Username is incorrect or the user does not exist in the ACL configuration
  3. Credentials use invalid format for the authentication method (e.g., wrong delimiter)
  4. Special characters in password are not properly URL-encoded in the connection string
  5. Upgrading Redis client library version changed authentication handling behavior
  6. Cloud provider recently changed or reset authentication credentials
  7. ACL user was recently disabled or deleted on the Redis server
  8. Redis server still using legacy requirepass format while client expects ACL format

How to fix "WRONGPASS invalid username-password pair"

1Verify your password is correct

Double-check that the password you are using matches the password configured on the Redis server. Common mistakes include:

- Copying the password incorrectly (extra spaces, missing characters)
- Using the wrong password if multiple Redis instances exist
- Password changed recently but not updated in your connection string

If you forgot the password, you may need to reset it through your cloud provider's console or directly on the server.

2Check the authentication format for your Redis version

The correct authentication format depends on your Redis server version:

Redis 5.x and earlier (simple password only):

bash
redis-cli -a your-password
redis-cli -h 127.0.0.1 -p 6379 -a your-password

Redis 6.0+ (ACL with default user):
Use 'default' as the username with your password:

bash
redis-cli -u redis://:your-password@127.0.0.1:6379
redis-cli -u redis://default:your-password@127.0.0.1:6379

Redis 6.0+ (ACL with custom user):
Format is username:password:

bash
redis-cli -u redis://your-username:your-password@127.0.0.1:6379
3URL-encode special characters in your password

If your password contains special characters (!, @, #, $, %, etc.), they must be URL-encoded in the connection string:

bash
# Example: password is my@password123!
# URL-encoded: my%40password123%21
redis-cli -u redis://:my%40password123%21@127.0.0.1:6379

Common encodings:
- @ becomes %40
- # becomes %23
- : becomes %3A
- ! becomes %21

Use an online URL encoder if you are unsure of the correct encoding.

4Update your application connection string

Ensure your application is using the correct credentials format:

Node.js (node-redis):

javascript
const redis = require('redis');
const client = redis.createClient({
  url: 'redis://:your-password@127.0.0.1:6379'
  // For custom ACL user: 'redis://username:password@127.0.0.1:6379'
});
await client.connect();

Python (redis-py):

python
import redis
r = redis.Redis(host='127.0.0.1', port=6379, password='your-password')
# For custom ACL user: redis.Redis(host='127.0.0.1', port=6379, username='your-user', password='your-password')

Java (Jedis):

java
Jedis jedis = new Jedis("127.0.0.1", 6379);
jedis.auth("your-password");
// For custom ACL user: jedis.auth("your-user", "your-password");

Go (go-redis):

go
rdb := redis.NewClient(&redis.Options{
    Addr:     "127.0.0.1:6379",
    Password: "your-password",
})
5Check if the user exists in Redis ACL

If using Redis 6.0+ with ACL, verify that the user exists and is enabled:

bash
redis-cli ACL LIST

This command lists all ACL users and their configurations. Look for your username and check if:
- The user exists in the list
- The user has the on flag (enabled)
- The password matches what you are using

To check a specific user:

bash
redis-cli ACL GETUSER your-username

If the user is disabled or missing, you may need to recreate it or contact your Redis administrator.

6Review Redis server logs for authentication failures

Check the Redis server logs to see detailed authentication attempts:

bash
# For systemd-based systems
journalctl -u redis-server -n 50

# For Docker
docker logs -f your-redis-container

# Direct log file (if available)
tail -f /var/log/redis/redis-server.log

Redis logs may show ACL LOG entries that reveal why authentication failed:

bash
redis-cli ACL LOG

This command shows authentication attempts and reasons for failures.

Advanced notes

Redis 6.0+ introduced the ACL system, which is a significant change from the simple requirepass authentication in earlier versions. If you recently upgraded Redis or migrated to a new version, ensure your client library supports ACL authentication. Node.js clients (node-redis) updated their authentication handling in version 3.1.0, so using an older or newer version might cause compatibility issues. For cloud-hosted Redis (AWS ElastiCache, Azure Cache for Redis, Upstash, etc.), credentials may be managed through the provider's console and could change during maintenance windows. If using Upstash or HTTP-based Redis, note that HTTP connections use a different authentication token than the traditional Redis protocol. Token expiration (especially with Entra ID or OAuth-based authentication) can also cause WRONGPASS errors. If you have a Redis cluster, ensure all nodes are properly synchronized with ACL changes, as propagation delays may cause temporary authentication failures on failover.

Frequently asked questions

What does "WRONGPASS invalid username-password pair" mean?
The WRONGPASS invalid username-password pair error indicates that your Redis server rejected the authentication credentials you provided. 0+, this error is typically related to the ACL (Access Control List) system, which manages user-based authentication. Unlike the simpler NOAUTH error that occurs when no credentials are provided, WRONGPASS means credentials were sent but they don't match what the server has configured.
How do I fix "WRONGPASS invalid username-password pair"?
Redis rejected your authentication credentials. This occurs when you provide an incorrect password, wrong username, or use an invalid credential format when connecting to a Redis instance with ACL (Access Control List) authentication enabled.
What causes "WRONGPASS invalid username-password pair"?
Password is incorrect or does not match the server's requirepass or ACL user password Username is incorrect or the user does not exist in the ACL configuration Credentials use invalid format for the authentication method (e.g., wrong delimiter)
Is the "WRONGPASS invalid username-password pair" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading