[WARN] This Redis server's `default` user does not require a password, but a password was supplied
Problem
The url is look like: `redis://user:password@localhost:30000/0` even : `redis://:password@localhost:30000/0` used : `new Redis('redis://user:password@localhost:30000/0')` I know, it's just a warning, but I wanna a clean log. And my redis server needs a password. "ioredis": "^4.19.2" node v12.19.0 redis v6.0.9
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Remove Password from Redis Connection String for Default User
The warning occurs because the Redis server's default user does not require a password, but a password is being supplied in the connection string. This results in a warning in the logs, indicating a mismatch between the expected authentication method and the provided credentials.
Awaiting Verification
Be the first to verify this fix
- 1
Identify the Correct User Configuration
Check your Redis server configuration to confirm if the default user requires a password. If it does not, you should not supply a password in the connection string.
bashcat /etc/redis/redis.conf | grep requirepass - 2
Update the Connection String
Modify the connection string in your application to remove the password if the default user does not require one. If you need to authenticate, create a new user with a password in your Redis configuration.
typescriptnew Redis('redis://localhost:30000/0') - 3
Create a New User with Password (if needed)
If your application requires authentication, create a new user in Redis with a password. Update your Redis configuration file to include this new user.
bashACL SETUSER newuser on >newpassword - 4
Test the New Configuration
After making changes, restart the Redis server and test the connection using the new user credentials if applicable. Ensure that no warnings appear in the logs.
bashredis-cli -u redis://newuser:newpassword@localhost:30000
Validation
Check the Redis logs after making the changes to ensure that the warning about the default user not requiring a password does not appear. Additionally, confirm that your application connects successfully without errors.
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep