Error noauth authentication required redis

Redis NOAUTH authentication required – How we fix it? Are you stuck with the Redis NOAUTH authentication required error? We’ll help you fix it. Usually, this error occurs when the Redis has been configured with a password. At Bobcares, we often receive requests to fix this error as part of our Server Management Services. […]

Содержание

  1. Redis NOAUTH authentication required – How we fix it?
  2. About Redis
  3. How we fix Redis NOAUTH authentication required error?
  4. Conclusion
  5. PREVENT YOUR SERVER FROM CRASHING!
  6. NOAUTH Authentication required error even with password set #1359
  7. Comments
  8. Redis NOAUTH Authentication Required
  9. Introduction to Redis NOAUTH Authentication Required
  10. Key Takeaways
  11. Error of NOAUTH Authentication Required
  12. Redis NOAUTH Authentication Required Error in Password Set
  13. Server Configuration
  14. Q1. Why noauth authentication required error will occur in the redis database?
  15. Q2. Which command we are using to set the password for authentication in redis?
  16. Q3. Which command we are using to authenticate with the redis database server?
  17. Conclusion
  18. Recommended Articles

Redis NOAUTH authentication required – How we fix it?

Are you stuck with the Redis NOAUTH authentication required error? We’ll help you fix it.

Usually, this error occurs when the Redis has been configured with a password.

At Bobcares, we often receive requests to fix this error as part of our Server Management Services.

Today, let’s have a look at how our Support Engineers fix this error for our customers.

About Redis

Before getting detailed into the error, let’s have a look at Redis.

Redis is one of the popular in-memory data structure servers. We can use it as a database, cache and so on.

It gains popularity due to its speed and the variety of use cases it enables. But, it often throws some troublesome errors.

Let’s discuss how our Support Engineers fix these errors easily.

How we fix Redis NOAUTH authentication required error?

Usually, this error occurs when the Redis server has a password configured.

If we set the requirepass directive, it will cause the server to require password authentication.

Therefore, we need to issue the AUTH command before any other command while using redis-cli.

Otherwise, we will get the NOAUTH Authentication required error. It is explicitly written in the redis.conf file as follows.

Similarly, we can use the redis-cli with the -a switch. And, following it, we should give our password.

Recently, one of our customers approached us with this error. He tried to connect to his Redis server using the redis-cli command.

But, he got the Redis authentication requirement error. He had Redis version 2.8.4 and server hosted on AWS.

As discussed above, this error usually occurs when Redis has a password set.

Customer checked the Redis config file at etc/redis/redis.conf. But, he could find no password set for Redis.

Our Support Engineers checked the error in detail. And, on checking, we found AWS scanned and connected to all public Redis.

Also, it ran the CONFIG SET REQUIREPASS that caused the error.

So, to fix this error, we restarted Redis to restore the configuration file back to normal. For that, we ran the below command.

Also, we can resolve the error by blocking the port 6379 for the public.

[Need more assistance to fix this error?- We’re available 24/7.]

Conclusion

In short, the error Redis NOAUTH authentication required occurs when the Redis has a password set. In today’s article, we discussed how our Support Engineers resolve this error easily for our customers.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

Источник

NOAUTH Authentication required error even with password set #1359

  • 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

If I connect to redis with the redis-cli tool it works just fine but for some reason i’ve been getting this error

The text was updated successfully, but these errors were encountered:

Hard to tell from just your options object but this is pretty standard and is known good. If I had to bet you’re maybe connecting to the wrong redis server or nconf.get(‘redis_pass’)[nodeEnv] is supplying the wrong password (or maybe undefined).

Can you supply more of your code?

Hi, I have the same issue and I pass the password as a plain text and it stills send me the same error. In fact I only uncomment the line requirepass in the default redis.conf file, as I show in the following code:

I make this configuration in my local machine in order to make the tests, but I am still get the same error:

Here is my code that I apply in my nodejs server:

The funny thing is that when I start the server, the key «foo» is saved in my redis database with the value «bar», but my app is crash and I can’t do anything to interact with it.

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).

Hi @roschler, would you like to provide your code please. The truth is that I tried your suggestion and I am still having the same issue, not even with a password like ‘123’. I try with all the ways that are in the documentation and nothing different. I know that this can be bother to you but the true is that I don’t have other choice. In advance thanks a lot.

@maooricio I’m 99.999% sure this is a misconfiguration at the server or the wrong server. Looking at your code from Oct 2018, I would try using a randomly generated key and echoing with MONITOR in redis-cli .

I think that @roschler is having an entirely different issue (quoting?)

I still have this issue happened with me I have tried so many differents ways to connect with my redis db but password authntication failed for user

@nicollasmatheus what is your error?

I’m having the same error. I’m confident all the setting parameters are correct. I’ve tried all 3 methods and same error in all of them.

After settings NODE_DEBUG=redis

I’m using docker-compose

and I can access to redis using cli redis-cli -h 127.0.0.1 -p 6379 -a ‘mypassword’

Источник

Redis NOAUTH Authentication Required

Redis Tutorial

Introduction to Redis NOAUTH Authentication Required

Redis noauth authentication required is an error that occurs when attempting to authenticate with the redis server. The redis connection is secured in such a way that any client making a connection must authenticate before executing any command. If the user does not authenticate with the server, the redis server returns an error stating that noauth authentication is required for connecting to the database server.

While securing the redis server we need to set the password of the redis user in the redis configuration file. By default, the authentication property for the redis database server is blank, to authenticate with the database server we need to set the same in the configuration file. We can change the property of the configuration file by executing the requirepass command by login into the redis database server.

At the time of setting a password on the redis database server, if any one client runs the command without using the authentication, then it will return the error i.e. noauth authentication required into our user’s dashboard. To authenticate with the database, we must use the auth command and enter the correct password when connecting to the redis database server. We are using the auth command with the specified password that we defined with the config authentication command.

Web development, programming languages, Software testing & others

Key Takeaways

  • The Redis noauth authentication required error occurs when we configure authentication on the Redis server without providing the password.
  • We can solve this issue of noauth authentication by providing the correct password of the user that we set using the auth command.

Error of NOAUTH Authentication Required

When dealing with the issue of noauth authentication required, we must require the correct password. In the example below, we can see that when we do not authenticate with the server, it displays an error. In the following example, we can see that when we execute the ping command, it displays the error as follows.

Command:

Output:

We can resolve the redis noauth authentication required to issue by authenticating with the database server. We are authenticating with the correct password in the example below. When we authenticate with the correct password, we can run the following command. We use the correct password, Test@123, with the auth command, and then we execute multiple commands on the redis server.

Command:

Output:

To resolve the issue of noauth authentication password, we can also edit the configuration file to disable the database server’s master authentication. We can see in the figure below that we have disabled user authentication by disabling the requirepass parameter. We must restart the database server after disabling this user. We can connect to the database server and execute the specified command after restarting the database server.

In the above example, we can see that we have disabled the requirepass parameter, after disabling the requirepass parameter we are able to execute the command as follows.

Command:

Output:

Redis NOAUTH Authentication Required Error in Password Set

When setting a password with the requirepass parameter in Redis, we face the issue of noauth authentication required. When we set the password, we must authenticate with the password we specified. The following example demonstrates how to set the authentication password in a Redis database. We are setting the authentication password as Redis@123 as follows.

Command:

Output:

While setting the authentication password it is not applied to the current connection. We can execute the command for the current connection after setting the password using requirepass method. The below example shows that requirepass command is not applicable to the current connection. In the following example, we executed the requirepass command first, followed by multiple commands, but it will allow us to execute multiple commands.

Command:

Output:

At the time of authenticating redis database, we need to enter the correct password. In the below example, we are using an incorrect password to authenticate with the database then it will show that we are using the wrong password for database authentication.

Command:

Output:

In the below example, we are entering the correct password so we can be able to execute the command as follows. We are entering passwords by using auth command.

Command:

Output:

Server Configuration

At the time of configuring the server with the requirepass parameter then we need to authenticate the user with a specified password which we have defined in the server configuration file. The below example shows that how we can configure the password into the configuration file as follows.

Command:

Output:

After setting the password in the configuration file, we need to take restart the database server. After restarting the server, we need to enter the specified password. We cannot execute the command without entering the password as follows.

Command:

Output:

To solve the issue, we are commenting the requirepass parameter into the redis configuration file. In the below example, we are commenting on the parameter as follows.

Command:

Output:

After disabling the configuration and taking the restart of the server, now we are able to execute commands without using any authentication error as follows.

Command:

Output:

Given below are the FAQs mentioned:

Q1. Why noauth authentication required error will occur in the redis database?

Answer: The noauth authentication required error occurs in the Redis database when we set the password for user authentication and then execute the command without authenticating the user.

Q2. Which command we are using to set the password for authentication in redis?

Answer: We are using the config set requirepass command to set the password of user authentication in redis.

Q3. Which command we are using to authenticate with the redis database server?

Answer: We are using auth command with the correct password to authenticate with the redis database server.

Conclusion

To secure the redis server, we must enter the redis user’s password into the redis configuration file. The authentication property for the Redis database server is set to blank by default; to authenticate with the database server, we must set it in the configuration file. The error “Redis noauth authentication required” occurs when attempting to authenticate with the redis server.

Recommended Articles

This is a guide to Redis NOAUTH Authentication Required. Here we discuss the introduction, how do we fix the error, server configuration and FAQs. You may also have a look at the following articles to learn more –

Источник

Introduction to Redis NOAUTH Authentication Required

Redis noauth authentication required is an error that occurs when attempting to authenticate with the redis server. The redis connection is secured in such a way that any client making a connection must authenticate before executing any command. If the user does not authenticate with the server, the redis server returns an error stating that noauth authentication is required for connecting to the database server.

While securing the redis server we need to set the password of the redis user in the redis configuration file. By default, the authentication property for the redis database server is blank, to authenticate with the database server we need to set the same in the configuration file. We can change the property of the configuration file by executing the requirepass command by login into the redis database server.

At the time of setting a password on the redis database server, if any one client runs the command without using the authentication, then it will return the error i.e. noauth authentication required into our user’s dashboard. To authenticate with the database, we must use the auth command and enter the correct password when connecting to the redis database server. We are using the auth command with the specified password that we defined with the config authentication command.

Redis NOAUTH Authentication Required

Key Takeaways

  • The Redis noauth authentication required error occurs when we configure authentication on the Redis server without providing the password.
  • We can solve this issue of noauth authentication by providing the correct password of the user that we set using the auth command.

Error of NOAUTH Authentication Required

When dealing with the issue of noauth authentication required, we must require the correct password. In the example below, we can see that when we do not authenticate with the server, it displays an error. In the following example, we can see that when we execute the ping command, it displays the error as follows.

Command:

PING

Output:

Redis NOAUTH Authentication Required PIng

We can resolve the redis noauth authentication required to issue by authenticating with the database server. We are authenticating with the correct password in the example below. When we authenticate with the correct password, we can run the following command. We use the correct password, Test@123, with the auth command, and then we execute multiple commands on the redis server.

Command:

> AUTH "Test@123"
> PING
> SET key51 val1
> GET key51

Output:

Redis NOAUTH Authentication Required Password

To resolve the issue of noauth authentication password, we can also edit the configuration file to disable the database server’s master authentication. We can see in the figure below that we have disabled user authentication by disabling the requirepass parameter. We must restart the database server after disabling this user. We can connect to the database server and execute the specified command after restarting the database server.

Redis NOAUTH Authentication Required Disable

In the above example, we can see that we have disabled the requirepass parameter, after disabling the requirepass parameter we are able to execute the command as follows.

Command:

> PING
> SET key52 val2
> GET key52

Output:

requirepass parameter

Redis NOAUTH Authentication Required Error in Password Set

When setting a password with the requirepass parameter in Redis, we face the issue of noauth authentication required. When we set the password, we must authenticate with the password we specified. The following example demonstrates how to set the authentication password in a Redis database. We are setting the authentication password as Redis@123 as follows.

Command:

> CONFIG set requirepass "Redis@123"

Output:

Redis NOAUTH Authentication Required Password

While setting the authentication password it is not applied to the current connection. We can execute the command for the current connection after setting the password using requirepass method. The below example shows that requirepass command is not applicable to the current connection. In the following example, we executed the requirepass command first, followed by multiple commands, but it will allow us to execute multiple commands.

Command:

> PING
> SET key53 val3
> GET key53

Output:

Redis NOAUTH Authentication Required Commands

At the time of authenticating redis database, we need to enter the correct password. In the below example, we are using an incorrect password to authenticate with the database then it will show that we are using the wrong password for database authentication.

Command:

> AUTH "Redis@1234"

Output:

incorrect password to authenticate with the database

In the below example, we are entering the correct password so we can be able to execute the command as follows. We are entering passwords by using auth command.

Command:

> PING
> AUTH "Redis@123"
> SET key55 val5
> GET key55

Output:

Redis NOAUTH Authentication Required Correct password

Server Configuration

At the time of configuring the server with the requirepass parameter then we need to authenticate the user with a specified password which we have defined in the server configuration file. The below example shows that how we can configure the password into the configuration file as follows.

Command:

# vi /etc/redis/redis.conf
requirepass Redis@123

Output:

Redis NOAUTH Authentication Required Configure

After setting the password in the configuration file, we need to take restart the database server. After restarting the server, we need to enter the specified password. We cannot execute the command without entering the password as follows.

Command:

# redis-cli
> PING
> AUTH “Redis@123”
> PING
> SET key56 val6
GET key56

Output:

restart of database server

To solve the issue, we are commenting the requirepass parameter into the redis configuration file. In the below example, we are commenting on the parameter as follows.

Command:

# vi /etc/redis/redis.conf
#requirepass Redis@123

Output:

commenting the requirepass parameter

After disabling the configuration and taking the restart of the server, now we are able to execute commands without using any authentication error as follows.

Command:

# redis-cli
> PING
> SET key57 val7
> GET key57

Output:

Redis NOAUTH Authentication Required DIsabling

FAQs

Given below are the FAQs mentioned:

Q1. Why noauth authentication required error will occur in the redis database?

Answer: The noauth authentication required error occurs in the Redis database when we set the password for user authentication and then execute the command without authenticating the user.

Q2. Which command we are using to set the password for authentication in redis?

Answer: We are using the config set requirepass command to set the password of user authentication in redis.

Q3. Which command we are using to authenticate with the redis database server?

Answer: We are using auth command with the correct password to authenticate with the redis database server.

Conclusion

To secure the redis server, we must enter the redis user’s password into the redis configuration file. The authentication property for the Redis database server is set to blank by default; to authenticate with the database server, we must set it in the configuration file. The error “Redis noauth authentication required” occurs when attempting to authenticate with the redis server.

Recommended Articles

This is a guide to Redis NOAUTH Authentication Required. Here we discuss the introduction, how do we fix the error, server configuration and FAQs. You may also have a look at the following articles to learn more –

  1. Redis Get All Keys
  2. Redis GUI
  3. Redis Pubsub
  4. Redis Version

@paulsheldrake

  • 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

@stockholmux

Hard to tell from just your options object but this is pretty standard and is known good. If I had to bet you’re maybe connecting to the wrong redis server or nconf.get('redis_pass')[nodeEnv] is supplying the wrong password (or maybe undefined).

Can you supply more of your code?

@maooricio

Hi, I have the same issue and I pass the password as a plain text and it stills send me the same error. In fact I only uncomment the line requirepass in the default redis.conf file, as I show in the following code:

# use a very strong password otherwise it will be very easy to break.
#
requirepass foobared

# Command renaming.

I make this configuration in my local machine in order to make the tests, but I am still get the same error:

events.js:160
      throw er; // Unhandled 'error' event
      ^
ReplyError: Ready check failed: NOAUTH Authentication required.
    at parseError (/home/mauricio/Documents/lisapp/pos_lisa/node_modules/redis/node_modules/redis-parser/lib/parser.js:193:12)
    at parseType (/home/mauricio/Documents/lisapp/pos_lisa/node_modules/redis/node_modules/redis-parser/lib/parser.js:303:14)

Here is my code that I apply in my nodejs server:

const redisPassword = "foobared" ; 
const ClientRedisApi = redis.createClient({
          host : '127.0.0.1',  
          no_ready_check: true,
          auth_pass: redisPassword,                                                                                                                                                           
});                               

ClientRedisApi.on('connect', () => {   
          global.console.log("connected");
})                              

ClientRedisApi.on('error', err => {       
          global.console.log(err.message)
})                             

ClientRedisApi.set("foo", 'bar');         

ClientRedisApi.get("foo", function (err, reply) {
        global.console.log(reply.toString())
})

The funny thing is that when I start the server, the key «foo» is saved in my redis database with the value «bar», but my app is crash and I can’t do anything to interact with it.

@roschler

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).

@maooricio

Hi @roschler, would you like to provide your code please. The truth is that I tried your suggestion and I am still having the same issue, not even with a password like ‘123’. I try with all the ways that are in the documentation and nothing different. I know that this can be bother to you but the true is that I don’t have other choice. In advance thanks a lot.

@stockholmux

@maooricio I’m 99.999% sure this is a misconfiguration at the server or the wrong server. Looking at your code from Oct 2018, I would try using a randomly generated key and echoing with MONITOR in redis-cli.

I think that @roschler is having an entirely different issue (quoting?)

@carvalhonicollas

I still have this issue happened with me I have tried so many differents ways to connect with my redis db but password authntication failed for user

@stockholmux

@nicollasmatheus what is your error?

@thellimist

I’m having the same error. I’m confident all the setting parameters are correct. I’ve tried all 3 methods and same error in all of them.

      // First method
      const client = redis.createClient(process.env.REDIS_PORT, process.env.REDIS_HOST);
      client.auth(process.env.REDIS_PASSWORD);

      // Second method
      const client = redis.createClient(process.env.REDIS_PORT, process.env.REDIS_HOST, {
        password: process.env.REDIS_PASSWORD
      });

      // Third method
      const client = redis.createClient(uri)

After settings NODE_DEBUG=redis

[0] Sending auth to redis:6379 id 0
[0] Send redis:6379 id 0: *2
[0] $4
[0] auth
[0] $14
[0] mypassword
[0]
[0] Stream connected redis:6379 id 0
[0] Redis: CONNECTED // CUSTOM MESSAGE
[0] Checking server ready state...
[0] Send redis:6379 id 0: *1
[0] $4
[0] info
[0]
[0] Net read redis:6379 id 0
[0] Redis server ready.
[0] on_ready called redis:6379 id 0
[0] Redis: READY // CUSTOM MESSAGE
[0] Stream connected redis:6379 id 1
[0] Checking server ready state...
[0] Send redis:6379 id 1: *1
[0] $4
[0] info
[0]
[0] Net read redis:6379 id 1
[0]
[0] /app/node_modules/redis/lib/command.js:12
[0]         this.error = new Error();
[0]                      ^
[0] ReplyError: NOAUTH Authentication required.
[0]     at new Command (/app/node_modules/redis/lib/command.js:12:22)
[0]     at RedisClient.info (/app/node_modules/redis/lib/individualCommands.js:169:39)
[0]     at RedisClient.ready_check (/app/node_modules/redis/index.js:534:10)
[0]     at RedisClient.on_connect (/app/node_modules/redis/index.js:428:14)
[0]     at Socket.<anonymous> (/app/node_modules/redis/index.js:268:14)
[0]     at Object.onceWrapper (events.js:299:28)
[0]     at Socket.emit (events.js:215:7)
[0]     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1115:10)
[0] npm ERR! code ELIFECYCLE

I’m using docker-compose

  redis:
    container_name: redis
    image: redis:5.0.3-alpine
    restart: always
    env_file: .env
    command: ["redis-server", "--appendonly", "yes", "--requirepass", "${REDIS_PASSWORD}"]
    hostname: ${REDIS_HOST}
    volumes:
      - ~/.mydata/redis:/data
    ports:
      - ${REDIS_PORT}:6379
    networks:
      - my-network

and I can access to redis using cli redis-cli -h 127.0.0.1 -p 6379 -a 'mypassword'

@stockholmux

@thellimist Check out what is happening with redis-cli and MONITOR, especially with your second method.

@thellimist

@stockholmux

export default class Cache {
   static client: any

   static init(): Promise<any> {
      if (Cache.client) {
        logger.error("Client already exists")
        return new Promise((resolve, reject) => { reject() });
      }

      const client = redis.createClient(process.env.REDIS_PORT, process.env.REDIS_HOST, {
        password: process.env.REDIS_PASSWORD
      });
      Cache.client = asyncRedis.decorate(client);
      Cache.client.monitor(function (err, res) {
        logger.info("Entering monitoring mode.");
      });
      Cache.client.set('foo', 'bar');

      Cache.client.on("ready", (e: any) => {
        logger.info(`ready ${e}`);
      });

      Cache.client.on("reconnecting", (e: any) => {
        logger.info(`reconnecting ${e}`);
      });

      Cache.client.on("end", (e: any) => {
        logger.info(`end ${e}`);
      });

      Cache.client.on("warning", (e: any) => {
        logger.info(`warning ${e}`);
      });

      Cache.client.on("monitor", (e: any, res: any) => {
        logger.error(`monitor err: ${e}`);
        logger.info(`monitor res: ${res}`);
      });

      Cache.client.on("connect", () => {
        logger.info("connected");
      });
      Cache.client.on("error", (e: any) => {
        logger.error(`Error: :${e}`);
      });

      return new Promise((resolve, reject) => { resolve() }
   }

and I call await Cache.init(). Response is following:

[0] Sending auth to redis:6379 id 0
[0] Send redis:6379 id 0: *2
[0] $4
[0] auth
[0] $14
[0] mypassword
[0]
[0] Queueing monitor for next server connection.
[0] Queueing set for next server connection.
[0] Stream connected redis:6379 id 0
[0] 2019-12-17 06:49:48 error [server.ts]: connected
[0] Checking server ready state...
[0] Send redis:6379 id 0: *1
[0] $4
[0] info
[0]
[0] Net read redis:6379 id 0
[0] Redis server ready.
[0] on_ready called redis:6379 id 0
[0] Sending offline command: monitor
[0] Send redis:6379 id 0: *1
[0] $7
[0] monitor
[0]
[0] Sending offline command: set
[0] Send redis:6379 id 0: *3
[0] $3
[0] set
[0] $3
[0] foo
[0] $3
[0] bar
[0]
[0] 2019-12-17 06:49:48 info [server.ts]: ready undefined
[0] Net read redis:6379 id 0
[0] 2019-12-17 06:49:48 info [server.ts]: Entering monitoring mode.
[0] 2019-12-17 06:49:48 error [server.ts]: monitor err: 1576565388.385183
[0] 2019-12-17 06:49:48 info [server.ts]: monitor res: set,foo,bar
[0] Stream connected redis:6379 id 1
[0] Checking server ready state...
[0] Send redis:6379 id 1: *1
[0] $4
[0] info
[0]
[0] Net read redis:6379 id 1
[0]
[0] /app/node_modules/redis/lib/command.js:12
[0]         this.error = new Error();
[0]                      ^
[0] ReplyError: NOAUTH Authentication required.
[0]     at new Command (/app/node_modules/redis/lib/command.js:12:22)
[0]     at RedisClient.info (/app/node_modules/redis/lib/individualCommands.js:169:39)
[0]     at RedisClient.ready_check (/app/node_modules/redis/index.js:534:10)
[0]     at RedisClient.on_connect (/app/node_modules/redis/index.js:428:14)
[0]     at Socket.<anonymous> (/app/node_modules/redis/index.js:268:14)
[0]     at Object.onceWrapper (events.js:299:28)
[0]     at Socket.emit (events.js:215:7)
[0]     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1115:10)

Also key/val «foo: bar» is added to redis. So it connects correct initially then for some reason it tries to reconnect but fails. I only call await Cache.init() once in express server.listen.

@stockholmux

@thellimist I think you misunderstand — you need to run MONITOR from redis-cli to properly diagnose these problems. Running it from within your application as above won’t capture the authentication (because it happens before the MONITOR). I would also run it on a completely flushed DB.

Anyway, looking at your code (which I assume is a snippet), it really looks like somewhere else in your code you’re calling redis.createClient without the proper password (maybe another module even). I don’t see the debug logs for reconnection and the id 1 says you’re working on a different network stream.

@thellimist

@stockholmux

The issue was simple as you said. I was using typeorm package and it had a different config file which was not in js/ts file. Node Redis loge did not tell me where it was being called from made it hard to find.

Thanks.

@mariothedev

If using Docker, edit your redis.conf’s file network setting:

That fixed it for me.

@stockholmux

@mariothedev be SUPER careful with that. Without proper firewalls, your redis is wide open with using that bind setting.

@mariothedev

@mayconmesquita

I’m also having this issue here.

Error message: ReplyError: NOAUTH Authentication required.

Version: Node Redis 3.0.0 / Redis 5.0.8

Vfialkin, bestickley, mirkadev, ad-on-is, egee-irl, ktkaushik, CodeStix, ambreeen, irfan, wrreee, and 4 more reacted with thumbs up emoji

@KrishnaPG

Came across this thread looking for an answer to the same problem. Wondering what the solution for this is.

@DataTables

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 password in your redis connection object, not auth_pass.

Понравилась статья? Поделить с друзьями:
  • Error no matching distribution found for pywin32
  • Error not found 0x80070490 при установке sp1
  • Error not enough storage space to install required resources что делать
  • Error not enough space errno 12
  • Error no matching distribution found for pygame