Bug 1017725 - openstack - Horizon: The httpd can't reach .secret_key
openstack - Horizon: The httpd can't reach .secret_key
Status: CLOSED DUPLICATE of bug 1015296
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-django-horizon (Show other bugs)
4.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 4.0
Assigned To: RHOS Maint
Ami Jeain
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-10 07:57 EDT by Yogev Rabl
Modified: 2014-06-06 02:49 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-10 08:26:18 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
yrabl: internal‑review?


Attachments (Terms of Use)

  None (edit)
Description Yogev Rabl 2013-10-10 07:57:23 EDT
Description of problem:
After an AIO installation with packstack the dashboard isn't available and preset an 'Internal server error'. 



 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 Yogev Rabl 2013-10-10 08:00:50 EDT
The httpd error log first show: 

hu Oct 10 14:23:32 2013] [warn] [client 10.35.2.255] incomplete redirection target of '/dashboard/' for URI '/' modified to 'http://orange-vdsf.qa.lab.tlv.redhat.com/dashboard/'
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255] mod_wsgi (pid=32037): Exception occurred processing WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi'.
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255] Traceback (most recent call last):
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]   File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 219, in __call__
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]     self.load_middleware()
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]   File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 39, in load_middleware
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]     for middleware_path in settings.MIDDLEWARE_CLASSES:
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]   File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 184, in inner
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]     self._setup()
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]   File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 42, in _setup
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]     self._wrapped = Settings(settings_module)
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]   File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 93, in __init__
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]     mod = importlib.import_module(self.SETTINGS_MODULE)
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]   File "/usr/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]     __import__(name)
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]   File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/settings.py", line 48, in <module>
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]     '.secret_key_store'))
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]   File "/usr/lib/python2.6/site-packages/horizon/utils/secret_key.py", line 65, in generate_or_read_from_file
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255]     with open(key_file, 'r') as f:
[Thu Oct 10 14:23:32 2013] [error] [client 10.35.2.255] IOError: [Errno 13] Permission denied: '/tmp/.secret_key_store'


after changing the permissions on the /tmp/.secret_key directory the httpd error log showed the error:

[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204] mod_wsgi (pid=5983): Exception occurred processing WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi'.
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204] Traceback (most recent call last):
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]   File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 219, in __call__
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]     self.load_middleware()
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]   File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 39, in load_middleware
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]     for middleware_path in settings.MIDDLEWARE_CLASSES:
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]   File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 184, in inner
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]     self._setup()
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]   File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 42, in _setup
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]     self._wrapped = Settings(settings_module)
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]   File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 93, in __init__
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]     mod = importlib.import_module(self.SETTINGS_MODULE)
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]   File "/usr/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]     __import__(name)
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]   File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/settings.py", line 48, in <module>
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]     '.secret_key_store'))
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]   File "/usr/lib/python2.6/site-packages/horizon/utils/secret_key.py", line 64, in generate_or_read_from_file
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204]     raise FilePermissionError("Insecure key file permissions!")
[Thu Oct 10 14:55:17 2013] [error] [client 10.35.2.204] FilePermissionError: Insecure key file permissions!


The problem is in the /usr/lib/python2.6/site-packages/horizon/utils/secret_key.py module line 64.
Comment 2 Matthias Runge 2013-10-10 08:23:04 EDT
Could you please verify, you're using python-django-horizon-2013.2-0.14.rc1.el6ost ?

It's fixed there.
Comment 3 Matthias Runge 2013-10-10 08:26:18 EDT

*** This bug has been marked as a duplicate of bug 1015296 ***
Comment 4 smita 2014-06-02 02:54:08 EDT
I am now seeing this issue with the Dashboard that comes with "icehouse"

openstack-dashboard-2014.1-1.el6.noarch
[root@controller ~]# rpm -qa | grep python-django-horizon
python-django-horizon-2014.1-1.el6.noarch
python-django-horizon-doc-2014.1-1.el6.noarch


[Mon Jun 02 12:10:43 2014] [notice] Apache/2.2.15 (Unix) DAV/2 mod_ssl/2.2.15 OpenSSL/1.0.0-fips mod_wsgi/3.2 Python/2.6.6 configured -- resuming normal operations
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1] mod_wsgi (pid=32074): Exception occurred processing WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi'.
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1] Traceback (most recent call last):
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]   File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 219, in __call__
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]     self.load_middleware()
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]   File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 37, in load_middleware
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]     for middleware_path in settings.MIDDLEWARE_CLASSES:
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]   File "/usr/lib/python2.6/site-packages/django/utils/functional.py", line 184, in inner
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]     self._setup()
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]   File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 42, in _setup
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]     self._wrapped = Settings(settings_module)
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]   File "/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 93, in __init__
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]     mod = importlib.import_module(self.SETTINGS_MODULE)
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]   File "/usr/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]     __import__(name)
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]   File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/settings.py", line 222, in <module>
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]     from local.local_settings import *  # noqa
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]   File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/local/local_settings.py", line 93, in <module>
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]     SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH, '.secret_key_store'))
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]   File "/usr/lib/python2.6/site-packages/horizon/utils/secret_key.py", line 65, in generate_or_read_from_file
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1]     with open(key_file, 'r') as f:
[Mon Jun 02 12:10:51 2014] [error] [client 127.0.0.1] IOError: [Errno 13] Permission denied: '/tmp/.secret_key_store'
[Mon Jun 02 12:13:28 2014] [notice] caught SIGTERM, shutting down
[Mon Jun 02 12:13:28 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Jun 02 12:13:28 2014] [notice] Digest: generating secret for digest authentication ...
[Mon Jun 02 12:13:28 2014] [notice] Digest: done


Is this bug reintroduced????? 


[root@controller ~]# uname -a
Linux controller 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@controller ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.5 (Santiago)
[root@controller ~]#
Comment 5 Matthias Runge 2014-06-06 02:49:01 EDT
sdimber@gmail.com

this has been a configuration issue. please list here:
/etc/openstack-dashboard/local_settings

I'm especially interested in 
SECRET_KEY
setting.

Note You need to log in before you can comment on or make changes to this bug.