Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8859365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:02:36+00:00 2026-06-14T15:02:36+00:00

I can connect my Node app to Redis just fine without a password, but

  • 0

I can connect my Node app to Redis just fine without a password, but when I add a password, nothing I do is right.

Here’s my code right now, taken right from an example:

var redis = require('redis')
  , sio = require('socket.io')
  , RedisStore = sio.RedisStore
  , io = sio.listen();

var port = 6379
  , hostname = 'localhost'
  , password = 'password';

var redisClient = redis.createClient(port, hostname);
redisClient.auth(password, function (err) { if (err) throw err; });

var redisSubscriber = redis.createClient(port, hostname);
redisSubscriber.auth(password, function (err) { if (err) throw err; });

io.set('store', new RedisStore({ redisPub: redisClient, redisSub: redisSubscriber, redisClient: redisClient }));

On running the app, I get this stack trace:

/home/eric/christmas/sockets/node_modules/socket.io/node_modules/redis/index.js:506
                throw callback_err;
                      ^
Error: Ready check failed: ERR operation not permitted
    at RedisClient.on_info_cmd (/home/eric/christmas/sockets/node_modules/socket.io/node_modules/redis/index.js:319:35)
    at Command.RedisClient.ready_check.send_anyway [as callback] (/home/eric/christmas/sockets/node_modules/socket.io/node_modules/redis/index.js:367:14)
    at RedisClient.return_error (/home/eric/christmas/sockets/node_modules/socket.io/node_modules/redis/index.js:502:25)
    at RedisReplyParser.RedisClient.init_parser (/home/eric/christmas/sockets/node_modules/socket.io/node_modules/redis/index.js:262:14)
    at RedisReplyParser.EventEmitter.emit (events.js:93:17)
    at RedisReplyParser.send_error (/home/eric/christmas/sockets/node_modules/socket.io/node_modules/redis/lib/parser/javascript.js:266:14)
    at RedisReplyParser.execute (/home/eric/christmas/sockets/node_modules/socket.io/node_modules/redis/lib/parser/javascript.js:125:22)
    at RedisClient.on_data (/home/eric/christmas/sockets/node_modules/socket.io/node_modules/redis/index.js:478:27)
    at Socket.<anonymous> (/home/eric/christmas/sockets/node_modules/socket.io/node_modules/redis/index.js:79:14)
    at Socket.EventEmitter.emit (events.js:93:17)

The line generating this is the final one – if I comment out the attempt to set the RedisStore, I do not get any errors.

I’m sure the password is right (I can verify it in redis-cli, and if I change the password to be wrong I can verify that the auth callbacks don’t fire). This code also works if I remove the password and comment out the two auth lines.

All of the working examples on blog posts and docs and the like show that this should work, and I don’t know why mine isn’t. I don’t know which part of the stack to look at.

Here’s what the redis-cli monitor looks like when I run the code above:

1353227107.912512 [0 127.0.0.1:56759] "auth" "password"
1353227107.912719 [0 127.0.0.1:56758] "auth" "password"
1353227107.913470 [0 127.0.0.1:56759] "info"
1353227107.913639 [0 127.0.0.1:56758] "info"

And here’s what redis-cli monitor shows if I turn off the password, comment out the auth lines above, and successfully run the app:

1353227252.401667 [0 127.0.0.1:56771] "info"
1353227252.402020 [0 127.0.0.1:56770] "info"
1353227252.402131 [0 127.0.0.1:56769] "info"
1353227252.402423 [0 127.0.0.1:56768] "info"
1353227252.402611 [0 127.0.0.1:56767] "info"
1353227252.406254 [0 127.0.0.1:56770] "subscribe" "handshake"
1353227252.406287 [0 127.0.0.1:56770] "subscribe" "connect"
1353227252.406314 [0 127.0.0.1:56770] "subscribe" "open"
1353227252.406321 [0 127.0.0.1:56770] "subscribe" "join"
1353227252.406326 [0 127.0.0.1:56770] "subscribe" "leave"
1353227252.406337 [0 127.0.0.1:56770] "subscribe" "close"
1353227252.406354 [0 127.0.0.1:56770] "subscribe" "dispatch"
1353227252.406372 [0 127.0.0.1:56770] "subscribe" "disconnect"

The successful (passwordless) connection makes 5 “info” commands, and my unsuccessful (passworded) command makes 2 – and then dies on a call to an “on_info_cmd” method.

Can anyone make sense of this? Thanks for any help you can give.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:02:38+00:00Added an answer on June 14, 2026 at 3:02 pm

    I solved this by passing the redis module itself as an option to the RedisStore constructor.

    io.set('store', new RedisStore({redis: redis, redisPub: redisClient, redisSub: redisSubscriber, redisClient: redisClient }));
    

    This was necessary for the client objects to pass the instanceof RedisClient test and not be re-initialized without a password. Apparently, when RedisStore re-requires the redis module, redis clients created with the createClient method are members of some new class or something.

    I figured this out by looking at a related issue someone was having on socket.io’s issue #808.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To test if i can connect to my database, I execute the following code
In code igniter, you can connect database and make queries in controller like: $this->db->query(Your
I'm using socket.io and Redis together with node.js - code below. I'm definitely being
I'm trying to create a server app in node.js, where multiple clients connect, and
I'm using node, express and connect for a simple app and have basic HTTP
I'm trying to connect to a node.js based TLS server from my Android app.
I am using Connect on node.js with connect-redis as session store. Is there a
I'm newbie about node.js and mongodb. I have already installed mongodb, but I can't
My app: Node.js, Express, some middleware including connect-assets and express.static. All running on local
I am using node.js connect framework to listen to upgrade event. I can use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.