分享

dashboard报500错误(二)

wonitazansa 发表于 2015-3-13 22:19:33 [显示全部楼层] 只看大图 回帖奖励 阅读模式 关闭右栏 17 141932
我重新配置openstack配置完门户Dashboard
1,其中有一步骤
[root@controller ~]#setsebool -P httpd_can_network_connect on
setsebool:  SELinux is disabled.
其他步骤无异常
2,在web浏览10.0.0.151/dashboard,可以访问输入用户和密码,10.0.0.151/dashboard/admin页面提示“错误,刷新,请联系管理员
3,我就将SELinux 在config中改成SELINUX=enforcing,重启服务器
4,重启后,10.0.0.151/dashboard,直接500错误,http://10.0.0.151正常
请到大家多多帮忙,是在没辙,水平有限
以下是日志和配置文件


2015-03-13_220322.png

[root@controller ~]#vi /etc/openstack-dashboard/local_settings
ALLOWED_HOSTS =['localhost','controller','10.0.0.151']

CACHES = {
    'default': {
        'BACKEND' :'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION' : '127.0.0.1:11211',
    }
}
OPENSTACK_HOST ="controller"

[root@controller ~]#tail -40 /etc/httpd/logs/error_log
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150] mod_wsgi (pid=1686): Exception occurredprocessing WSGI script'/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi'.
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150] Traceback (most recent call last):
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]   File"/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line219, in __call__
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]    self.load_middleware()
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]   File"/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line37, in load_middleware
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]     formiddleware_path in settings.MIDDLEWARE_CLASSES:
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]   File"/usr/lib/python2.6/site-packages/django/utils/functional.py", line184, in inner
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]    self._setup()
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]   File"/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 42,in _setup
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]    self._wrapped = Settings(settings_module)
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]   File"/usr/lib/python2.6/site-packages/django/conf/__init__.py", line 93,in __init__
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]     mod= importlib.import_module(self.SETTINGS_MODULE)
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]   File"/usr/lib/python2.6/site-packages/django/utils/importlib.py", line35, in import_module
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]    __import__(name)
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]   File"/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/settings.py",line 223, in <module>
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]    from local.local_settings import * # noqa
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]   File"/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/local/local_settings.py",line 93, in <module>
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]    SECRET_KEY =secret_key.generate_or_read_from_file(os.path.join(LOCAL_PATH,'.secret_key_store'))
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]   File"/usr/lib/python2.6/site-packages/horizon/utils/secret_key.py", line64, in generate_or_read_from_file
[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150]    raise FilePermissionError("Insecure key file permissions!")

[Fri Mar 13 21:18:032015] [error] [client 10.0.0.150] FilePermissionError:Insecure key file permissions!

[root@controller ~]# ll /var/lib/openstack-dashboard

total 0


已有(17)人评论

跳转到指定楼层
arsenduan 发表于 2015-3-13 22:53:24
修改为disabled

修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled


然后重启下Linux,然后看apache server是否启动。然后再次访问。
如果记得多刷新几次
回复

使用道具 举报

wonitazansa 发表于 2015-3-14 09:17:16
本帖最后由 wonitazansa 于 2015-3-14 09:29 编辑

你好!
      谢谢,可以打开网站了,但是,输入用户名密码后报错,如图 2015-03-14_092108.png


[Sat Mar 14 01:22:26 2015] [error] Internal Server Error: /dashboard/admin/
[Sat Mar 14 01:22:26 2015] [error] Traceback (most recent call last):
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 109, in get_response
[Sat Mar 14 01:22:26 2015] [error]     response = callback(request, *callback_args, **callback_kwargs)
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/horizon/decorators.py", line 38, in dec
[Sat Mar 14 01:22:26 2015] [error]     return view_func(request, *args, **kwargs)
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/horizon/decorators.py", line 86, in dec
[Sat Mar 14 01:22:26 2015] [error]     return view_func(request, *args, **kwargs)
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/horizon/decorators.py", line 54, in dec
[Sat Mar 14 01:22:26 2015] [error]     return view_func(request, *args, **kwargs)
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/horizon/decorators.py", line 38, in dec
[Sat Mar 14 01:22:26 2015] [error]     return view_func(request, *args, **kwargs)
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/horizon/decorators.py", line 86, in dec
[Sat Mar 14 01:22:26 2015] [error]     return view_func(request, *args, **kwargs)
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/django/views/generic/base.py", line 48, in view
[Sat Mar 14 01:22:26 2015] [error]     return self.dispatch(request, *args, **kwargs)
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/django/views/generic/base.py", line 69, in dispatch
[Sat Mar 14 01:22:26 2015] [error]     return handler(request, *args, **kwargs)
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/horizon/tables/views.py", line 154, in get
[Sat Mar 14 01:22:26 2015] [error]     handled = self.construct_tables()
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/horizon/tables/views.py", line 145, in construct_tables
[Sat Mar 14 01:22:26 2015] [error]     handled = self.handle_table(table)
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/horizon/tables/views.py", line 118, in handle_table
[Sat Mar 14 01:22:26 2015] [error]     data = self._get_data_dict()
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/horizon/tables/views.py", line 181, in _get_data_dict
[Sat Mar 14 01:22:26 2015] [error]     self._data = {self.table_class._meta.name: self.get_data()}
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/admin/overview/views.py", line 60, in get_data
[Sat Mar 14 01:22:26 2015] [error]     data = super(GlobalOverview, self).get_data()
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/usage/views.py", line 43, in get_data
[Sat Mar 14 01:22:26 2015] [error]     self.usage.summarize(*self.usage.get_date_range())
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/usage/base.py", line 200, in summarize
[Sat Mar 14 01:22:26 2015] [error]     if not api.nova.extension_supported('SimpleTenantUsage', self.request):
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/horizon/utils/memoized.py", line 90, in wrapped
[Sat Mar 14 01:22:26 2015] [error]     value = cache[key] = func(*args, **kwargs)
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/api/nova.py", line 752, in extension_supported
[Sat Mar 14 01:22:26 2015] [error]     extensions = list_extensions(request)
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/horizon/utils/memoized.py", line 90, in wrapped
[Sat Mar 14 01:22:26 2015] [error]     value = cache[key] = func(*args, **kwargs)
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/api/nova.py", line 743, in list_extensions
[Sat Mar 14 01:22:26 2015] [error]     return nova_list_extensions.ListExtManager(novaclient(request)).show_all()
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/novaclient/v1_1/contrib/list_extensions.py", line 37, in show_all
[Sat Mar 14 01:22:26 2015] [error]     return self._list("/extensions", 'extensions')
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/novaclient/base.py", line 64, in _list
[Sat Mar 14 01:22:26 2015] [error]     _resp, body = self.api.client.get(url)
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/novaclient/client.py", line 309, in get
[Sat Mar 14 01:22:26 2015] [error]     return self._cs_request(url, 'GET', **kwargs)
[Sat Mar 14 01:22:26 2015] [error]   File "/usr/lib/python2.6/site-packages/novaclient/client.py", line 301, in _cs_request
[Sat Mar 14 01:22:26 2015] [error]     raise e
[Sat Mar 14 01:22:26 2015] [error] Unauthorized: Unauthorized (HTTP 401)

回复

使用道具 举报

arsenduan 发表于 2015-3-14 11:12:44
wonitazansa 发表于 2015-3-14 09:17
你好!
      谢谢,可以打开网站了,但是,输入用户名密码后报错,如图

试试其他用户名和密码
回复

使用道具 举报

wonitazansa 发表于 2015-3-14 16:35:43

还能用哪个用户
我用cinder用户登录,还是提示相同报错
[root@controller ~]# keystone user-list
+----------------------------------+--------+---------+--------------------+
|                id                |  name  | enabled |       email        |
+----------------------------------+--------+---------+--------------------+
| 07ca03740fef4388b0b1407ad0a1bbe1 | admin  |   True  |    ADMIN_EMAIL     |
| 1d8f2cc42cb9415291dadb6bad39736a | cinder |   True  | cinder@example.com |
| 8a66fe8b02674a0eb2708947543b1b3e | glance |   True  | glance@example.com |
| cd711991555e46929b7e7e4a182f50a3 |  nova  |   True  |  nova@example.com  |
+----------------------------------+--------+---------+--------------------+

回复

使用道具 举报

xuanxufeng 发表于 2015-3-14 21:24:07
wonitazansa 发表于 2015-3-14 16:35
还能用哪个用户
我用cinder用户登录,还是提示相同报错
[root@controller ~]# keystone user-list

那就是dashboard配置错了,dashboard配置参考这个:一一对比或则重新安装配置下。问题不大。
openstack【juno】入门 【dashboard篇】十九:添加dashboard

回复

使用道具 举报

wonitazansa 发表于 2015-3-15 10:17:49

如果我故意输错密码,一会提示”无效的用户名密码“,输正确的用户和密码,就是admin没有权限访问”http://10.0.0.151/dashboard/admin/“
2015-03-15_101418.png

以下配置
[root@controller ~]# vi ./bin/admin-openrc.sh
export OS_USERNAME=admin
export OS_PASSWORD=ADMIN_PASS
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://controller:35357/v2.0

[root@controller ~]# vi /etc/openstack-dashboard/local_settings

ALLOWED_HOSTS = ['*']
CACHES = {
    'default': {
        'BACKEND' : 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION' : '127.0.0.1:11211',
    }
}

OPENSTACK_HOST = "controller"


请大家帮忙定位,谢谢
回复

使用道具 举报

sstutu 发表于 2015-3-15 11:02:50
检测下面配置:

打开文件 /etc/openstack-dashboard/local_settings.py,

允许任何主机访问dashboard
增加下面配置项:
ALLOWED_HOSTS = ['*']





回复

使用道具 举报

wonitazansa 发表于 2015-3-15 17:01:31
sstutu 发表于 2015-3-15 11:02
检测下面配置:

打开文件 /etc/openstack-dashboard/local_settings.py,


在如下文件中已经,经配置ALLOWED_HOSTS = ['*']
[root@controller ~]# vi /etc/openstack-dashboard/local_settings
回复

使用道具 举报

wonitazansa 发表于 2015-3-16 08:52:20
现在还是登陆进去报错,谢谢
回复

使用道具 举报

12下一页
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条