Permission denied /var/lib/openstack-dashboard/secret_key

Bug #1683594 reported by Darren McGrandle
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-manuals
Won't Fix
Undecided
Unassigned
openstack-dashboard (Ubuntu)
New
Undecided
Unassigned

Bug Description

After horizon install, web page http://controller/horizon gives an "internal server error".

/var/log/apache2/error.log shows:

[Mon Apr 17 21:43:05.829182 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] mod_wsgi (pid=1613): Target WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi' cannot be loaded as Python module.
[Mon Apr 17 21:43:05.829206 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] mod_wsgi (pid=1613): Exception occurred processing WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi'.
[Mon Apr 17 21:43:05.829221 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] Traceback (most recent call last):
[Mon Apr 17 21:43:05.829235 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi", line 16, in <module>
[Mon Apr 17 21:43:05.829269 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] application = get_wsgi_application()
[Mon Apr 17 21:43:05.829278 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] File "/usr/lib/python2.7/dist-packages/django/core/wsgi.py", line 14, in get_wsgi_application
[Mon Apr 17 21:43:05.829302 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] django.setup()
[Mon Apr 17 21:43:05.829310 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] File "/usr/lib/python2.7/dist-packages/django/__init__.py", line 17, in setup
[Mon Apr 17 21:43:05.829333 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Mon Apr 17 21:43:05.829342 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 48, in __getattr__
[Mon Apr 17 21:43:05.829390 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] self._setup(name)
[Mon Apr 17 21:43:05.829399 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 44, in _setup
[Mon Apr 17 21:43:05.829411 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] self._wrapped = Settings(settings_module)
[Mon Apr 17 21:43:05.829418 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 92, in __init__
[Mon Apr 17 21:43:05.829428 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] mod = importlib.import_module(self.SETTINGS_MODULE)
[Mon Apr 17 21:43:05.829434 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
[Mon Apr 17 21:43:05.829460 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] __import__(name)
[Mon Apr 17 21:43:05.829468 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] File "/usr/share/openstack-dashboard/openstack_dashboard/settings.py", line 335, in <module>
[Mon Apr 17 21:43:05.829548 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] from local.local_settings import * # noqa
[Mon Apr 17 21:43:05.829557 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] File "/usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py", line 124, in <module>
[Mon Apr 17 21:43:05.829700 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] SECRET_KEY = secret_key.generate_or_read_from_file('/var/lib/openstack-dashboard/secret_key')
[Mon Apr 17 21:43:05.829709 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] File "/usr/share/openstack-dashboard/horizon/utils/secret_key.py", line 68, in generate_or_read_from_file
[Mon Apr 17 21:43:05.829745 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] key = read_from_file(key_file)
[Mon Apr 17 21:43:05.829753 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] File "/usr/share/openstack-dashboard/horizon/utils/secret_key.py", line 50, in read_from_file
[Mon Apr 17 21:43:05.829764 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] with open(key_file, 'r') as f:
[Mon Apr 17 21:43:05.829779 2017] [wsgi:error] [pid 1613:tid 140566700234496] [remote 192.168.5.48:22082] IOError: [Errno 13] Permission denied: '/var/lib/openstack-dashboard/secret_key'

Fix is to chown www-data:www-data /var/lib/openstack-dashboard/secret_key

-----------------------------------
Release: 15.0.0 on 2017-04-14 06:14
SHA: c73899569e19fc809f56f6d58235f339c30bda2a
Source: https://git.openstack.org/cgit/openstack/openstack-manuals/tree/doc/install-guide/source/horizon-install.rst
URL: https://docs.openstack.org/ocata/install-guide-ubuntu/horizon-install.html

Revision history for this message
Rob Cresswell (robcresswell-deactivatedaccount) wrote :

We've already added an error message to Horizon and are in the process of backporting it, so there's no point in Docs carrying a workaround for a known error. See https://review.openstack.org/#/c/451318/

Changed in openstack-manuals:
status: New → Invalid
status: Invalid → Won't Fix
Revision history for this message
Darren McGrandle (dmcgrandle) wrote :

Good to know it's being taken care of, thank you.
:D

Revision history for this message
Sammy (svilloldo1980) wrote :

@robcresswell - The bug / fix you make mention of in [1] deals with the message logged with the file in question has the wrong permissions (as I read it, it needs to be 0600).

The original issue presented, however, has to do with the wrongful file ownership as the horizon package installs: it leaves ownership as root, rather than www-data.www-data like it ought to be-

Could you please reference the bug dealing with this wrongful file ownership issue, or otherwise open such a bug for this matter to be fixed.

Thank you very much for your effort, and dedication.

Best regards,
SammyV
-----------------------------------------
[1] - https://review.openstack.org/#/c/451318/

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.