[GH-ISSUE #493] Usage statistics 500 error #369

Closed
opened 2026-02-27 16:39:02 +03:00 by kerem · 5 comments
Owner

Originally created by @Aidenir on GitHub (Jan 22, 2015).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/493

I'm having problems getting the usage statistics to work, both in the overview an in specific VM:s.
When running in Debug mode I get this error on every ajax call in the log:

Internal Server Error: /info/instusage/5/NAS/
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/srv/http/webvirtmgr/instance/views.py", line 69, in instusage
    cookies['cpu'] = request._cookies['cpu']
AttributeError: 'WSGIRequest' object has no attribute '_cookies'
ERROR:django.request:Internal Server Error: /info/instusage/5/NAS/
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/srv/http/webvirtmgr/instance/views.py", line 69, in instusage
    cookies['cpu'] = request._cookies['cpu']
AttributeError: 'WSGIRequest' object has no attribute '_cookies'
Originally created by @Aidenir on GitHub (Jan 22, 2015). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/493 I'm having problems getting the usage statistics to work, both in the overview an in specific VM:s. When running in Debug mode I get this error on every ajax call in the log: ``` Internal Server Error: /info/instusage/5/NAS/ Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/srv/http/webvirtmgr/instance/views.py", line 69, in instusage cookies['cpu'] = request._cookies['cpu'] AttributeError: 'WSGIRequest' object has no attribute '_cookies' ERROR:django.request:Internal Server Error: /info/instusage/5/NAS/ Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/srv/http/webvirtmgr/instance/views.py", line 69, in instusage cookies['cpu'] = request._cookies['cpu'] AttributeError: 'WSGIRequest' object has no attribute '_cookies' ```
kerem closed this issue 2026-02-27 16:39:02 +03:00
Author
Owner

@brenard commented on GitHub (Jan 22, 2015):

Cookies access method seem to be incorrect in instusage() method. I fix it in github.com/brenard/webvirtmgr@1391692162.

<!-- gh-comment-id:71042166 --> @brenard commented on GitHub (Jan 22, 2015): Cookies access method seem to be incorrect in instusage() method. I fix it in https://github.com/brenard/webvirtmgr/commit/1391692162eb42293eaa41f809800049578d3ecc.
Author
Owner

@Aidenir commented on GitHub (Jan 22, 2015):

When I try to use @brenard 's fork I instead get this


ERROR:django.request:Internal Server Error: /info/instusage/1/NAS/
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/srv/http/webvirtmgr2/instance/views.py", line 68, in instusage
    cookies = request._get_cookies()
AttributeError: 'WSGIRequest' object has no attribute '_get_cookies'

<!-- gh-comment-id:71113971 --> @Aidenir commented on GitHub (Jan 22, 2015): When I try to use @brenard 's fork I instead get this ``` ERROR:django.request:Internal Server Error: /info/instusage/1/NAS/ Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/srv/http/webvirtmgr2/instance/views.py", line 68, in instusage cookies = request._get_cookies() AttributeError: 'WSGIRequest' object has no attribute '_get_cookies' ```
Author
Owner

@brenard commented on GitHub (Jan 23, 2015):

I mean you are not using the good version of Django. Could you check that the version install on your host is 1.5.5 ?

$ python 
Python 2.7.3 (default, Mar 13 2014, 11:03:55) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.get_version()
'1.5.5'
<!-- gh-comment-id:71163272 --> @brenard commented on GitHub (Jan 23, 2015): I mean you are not using the good version of Django. Could you check that the version install on your host is 1.5.5 ? ``` $ python Python 2.7.3 (default, Mar 13 2014, 11:03:55) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import django >>> django.get_version() '1.5.5' ```
Author
Owner

@Aidenir commented on GitHub (Jan 23, 2015):

Apparantly I have 1.7.3 installed. I will try to install and use 1.5.5 when I get of work tonight.

<!-- gh-comment-id:71172065 --> @Aidenir commented on GitHub (Jan 23, 2015): Apparantly I have 1.7.3 installed. I will try to install and use 1.5.5 when I get of work tonight.
Author
Owner

@Aidenir commented on GitHub (Jan 23, 2015):

When I installed 1.5.5 it shows the usage graphs. Thanks for the help

<!-- gh-comment-id:71268615 --> @Aidenir commented on GitHub (Jan 23, 2015): When I installed 1.5.5 it shows the usage graphs. Thanks for the help
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/webvirtmgr#369
No description provided.