cfl
cfl

Reputation: 1049

Ready check failed: NOAUTH Authentication required

When I tried to use adapter: 'redis' it told me to install socket.io-redis version 0.14. I did that and have entered in all the info into the session.js file:

module.exports.session = {
   adapter: 'socket.io-redis'
   host: '10...',
   port: 6379,
   db: 'sails',
   pass: '...',
};

And now when I try run the application I get the following error:

Error: Ready check failed: NOAUTH Authentication required.

I'm not sure why pass: .. is not working? Anything else I should do?

Note: I am using a Google compute instance for redis hosting, I have a firewall rule for allowing access.

Upvotes: 3

Views: 7370

Answers (2)

Garrett Tacoronte
Garrett Tacoronte

Reputation: 599

I did find a solution for my problem. I am not sure how useful it will be for you, since I believe my situation was a little different. I am using sails.js on a bitnami Google cloud compute instance and I am also hosting redis on a seperate bitnami instance, which we have in common. However, I am trying to connect to Redis for the use of Kue. So I did not make any use of my config/session file. We still got the same error though, so the solution was to remove the requiredpass in the redis instance and then with the firewall rules, only allow my server to access the Redis instance.

I believe the root issue is that redis has a second password prompt for any attempt to read/write to data store. So passing the password from the server only logs you in but does not give you access to the data, hense the NOAUTH error. So I believe the requiredpass for the instance is mainly for the client side and server side instances don't need it. This might be me being naive on how to use Redis, but I do not know how else to enter the password to the prompt from a different server. I feel the firewall rules are fine for me for now to keep unwanted traffic out.

If this is what you want to do/try, then the way I did this for Google cloud was ssh into the Redis instance (through your own command line or through the browser one that Google provides. Then edit the /opt/bitnami/redis/etc/redis.conf file with sudo privileges. Find the line that says requiredpass and comment that out by placing a # in front of it. Now to get this to take affect, then you have to restart the server. Bitnami says you can just do this with sudo /opt/bitnami/ctlscript.sh restart redis. However, I was getting an AUTH error. So in order to get around that, I had to force kill the proccess with sudo pkill -9 -f redis-server, then restart it with sudo /opt/bitnami/ctlscript.sh restart redis. This should refresh the config file, update the instance and allow your server to connect without requiring a second prompt password to be entered.

If you have any questions, please let me know and I will try to help as much as possible.

Upvotes: 3

alexey
alexey

Reputation: 1411

You have to specify auth_pass:

   module.exports.session = {
   adapter: 'socket.io-redis'
   host: '10...',
   port: 6379,
   db: 'sails',
   pass: '...',
   auth_pass: redis_url.auth.split(":")[1]
};

UPDATE

From documentation:

password: null; If set, client will run redis auth command on connect. Alias auth_pass (node_redis < 2.5 have to use auth_pass)

Upvotes: 1

Related Questions