[GH-ISSUE #366] Main Site does throw a error after upgarding to latest version #233

Closed
opened 2026-02-27 15:57:54 +03:00 by kerem · 3 comments
Owner

Originally created by @h3o66 on GitHub (Oct 11, 2020).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/366

In this case i got the following error from the main site:

Environment:


Request Method: GET
Request URL: http://kvm-root:80/

Django Version: 2.2.16
Python Version: 3.7.3
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'bootstrap4',
 'django_icons',
 'django_otp',
 'django_otp.plugins.otp_totp',
 'accounts',
 'admin',
 'appsettings',
 'computes',
 'console',
 'datasource',
 'networks',
 'instances',
 'interfaces',
 'nwfilters',
 'storages',
 'secrets',
 'logs',
 'qr_code')
Installed Middleware:
[]



Traceback:

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/srv/webvirtcloud/instances/views.py" in index
  45.     if request.user.is_superuser:

Exception Type: AttributeError at /
Exception Value: 'WSGIRequest' object has no attribute 'user'

System Details:
Debian 10
Python 3.7 from the debian repos

I Hope this helps in any way.
I guess i get this error, because no user was logged in and cannot be checked.
Also there was no redirect to the login site.

Originally created by @h3o66 on GitHub (Oct 11, 2020). Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/366 In this case i got the following error from the main site: ``` Environment: Request Method: GET Request URL: http://kvm-root:80/ Django Version: 2.2.16 Python Version: 3.7.3 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'bootstrap4', 'django_icons', 'django_otp', 'django_otp.plugins.otp_totp', 'accounts', 'admin', 'appsettings', 'computes', 'console', 'datasource', 'networks', 'instances', 'interfaces', 'nwfilters', 'storages', 'secrets', 'logs', 'qr_code') Installed Middleware: [] Traceback: File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner 34. response = get_response(request) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response 115. response = self.process_exception_by_middleware(e, request) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response 113. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/srv/webvirtcloud/instances/views.py" in index 45. if request.user.is_superuser: Exception Type: AttributeError at / Exception Value: 'WSGIRequest' object has no attribute 'user' ``` System Details: Debian 10 Python 3.7 from the debian repos I Hope this helps in any way. I guess i get this error, because no user was logged in and cannot be checked. Also there was no redirect to the login site.
kerem closed this issue 2026-02-27 15:57:54 +03:00
Author
Owner

@h3o66 commented on GitHub (Oct 11, 2020):

I get this as well after the login to /accounts/login/ with a problem fo the session:

Environment:


Request Method: POST
Request URL: http://kvm-root:80/accounts/login/

Django Version: 2.2.16
Python Version: 3.7.3
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'bootstrap4',
 'django_icons',
 'django_otp',
 'django_otp.plugins.otp_totp',
 'accounts',
 'admin',
 'appsettings',
 'computes',
 'console',
 'datasource',
 'networks',
 'instances',
 'interfaces',
 'nwfilters',
 'storages',
 'secrets',
 'logs',
 'qr_code')
Installed Middleware:
[]



Traceback:

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/views/generic/base.py" in view
  71.             return self.dispatch(request, *args, **kwargs)

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapper
  45.         return bound_method(*args, **kwargs)

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/views/decorators/debug.py" in sensitive_post_parameters_wrapper
  76.             return view(request, *args, **kwargs)

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapper
  45.         return bound_method(*args, **kwargs)

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapped_view
  142.                     response = view_func(request, *args, **kwargs)

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapper
  45.         return bound_method(*args, **kwargs)

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/contrib/auth/views.py" in dispatch
  61.         return super().dispatch(request, *args, **kwargs)

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/views/generic/base.py" in dispatch
  97.         return handler(request, *args, **kwargs)

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/views/generic/edit.py" in post
  142.             return self.form_valid(form)

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/contrib/auth/views.py" in form_valid
  90.         auth_login(self.request, form.get_user())

File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/contrib/auth/__init__.py" in login
  99.     if SESSION_KEY in request.session:

Exception Type: AttributeError at /accounts/login/
Exception Value: 'WSGIRequest' object has no attribute 'session'

<!-- gh-comment-id:706708761 --> @h3o66 commented on GitHub (Oct 11, 2020): I get this as well after the login to `/accounts/login/` with a problem fo the session: ``` Environment: Request Method: POST Request URL: http://kvm-root:80/accounts/login/ Django Version: 2.2.16 Python Version: 3.7.3 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'bootstrap4', 'django_icons', 'django_otp', 'django_otp.plugins.otp_totp', 'accounts', 'admin', 'appsettings', 'computes', 'console', 'datasource', 'networks', 'instances', 'interfaces', 'nwfilters', 'storages', 'secrets', 'logs', 'qr_code') Installed Middleware: [] Traceback: File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner 34. response = get_response(request) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response 115. response = self.process_exception_by_middleware(e, request) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response 113. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/views/generic/base.py" in view 71. return self.dispatch(request, *args, **kwargs) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapper 45. return bound_method(*args, **kwargs) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/views/decorators/debug.py" in sensitive_post_parameters_wrapper 76. return view(request, *args, **kwargs) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapper 45. return bound_method(*args, **kwargs) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapped_view 142. response = view_func(request, *args, **kwargs) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapper 45. return bound_method(*args, **kwargs) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func 44. response = view_func(request, *args, **kwargs) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/contrib/auth/views.py" in dispatch 61. return super().dispatch(request, *args, **kwargs) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/views/generic/base.py" in dispatch 97. return handler(request, *args, **kwargs) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/views/generic/edit.py" in post 142. return self.form_valid(form) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/contrib/auth/views.py" in form_valid 90. auth_login(self.request, form.get_user()) File "/srv/webvirtcloud/venv/local/lib/python3.7/site-packages/django/contrib/auth/__init__.py" in login 99. if SESSION_KEY in request.session: Exception Type: AttributeError at /accounts/login/ Exception Value: 'WSGIRequest' object has no attribute 'session' ```
Author
Owner

@catborise commented on GitHub (Oct 12, 2020):

hi @h3o66 i check it but there is not an error like you specified. have you install requirements "pip3 install -r conf/requirements.txt", and migrate "python3 manage.py migrate"
update settings.py file with new one

<!-- gh-comment-id:706893886 --> @catborise commented on GitHub (Oct 12, 2020): hi @h3o66 i check it but there is not an error like you specified. have you install requirements "pip3 install -r conf/requirements.txt", and migrate "python3 manage.py migrate" update settings.py file with new one
Author
Owner

@h3o66 commented on GitHub (Oct 12, 2020):

I am sorry.
Probably due a long not done upgrade i messed up my config.

I copied over the template and migated the SECRET_KEY to the new config.
Solved with this, thanks anyway.

<!-- gh-comment-id:707042912 --> @h3o66 commented on GitHub (Oct 12, 2020): I am sorry. Probably due a long not done upgrade i messed up my config. I copied over the template and migated the SECRET_KEY to the new config. Solved with this, thanks anyway.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtcloud#233
No description provided.