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

Caching errors while trying to log in #43

Open
thijs-utrecht opened this issue Jan 25, 2023 · 1 comment
Open

Caching errors while trying to log in #43

thijs-utrecht opened this issue Jan 25, 2023 · 1 comment
Labels

Comments

@thijs-utrecht
Copy link

After deploying open-klant 0.1.0 on a kubernetes 1.23.12 cluster the application starts without issues. When trying to login with a (newly created) superuser account it throws the following exception when logging in.

2023-01-25 12:26:35,653 ERROR django.request Internal Server Error: /admin/login/ Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 115, in _get_response response = self.process_exception_by_middleware(e, request) File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python3.8/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func response = view_func(request, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/django/contrib/admin/sites.py", line 399, in login return LoginView.as_view(**defaults)(request) File "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", line 71, in view return self.dispatch(request, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/django/utils/decorators.py", line 45, in _wrapper return bound_method(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper return view(request, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/django/utils/decorators.py", line 45, in _wrapper return bound_method(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/django/utils/decorators.py", line 142, in _wrapped_view response = view_func(request, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/django/utils/decorators.py", line 45, in _wrapper return bound_method(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func response = view_func(request, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/django/contrib/auth/views.py", line 61, in dispatch return super().dispatch(request, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/django/views/generic/base.py", line 97, in dispatch return handler(request, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/django/views/generic/edit.py", line 142, in post return self.form_valid(form) File "/usr/local/lib/python3.8/site-packages/django/contrib/auth/views.py", line 90, in form_valid auth_login(self.request, form.get_user()) File "/usr/local/lib/python3.8/site-packages/django/contrib/auth/__init__.py", line 108, in login request.session.cycle_key() File "/usr/local/lib/python3.8/site-packages/django/contrib/sessions/backends/base.py", line 297, in cycle_key self.create() File "/usr/local/lib/python3.8/site-packages/django/contrib/sessions/backends/cache.py", line 50, in create raise RuntimeError( RuntimeError: Unable to create a new session key. It is likely that the cache is unavailable

@Michel-Verhoeven
Copy link

I just ran into the same problem when deploying open-klant 0.1. I noticed thad open klant needs Redis for caching so you need to set CACHE_DEFAULT and CACHE_AXES environment variables to point to your Redis container and it should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants