Dashboard error caused by cinderclient TypeError

Bug #1161249 reported by Liang Junxue
This bug report is a duplicate of:  Bug #1130730: debug option broken on cinderclient. Edit Remove
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
python-cinderclient
New
Undecided
Unassigned
openstack-dashboard (Ubuntu)
New
Undecided
Unassigned

Bug Description

Dashboard error caused by cinderclient TypeError
Version: grizzly rc3
When I login into the Openstack Dashboard, The URL http://MyIP/horizon/admin/ returns an error:

TypeError at /admin/
hasattr(): attribute name must be stringRequest Method: GET
Request URL: http://210.25.137.233/horizon/admin/
Django Version: 1.4.5
Exception Type: TypeError
Exception Value: hasattr(): attribute name must be string
Exception Location: /usr/lib/python2.7/dist-packages/cinderclient/client.py in __init__, line 78
Python Executable: /usr/bin/python
Python Version: 2.7.3
Python Path: ['/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../..',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/share/openstack-dashboard/',
 '/usr/share/openstack-dashboard/openstack_dashboard']

I check the apache error log
tail /var/log/apache2/error.log
[Thu Mar 28 13:04:07 2013] [error] quotasets.append(getattr(cinder, method_name)(request, tenant_id))
[Thu Mar 28 13:04:07 2013] [error] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/api/cinder.py", line 123, in tenant_quota_get
[Thu Mar 28 13:04:07 2013] [error] c_client = cinderclient(request)
[Thu Mar 28 13:04:07 2013] [error] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/api/cinder.py", line 59, in cinderclient
[Thu Mar 28 13:04:07 2013] [error] http_log_debug=settings.DEBUG)
[Thu Mar 28 13:04:07 2013] [error] File "/usr/lib/python2.7/dist-packages/cinderclient/v1/client.py", line 69, in __init__
[Thu Mar 28 13:04:07 2013] [error] cacert=cacert)
[Thu Mar 28 13:04:07 2013] [error] File "/usr/lib/python2.7/dist-packages/cinderclient/client.py", line 78, in __init__
[Thu Mar 28 13:04:07 2013] [error] if hasattr(requests, logging):
[Thu Mar 28 13:04:07 2013] [error] TypeError: hasattr(): attribute name must be string

in "/usr/lib/python2.7/dist-packages/cinderclient/client.py" line 78
if hasattr(requests, logging):
                requests.logging.getLogger(requests.__name__).addHandler(ch)

change it to
if hasattr(requests, "logging"):
                requests.logging.getLogger(requests.__name__).addHandler(ch)

and restart all the cinder services
and It works!

Liang Junxue (liangjx)
information type: Private Security → Public
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.