node-redis: NOAUTH Authentication required error even with password set
- Version: Node Redis 2.8.0 / Redis 4.0.9
- Platform: NodeJS 8.11.3 on Heroku-16 stack
- Description: I’m connecting to redis and passing the following options object which has the password but node_redis always throws a NOAUTH error
options = {
'auth_pass': nconf.get('redis_pass')[nodeEnv],
'no_ready_check': true,
};
If I connect to redis with the redis-cli tool it works just fine but for some reason i’ve been getting this error
29 Jun 2018 11:06:14.626136 <190>1 2018-06-29T18:06:14.346750+00:00 app web.1 - - ReplyError: NOAUTH Authentication required
at new Command (/app/node_modules/redis/lib/command.js:12:22)
at RedisClient.info (/app/node_modules/redis/lib/individualCommands.js:169:39)
at RedisClient.ready_check (/app/node_modules/redis/index.js:534:10)
at RedisClient.on_connect (/app/node_modules/redis/index.js:428:14)
at Socket.<anonymous> (/app/node_modules/redis/index.js:268:14)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
at Socket.emit (events.js:208:7)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1173:10)Exception
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 11
- Comments: 18 (6 by maintainers)
I’m also having this issue here.
Error message:
ReplyError: NOAUTH Authentication required.Version: Node Redis 3.0.0 / Redis 5.0.8
To everyone here. I had the same problem when I tried to use a long password generated by the Linux random password generator. When I changed the password to something much shorter, everything worked fine. This may be a problem with this Node.JS package itself, because the long password did work if I went into redis-cli and used it with the auth command. However, the exact same password did not work when passed in during the createClient() method, regardless of what method variant I used (i.e. - full URL, or “auth_pass”/“password” in options block, or redisClient.auth() method - they all failed with the long password).
One more possible resolution to add to the list. I was getting this error and it took me an embarrassingly long time to remember that I’m using Bull which is a Redis based queue. I’m also using Redis elsewhere in the application where I had been passing in the connection information, but forgot about Bull and was getting exactly these errors on the console.
So I guess one other thing to check is if anything else in your app is using Redis and might be firing back these errors.
edit If it is Bull that is causing this error for you, you must use
passwordin your redis connection object, notauth_pass.@mariothedev be SUPER careful with that. Without proper firewalls, your redis is wide open with using that
bindsetting.If using Docker, edit your redis.conf’s file network setting:
That fixed it for me.
@stockholmux - thanks for letting me know 😃