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

It doesn't work properly in Redis Sentinel environment #411

Open
oopty opened this issue Nov 22, 2022 · 2 comments · May be fixed by #502
Open

It doesn't work properly in Redis Sentinel environment #411

oopty opened this issue Nov 22, 2022 · 2 comments · May be fixed by #502

Comments

@oopty
Copy link

oopty commented Nov 22, 2022

Our project is using Redis Sentinel.

I made url and connected it according to the method guided by this repository, but I couldn't connect to Sentinel.

redis+sentinel://[:password@]host:port[,host2:port2,...][/service_name[/db]][?param1=value1[&param2=value=2&...]]

The reason is that the password is not handed over to the second parameter in the code below. Even if the password is included in redis_url, the redis_sentinel_url library does not interpret and use the password.

_, current_app.redis_conn = from_url((redis_url,)[0])

above code link

I think it should be changed as below.

_, current_app.redis_conn = from_url((redis_url,)[0], sentinel_options={ 'password' : <redis-password>})
@oopty oopty changed the title Redis Sentinel 환경에서 제대로 작동을 하지 않아요 It doesn't work properly in Redis Sentinel environment Nov 22, 2022
@oopty
Copy link
Author

oopty commented Jul 22, 2023

please check my forked repository that had worked properly
https://github.com/oopty/rq-dashboard

@cjproud
Copy link

cjproud commented Feb 19, 2025

Bump, I've had this issue as well. I tried to overwrite app.redis_conn after running rq_dashboard.web.setup_rq_connection(app) by doing the following:

 _, app.redis_conn = from_url(
        app.config["RQ_DASHBOARD_REDIS_URL"][0],
        sentinel_options={"password": app.config["RQ_DASHBOARD_REDIS_PASSWORD"]},
        client_options={"password": app.config["RQ_DASHBOARD_REDIS_PASSWORD"]},
    )

However it appears that this still doesn't work. As @oopty shows above it appears you need to explicitly provide a connection to the Queue class when running the all method:

Queue.all(connection=current_app.redis_conn)

Has anyone else seen this issue? I'm wondering if I'm configuring it incorrectly.

@dot-mike dot-mike linked a pull request Mar 4, 2025 that will close this issue
11 tasks
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

Successfully merging a pull request may close this issue.

2 participants