question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ones again - NOAUTH Authentication required

See original GitHub issue

Hi, I’m facing an issue that has been reported multiples times, sorry for opening another ticket, but I tried multiples ways, but still getting the same error of NOAUTH Authentication required.

versions

  • "ioredis": "^4.27.6",
  • Redis 6.2

I creating a redisClient like:


const Redis = require('ioredis');
...
const { redis } = require('../config/config');

const createClient = () => {
  try {
    let redisClient;
    redisClient = new Redis({
      port: redis.redisPort,
      host: redis.redisHost,
      family: 4,
      password: redis.redisPass,
    });
    return redisClient;
  } catch (error) {
    logger.log('error', modules.ServiceModules.REDIS, "Error creating Redis Client", `${error}`);
  }
};

module.exports = {
  createClient,
};

And getting the following error.

{"timestamp":"2021-08-01T00:22:05.375Z","level":"info","hostname":"20a9165bfd1b","service":"BACKEND","module":"EXPRESS","versionService":"1.0.0","versionModule":"1.0","operation":"INITIALIZING SERVER","description":"","operationChannel":"SERVER","entity":"EXPRESS","message":"Server is already listening, on PORT: 4602; and redis pass is = superapassword"}
[ioredis] Unhandled error event: ReplyError: NOAUTH Authentication required.
    at parseError (/usr/src/app/node_modules/redis-parser/lib/parser.js:179:12)
    at parseType (/usr/src/app/node_modules/redis-parser/lib/parser.js:302:14)

Note: I double-check the password and tested using a GUI Client, and the password is the correct one.

Thank u!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
luincommented, Aug 1, 2021

It’s not easy to tell the reason from the code you posted. The error may be returned from a different client. I’d create a minimal reproducible example to see what is the root cause.

0reactions
fulvi0commented, Aug 1, 2021

Thank you for the orientation, found the issue in the code, as u said an orphan instance.

const Redis = require('ioredis');
const redisClient = new Redis({host: config.redis.redisHost, port: 6379});
Read more comments on GitHub >

github_iconTop Results From Across the Web

Redis (error) NOAUTH Authentication required - Server Fault
Setting the requirepass configuration directive causes the server to require password authentication with the AUTH command before sending other commands.
Read more >
Redis raises "NOAUTH Authentication required" error but ...
I found answer for NOAUTH Authentication required error which describes that this error only happens when Redis is set a password, but I...
Read more >
Redis NOAUTH Authentication Required | How do we Fix the ...
Redis noauth authentication required is an error that occurs when attempting to authenticate with the redis server. The redis connection is secured in...
Read more >
Redis NOAUTH authentication required - How we fix it?
Usually, this error occurs when the Redis server has a password configured. If we set the requirepass directive, it will cause the server...
Read more >
Redis - Security - Tutorialspoint
After setting the password, if any client runs the command without authentication, then (error) NOAUTH Authentication required. error will return. Hence, the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found