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

Exception when Celery uses Redis Sentinel #34

Open
K-MTG opened this issue Jan 21, 2021 · 0 comments
Open

Exception when Celery uses Redis Sentinel #34

K-MTG opened this issue Jan 21, 2021 · 0 comments
Assignees

Comments

@K-MTG
Copy link

K-MTG commented Jan 21, 2021

If my celery broker_url is configured for Redis Sentinel (per celery documentation):

app.conf.broker_url = 'sentinel://:password@localhost:26379;sentinel://:password@localhost:26380;sentinel://:password@localhost:26381'
app.conf.broker_transport_options = { 'master_name': "cluster1", sentinel_kwargs': {'password': 'password'} }

I get the following exception:

venv/lib/python3.9/site-packages/celery_singleton/singleton.py", line 106, in apply_async
    task = self.lock_and_run(**run_args)
venv/lib/python3.9/site-packages/celery_singleton/singleton.py", line 119, in lock_and_run
    lock_aquired = self.aquire_lock(lock, task_id)
venv/lib/python3.9/site-packages/celery_singleton/singleton.py", line 51, in aquire_lock
    return self.singleton_backend.lock(lock, task_id, expiry=expiry)
venv/lib/python3.9/site-packages/celery_singleton/singleton.py", line 42, in singleton_backend
    self._singleton_backend = get_backend(self.singleton_config)
venv/lib/python3.9/site-packages/celery_singleton/backends/__init__.py", line 22, in get_backend
    _backend = klass(url, **kwargs)
venv/lib/python3.9/site-packages/celery_singleton/backends/redis.py", line 11, in __init__
    self.redis = Redis.from_url(*args, decode_responses=True, **kwargs)
venv/lib/python3.9/site-packages/redis/client.py", line 696, in from_url
    connection_pool = ConnectionPool.from_url(url, db=db, **kwargs)
venv/lib/python3.9/site-packages/redis/connection.py", line 1051, in from_url
    raise ValueError('Redis URL must specify one of the following '
ValueError: Redis URL must specify one of the following schemes (redis://, rediss://, unix://)

@K-MTG K-MTG changed the title Error when Celery uses Redis Sentinel Exception when Celery uses Redis Sentinel Jan 21, 2021
@steinitzu steinitzu self-assigned this Jan 27, 2021
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