ioredis icon indicating copy to clipboard operation
ioredis copied to clipboard

[WARN] This Redis server's `default` user does not require a password, but a password was supplied

Open mougis opened this issue 3 years ago • 10 comments

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

mougis avatar Dec 05 '20 13:12 mougis

Issue is still presented

rooton avatar Feb 22 '22 12:02 rooton

According to the logs, I think the cause is a password is provided to the server whereas the default user doesn't have a password set. Does removing the password part from the URL or the config fix the issue?

luin avatar Feb 22 '22 12:02 luin

The default user has a password in the redis config file. The log appeared with an user and the default user. Removing the password from URL doesn't enable connection. Removing it from config does the thing but a password is wanted for the redis server config.

mougis avatar Feb 22 '22 19:02 mougis

Hey @lukats 👋 ,

Thanks for the follow-up! However, I still don't get it. The warning [WARN] This Redis server's default user does... is printed whenever ioredis receives replies from the server like ...without any password configured for the default user.

Do you have reproducible steps for it so I can test it on my side?

luin avatar Feb 28 '22 03:02 luin

redis.conf.template:

requirepass {PASSWORD}

dockerfile:

FROM redis:6.0-alpine
ARG password
ENV PASSWORD=$password
COPY redis.conf.template /
CMD sed -e "s/{PASSWORD}/$PASSWORD/g" < redis.conf.template 1> /usr/local/etc/redis/redis.conf && redis-server /usr/local/etc/redis/redis.conf

index.js:

const Redis = require("ioredis");
new Redis(`redis://:${process.env.PASSWORD}@127.0.0.1:6379/0`);

docker build --build-arg password=foobared -f dockerfile -t redis-bar
docker run  -p 127.0.0.1:6379:6379 redis-bar
PASSWORD=foobared node index.js

mougis avatar Feb 28 '22 20:02 mougis

ioredis 5.0.6 Still getting this, [WARN] This Redis server's 'default' user does not require a password, but a password was supplied I am using sentinel, is this the reason? requirepass and masterauth these two parameters set in redis.conf same sentinel.conf. While making connection, providing only sentinelPassword won't help, you have to add password parameter in options.

amitofile avatar Jun 20 '22 20:06 amitofile

Got same issue.

revskill10 avatar Mar 07 '23 21:03 revskill10

any idea how to fix this?

hungnt612 avatar Aug 30 '23 10:08 hungnt612

any fix for it ?

masterwishx avatar Apr 01 '24 18:04 masterwishx

se logro solucionar? [WARN] This Redis server's 'default' user does not require a password, but a password was supplied

nadris avatar Apr 04 '24 00:04 nadris