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

Unhandled exception when there are only backends with prefixes #229

Closed
sergey-burkov-trailstone opened this issue May 16, 2024 · 2 comments
Labels
bug Something isn't working wait for release

Comments

@sergey-burkov-trailstone
Copy link
Contributor

          +-+---------------- 1 ----------------
| Traceback (most recent call last):
|   File "/home/sburkov/.virtualenvs/tscs-v2/lib/python3.10/site-packages/starlette/middleware/base.py", line 106, in __call__
|     response = await self.dispatch_func(request, call_next)
|   File "/home/sburkov/.virtualenvs/tscs-v2/lib/python3.10/site-packages/cashews/contrib/fastapi.py", line 72, in dispatch
|     with context, max_age(cache_control_value), self._cache.detect as detector:
|   File "/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/python3.10/contextlib.py", line 135, in __enter__
|     return next(self.gen)
|   File "/home/sburkov/.virtualenvs/tscs-v2/lib/python3.10/site-packages/cashews/wrapper/disable_control.py", line 36, in disabling
|     self.disable(*cmds, prefix=prefix)
|   File "/home/sburkov/.virtualenvs/tscs-v2/lib/python3.10/site-packages/cashews/wrapper/disable_control.py", line 29, in disable
|     return self._get_backend(prefix).disable(*cmds)
|   File "/home/sburkov/.virtualenvs/tscs-v2/lib/python3.10/site-packages/cashews/wrapper/wrapper.py", line 41, in _get_backend
|     backend, _ = self._get_backend_and_config(key)
|   File "/home/sburkov/.virtualenvs/tscs-v2/lib/python3.10/site-packages/cashews/wrapper/transaction.py", line 36, in _get_backend_and_config
|     backend, config = super()._get_backend_and_config(key)
|   File "/home/sburkov/.virtualenvs/tscs-v2/lib/python3.10/site-packages/cashews/wrapper/wrapper.py", line 38, in _get_backend_and_config
|     raise NotConfiguredError("Backend for given key not configured")
| cashews.exceptions.NotConfiguredError: Backend for given key not configured

Originally posted by @sergey-burkov-trailstone in #218 (comment)

@sergey-burkov-trailstone
Copy link
Contributor Author

The exception is occurring by using CacheRequestControlMiddleware and CacheDeleteMiddleware.
CacheEtagMiddleware is not configured/used.

@Krukov
Copy link
Owner

Krukov commented Aug 13, 2024

Was fixed in 7.2.0

@Krukov Krukov closed this as completed Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wait for release
Projects
None yet
Development

No branches or pull requests

2 participants