[Errno 13] Permission denied: '/var/www/.novaclient'

Bug #959262 reported by Kevin Jackson on 2012-03-19
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Kiall Mac Innes
python-novaclient (Ubuntu)

Bug Description

I've just installed dashboard on a Ubuntu 12.04 B1 server:
openstack-dashboard 2012.1~rc1~20120315.1545-0ubuntu1

# apt-get install openstack-dashboard

and just pointed my browser to the installation.
On logging on I get a stack trace.


Request Method: GET
Request URL:

Django Version: 1.3.1
Python Version: 2.7.3
Installed Applications:
Installed Middleware:

File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  111. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.7/dist-packages/horizon/decorators.py" in dec
  40. return view_func(request, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/horizon/decorators.py" in dec
  91. return view_func(request, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/horizon/decorators.py" in dec
  57. return view_func(request, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/horizon/decorators.py" in dec
  40. return view_func(request, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/horizon/decorators.py" in dec
  91. return view_func(request, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py" in view
  47. return self.dispatch(request, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py" in dispatch
  68. return handler(request, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/horizon/tables/views.py" in get
  100. handled = self.construct_tables()
File "/usr/lib/python2.7/dist-packages/horizon/tables/views.py" in construct_tables
  87. data = self._get_data_dict()
File "/usr/lib/python2.7/dist-packages/horizon/tables/views.py" in _get_data_dict
  127. self._data = {self.table_class._meta.name: self.get_data()}
File "/usr/lib/python2.7/dist-packages/horizon/usage/views.py" in get_data
  33. self.usage.summarize(*self.usage.get_date_range())
File "/usr/lib/python2.7/dist-packages/horizon/usage/base.py" in summarize
  94. _('Unable to retrieve usage information.'))
File "/usr/lib/python2.7/dist-packages/horizon/usage/base.py" in summarize
  91. self.usage_list = self.get_usage_list(start, end)
File "/usr/lib/python2.7/dist-packages/horizon/usage/base.py" in get_usage_list
  114. return api.usage_list(self.request, start, end)
File "/usr/lib/python2.7/dist-packages/horizon/api/nova.py" in usage_list
  394. return [Usage(u) for u in novaclient(request).usage.list(start, end, True)]
File "/usr/lib/python2.7/dist-packages/novaclient/v1_1/usage.py" in list
  35. "tenant_usages")
File "/usr/lib/python2.7/dist-packages/novaclient/base.py" in _list
  85. with self.completion_cache('human_id', obj_class, mode="w"):
File "/usr/lib/python2.7/contextlib.py" in __enter__
  17. return self.gen.next()
File "/usr/lib/python2.7/dist-packages/novaclient/base.py" in completion_cache
  115. os.makedirs(cache_dir, 0755)
File "/usr/lib/python2.7/os.py" in makedirs
  150. makedirs(head, mode)
File "/usr/lib/python2.7/os.py" in makedirs
  157. mkdir(name, mode)

Exception Type: OSError at /syspanel/
Exception Value: [Errno 13] Permission denied: '/var/www/.novaclient'

/var/www is quite rightly owned by root:root on an out of the box install of Apache.

Kiall Mac Innes (kiall) wrote :

This sounds a lot like bug #897885 - In fact, the is nearly identical.



Kiall Mac Innes (kiall) wrote :

This should fix the issue https://review.openstack.org/5608

Adam Gandelman (gandelman-a) wrote :

The linked commit does enable gracefully handling permission errors when writing a cache file in the caching directory, but this bug apparers to be an issue when novaclient attempts to create the directory (prior to writing the file), perhaps the try/except block of the original fix be expanded to also catch errors during creation of cache_dir

Changed in openstack-dashboard (Ubuntu):
status: New → Confirmed
Adam Gandelman (gandelman-a) wrote :

Oops, apologies. Looks like https://review.openstack.org/#change,5608 is the correct fix for this

affects: openstack-dashboard (Ubuntu) → python-novaclient (Ubuntu)
tags: added: essex-rc-potential
Changed in python-novaclient (Ubuntu):
importance: Undecided → High
Thierry Carrez (ttx) wrote :

From dupe bug:

I see this bug on fedora bug tracker. https://bugzilla.redhat.com/show_bug.cgi?id=801202

There is patch from Pádraig Brady https://bugzilla.redhat.com/attachment.cgi?id=568451&action=diff

Changed in nova:
status: New → Fix Committed
importance: Undecided → Medium
Thierry Carrez (ttx) wrote :
Changed in nova:
assignee: nobody → Kiall Mac Innes (kiall)
Adam Gandelman (gandelman-a) wrote :

Thanks Thierry. Is this something we should expect to trickle into milestone-proposed, or should we prepare to carry a patch?

Thierry Carrez (ttx) on 2012-03-27
Changed in nova:
milestone: none → essex-rc2
tags: removed: essex-rc-potential

Reviewed: https://review.openstack.org/5875
Committed: http://github.com/openstack/python-novaclient/commit/10d226f06fae9957f59784c8fa29ca059bf378a5
Submitter: Jenkins
Branch: milestone-proposed

commit 10d226f06fae9957f59784c8fa29ca059bf378a5
Author: Kiall Mac Innes <email address hidden>
Date: Wed Mar 21 12:19:30 2012 +0000

    Fixes bug #959262 - Prevent a failure to create the cache directory from causing an exception.

    Change-Id: Ia80b50b32f5e3d0e76f4a1b251e23bbd3c70666e

Changed in nova:
status: Fix Committed → Fix Released
Adam Gandelman (gandelman-a) wrote :

Fixed in Ubuntu as of python-novaclient 2012.1~rc2-0ubuntu1

Changed in python-novaclient (Ubuntu):
status: Confirmed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-rc2 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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