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

redis.exceptions.ResponseError #15

Open
chanpl opened this issue Jun 3, 2017 · 3 comments
Open

redis.exceptions.ResponseError #15

chanpl opened this issue Jun 3, 2017 · 3 comments

Comments

@chanpl
Copy link

chanpl commented Jun 3, 2017

File "/lib/python3.5/site-packages/redis/client.py", line 2626, in execute
return execute(conn, stack, raise_on_error)
File "/lib/python3.5/site-packages/redis/client.py", line 2540, in _execute_transaction
self.raise_first_error(commands, response)
File "/lib/python3.5/site-packages/redis/client.py", line 2574, in raise_first_error
raise r
redis.exceptions.ResponseError: Command # 1 (SETEX b'celery-task-meta-84b7aefb-0487-45bf-875b-49cd5087e7e6' {"traceback": null, "status": "SUCCESS", "children": [], "task_id": "84b7aefb-0487-45bf-875b-49cd5087e7e6", "result": 11} 86400) of pipeline caused error: value is not an integer or out of range

exc, exc_info.traceback)))

Above exception is raised when I used this module to configure result backend. The SETEX looks a bit strange that timeout value is not at the 2nd position of the args.

If this module is not used, but use Celery 4.0.2 directly with Redis result backend. The SETEX looks like this:
[(('SETEX', b'celery-task-meta-a11b3664-320d-4b48-a25b-154c61ea9bc7', 86400, '{"task_id": "a11
b3664-320d-4b48-a25b-154c61ea9bc7", "traceback": null, "result": 11, "status": "SUCCESS", "children": []}'), {}), (('PUBLISH', b'celery-task-meta-a11b3664-320d-4b48-a25b-154c61ea9bc7', '{"task_id": "a11b3664-320d-4b48-a25b-154c61ea9bc7",
"traceback": null, "result": 11, "status": "SUCCESS", "children": []}'), {})]

@chanpl
Copy link
Author

chanpl commented Jun 5, 2017

this issue is solved by using redis_class=StrictRedis in Sentinel class.

@kellanburket
Copy link

kellanburket commented Jun 16, 2017

In order to avoid this error I changed the return value of RedisSentinelBackend.client to return get_redis_via_sentinel(redis_class=type(str('StrictRedis'), (EnsuredRedisMixin, StrictRedis), {}), **params). Is this going to cause any problems down the road for me?

@chanpl
Copy link
Author

chanpl commented Jun 17, 2017

According to this document, there are little differences between Redis and StrictRedis, while SETEX is one of it.

Ref: https://pypi.python.org/pypi/redis

// SETEX: Order of ‘time’ and ‘value’ arguments reversed. //

The reason is try to support backward comparability of redis-py. I haven't do any test in older version, but at least working fine on redis-py v2.10.5 and redis v3.2

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