rq worker does not honor REDIS_PASSWORD setting

Created on 31 Mar 2017  Â·  8Comments  Â·  Source: rq/rq

I have a settings module to configure the worker, and I'm using -c to pass this module to 'rq worker'.

All settings work fine, including the REDIS_URL and QUEUES settings. The REDIS_PASSWORD seems to be ignored though, as the worker fails with

redis.exceptions.ResponseError: NOAUTH Authentication required.

I have listened for incoming connections on my redis server with 'MONITOR', and can confirm that rq never sends the AUTH command, even with the password configured.

$ docker exec -ti {redacted} pip3 list | grep rq
rq (0.7.1)

Most helpful comment

Why don't you put it into REDIS_URL?

REDIS_URL = 'redis://:password@localhost:6379/1'

There are two possible ways to define a Redis client: either use REDIS_URL, or REDIS_HOST+REDIS_PORT+ REDIS_DB+REDIS_PASSWORD, so you probably shall stick to one of them.

You can also check redis-py docs for reference.

# from url
r = StrictRedis.from_url(redis_url)
# from arguments
r = StrictRedis(host=host, port=port, db=db, password=password, **kwargs)

All 8 comments

Could you please open a PR for this?

I'm not sure I follow - I don't have a patch, how can I open a PR without one?

was this ever resolved?

No, please open a PR if you want to see this addressed. I'm hoping to cut a release end of this month.

On Apr 23, 2017, 9:17 PM +0700, Sankaet Pathak notifications@github.com, wrote:
>

was this ever resolved?

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub (https://github.com/nvie/rq/issues/809#issuecomment-296446375), or mute the thread (https://github.com/notifications/unsubscribe-auth/AALg8nBoAa8kkDWe_1YhMTK1TLuzytnWks5ry12SgaJpZM4MwELl).

Why don't you put it into REDIS_URL?

REDIS_URL = 'redis://:password@localhost:6379/1'

There are two possible ways to define a Redis client: either use REDIS_URL, or REDIS_HOST+REDIS_PORT+ REDIS_DB+REDIS_PASSWORD, so you probably shall stick to one of them.

You can also check redis-py docs for reference.

# from url
r = StrictRedis.from_url(redis_url)
# from arguments
r = StrictRedis(host=host, port=port, db=db, password=password, **kwargs)

Shall we close this issue as resolved as @katichev explained?

If someone's willing to make a PR for this, I'm willing to accept it :). It's good to give users the flexibility to specify Redis password via the password argument. Afterall, it's supported by the Redis library.

I just added some tests for this and it seems that the CLI does pass the options to the connection. Is it something I'm missing?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Houd1ny picture Houd1ny  Â·  4Comments

kitsuyui picture kitsuyui  Â·  4Comments

cw1427 picture cw1427  Â·  4Comments

mitakuye picture mitakuye  Â·  7Comments

yishenggudou picture yishenggudou  Â·  8Comments