Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection to password-protected redis instance doesn't work #4

Closed
MarcosBL opened this issue Dec 4, 2011 · 6 comments
Closed

Connection to password-protected redis instance doesn't work #4

MarcosBL opened this issue Dec 4, 2011 · 6 comments

Comments

@MarcosBL
Copy link

MarcosBL commented Dec 4, 2011

If i delete the password protection in my redis instance everything works fine, but as i use it for other software, i really need it to be password protected.

I tried a

redisClient.on("connect", function (err){ redisClient.auth("PASSWORD", function (err) { }); });

in initRedis() but it's my first node-approach and i couldn't make it work :)

@joemccann
Copy link
Owner

Sounds like you are having a redis issue and not a dillinger issue.

I would have a look at the node redis client and see what they do for password protected redis instances.

It appears you just need to pass it an options hash:

https://github.com/bnoguchi/redis-node

@MarcosBL
Copy link
Author

MarcosBL commented Dec 5, 2011

As for redis.conf , it's a simple:

requirepass PLAIN_TEXT_PASSWORD

My code looks like this:

function initRedis(){
  redisClient = redis.createClient();
  redisClient.on("error", function (err) {
      console.log("Redis connection error to " + redisClient.host + ":" + redisClient.port + " - " + err);
  });
  redisClient.on("connect", function (err){ console.log("Connection done"); redisClient.auth("PASSWORD", function (err) { }); });
  redisClient.on("reconnect", function (err){ console.log("Re-Connection done"); redisClient.auth("PASSWORD", function (err) { }); });
  RedisStore = require('connect-redis')(express);
}

And the error looks like this

/home/nodejs/dillinger # node app.js
Connection done
Redis connection error to 127.0.0.1:6379 - Ready check failed: Error: Error: ERR operation not permitted

Maybe related to https://github.com/mranney/node_redis/issues/search?q=auth

@MarcosBL
Copy link
Author

MarcosBL commented Dec 5, 2011

I'm lost or the dependency is http://github.com/mranney/node_redis instead of https://github.com/bnoguchi/redis-node ?

That's the one (version 0.6.7) listed under dillinger/node_modules/redis/package.json

@joemccann
Copy link
Owner

Oops sorry about that, yeah it is the one listed in the package.json. Nonetheless, the redis client module is the issue, not Dllinger. =)

@joemccann
Copy link
Owner

did you get this sorted out?

@joemccann
Copy link
Owner

Closing as my assumption is this has been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants