Closed jtomaszon closed 9 years ago
I just need to add the 'auth_pass' on the options: I didn't make any pull request because I'm not a developer hehehe
client = Redis.createClient(info.port, info.hostname, {'auth_pass': info.auth})
That is really interesting. The most commonly used use case for this is on Heroku with one of the redis addons, and they definitely use authentication.
I'm wondering, could you let me know which environment variable you are using? I'm also wondering if you could share the string you used with the username, password, etc REDACTED. I was mostly wondering if the auth wasn't getting parsed correctly.
For reference, you can see authentication being parsed and used here: https://github.com/hubot-scripts/hubot-redis-brain/blob/master/src/redis-brain.coffee#L56-L62
@technicalpickles this fixed it for me when using a redistogo heroku server.
client = Redis.createClient(info.port, info.hostname, {no_ready_check: true})
By the way
$ Url.parse REDISTOGO_URL
{ protocol: 'redis:',
slashes: true,
auth: 'redistogo: 111111111111111111',
host: 'sub.redistogo.com:10000',
port: '10000',
hostname: 'sub.redistogo.com',
hash: null,
search: null,
query: null,
pathname: null,
path: null,
href: 'redis://redistogo:111111111111111111@sub.redistogo.com:10000'
}
$ Url.parse(REDISTOGO_URL).auth.split(":")[1]
'111111111111111111'
Yup, trying to get the brain to connect to a local instance of a redis-server w/ password will not work.
Throws:
INFO Slack client now connected
INFO Discovered redis from REDIS_URL environment variable
ERROR Error: Ready check failed: NOAUTH Authentication required.
REDIS_URL=redis://password@localhost:6379
redis.conf
: requirepass password
Everything else default.
I stumbled across the exact problem when I was trying to get it to work with Redis Labs.
You'll need to set the username and password (i.e. dummyuser:password@...
). It will not parse the auth
portion of the URL otherwise (thus, throwing NOAUTH Authentication required
).
See: https://github.com/hubot-scripts/hubot-redis-brain/blob/master/src/redis-brain.coffee#L56-L62
Hope that helps.
Thanks @MrSaints, that works for me.
This should be fixed in v0.0.3 . Please give that a try, and let me know if you are still having problems :heart:
bin/hubot add line: export REDIS_URL=redis://user:password@localhost:6379
Hi all, I just realize that redis-brain is not connecting to Redis password.