I found a mistake in using redis as backend
aeasringnar opened this issue · 2 comments
When I use redis as the backend of the cache, I use cache_response, but there is an error: STACK_GLOBAL requires str.
`
File "/home/aes/envs/test/lib/python3.6/site-packages/django_redis/client/default.py" in decode
311. value = int(value)
During handling of the above exception (invalid literal for int() with base 10: b'\x93\xda\x01\xf8{"message":"ok","errorCode":0,"data":{"id":1,"sort_time":"2019-08-19 14:38:09","created":"2019-08-19 14:38:09","updated":"2019-08-19 14:48:22","group":{"id":1,"sort_time":"2019-08-19), another exception occurred:
File "/home/aes/envs/test/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
35. response = get_response(request)
File "/home/aes/envs/test/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
128. response = self.process_exception_by_middleware(e, request)
File "/home/aes/envs/test/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
126. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/aes/envs/test/lib/python3.6/site-packages/django/views/decorators/csrf.py" in wrapped_view
54. return view_func(*args, **kwargs)
File "/home/aes/envs/test/lib/python3.6/site-packages/django/views/generic/base.py" in view
69. return self.dispatch(request, *args, **kwargs)
File "/home/aes/envs/test/lib/python3.6/site-packages/rest_framework/views.py" in dispatch
495. response = self.handle_exception(exc)
File "/home/aes/envs/test/lib/python3.6/site-packages/rest_framework/views.py" in handle_exception
455. self.raise_uncaught_exception(exc)
File "/home/aes/envs/test/lib/python3.6/site-packages/rest_framework/views.py" in raise_uncaught_exception
466. raise exc
File "/home/aes/envs/test/lib/python3.6/site-packages/rest_framework/views.py" in dispatch
492. response = handler(request, *args, **kwargs)
File "/home/aes/envs/test/lib/python3.6/site-packages/rest_framework_extensions/cache/decorators.py" in inner
49. kwargs=kwargs,
File "/home/aes/envs/test/lib/python3.6/site-packages/rest_framework_extensions/cache/decorators.py" in process_cache_response
66. response = self.cache.get(key)
File "/home/aes/envs/test/lib/python3.6/site-packages/django_redis/cache.py" in _decorator
32. return method(self, *args, **kwargs)
File "/home/aes/envs/test/lib/python3.6/site-packages/django_redis/cache.py" in get
81. client=client)
File "/home/aes/envs/test/lib/python3.6/site-packages/django_redis/client/default.py" in get
210. return self.decode(value)
File "/home/aes/envs/test/lib/python3.6/site-packages/django_redis/client/default.py" in decode
318. value = self._serializer.loads(value)
File "/home/aes/envs/test/lib/python3.6/site-packages/django_redis/serializers/pickle.py" in loads
35. return pickle.loads(value)
Exception Type: UnpicklingError at /userinfo/
Exception Value: STACK_GLOBAL requires str
`
is drf-ex issue or django-redis?
@aeasringnar Please provide more info, like versions of libraries you use and example of code to reproduce it. I guess, it's problem in your code or outdated django-redis.