打开Openstack dashboard出现Internal Server Error

时间:2022-11-22 04:46:25

最近研究openstack,想把自己遇到的问题记录下来,同时如果有别的朋友也碰到同样问题的时候可以有个参考。

这次的问题是在openstack搭建好之后,dashboard本身是能用的,但是在某一天后,突然发现打开dashboard后出现Internal Server Error. 于是乎在网上找答案但是没有,那就自己动手解决吧。

首先打开dashboard的log文件,我的是:~/log/horizon.log.

发现下面的error 信息:

-- ::55.380169 Traceback (most recent call last):
-- ::55.380313 File "/opt/stack/horizon/openstack_dashboard/wsgi/django.wsgi", line , in <module>
-- ::55.380466 application = get_wsgi_application()
-- ::55.380557 File "/usr/local/lib/python2.7/dist-packages/django/core/wsgi.py", line , in get_wsgi_application
-- ::55.380659 django.setup()
-- ::55.380740 File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line , in setup
-- ::55.380837 configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
-- ::55.380939 File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line , in __getattr__
-- ::55.381056 self._setup(name)
-- ::55.381140 File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line , in _setup
-- ::55.381250 self._wrapped = Settings(settings_module)
-- ::55.381337 File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line , in __init__
-- ::55.381435 mod = importlib.import_module(self.SETTINGS_MODULE)
-- ::55.381518 File "/usr/lib/python2.7/importlib/__init__.py", line , in import_module
-- ::55.381665 __import__(name)
-- ::55.381751 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/settings.py", line , in <module>
-- ::55.381886 from local.local_settings import * # noqa
-- ::55.381977 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/local/local_settings.py", line , in <module>
-- ::55.382078 os.path.join(LOCAL_PATH, '.secret_key_store'))
-- ::55.382174 File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/utils/secret_key.py", line , in generate_or_read_from_file
-- ::55.382377 raise FilePermissionError("Insecure key file permissions!")
-- ::55.382494 FilePermissionError: Insecure key file permissions!

初步判断是文件的权限问题,根据os.path.join(LOCAL_PATH, '.secret_key_store') 找到/opt/stack/horizon/openstack_dashboard/local/.secret_key_store, 并发现对这个文件拥有所有的权限,很奇怪为啥会出现permission的问题

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAAaCAIAAADOjTmbAAAFf0lEQVR4nO2dQZKrIBCGuUNu4JKV6ykvYLH2CqniIOxzBS6RjUfJYXwLFLoVEIyZOPX+bzUPSfPbkraD0k+IXZSxWm4bjTFWS6GMtdaofTNxOwc4y84nh9aWdFRmJA4Kh5QZ3QGprdXzYantGLorM3JD4dBsh7X9GT0fR2qz6OSnG0UZf75CCCH0MqO1HUdySNOZXjMPlWF2iExiscRg/rziFpQZx9VF0ZZd06iDCvyWhM034t6MPyPzsND+BeZz6jqm/LDqtrW2PiS1DUqpP+P2mZ4EbloEwgfCYNw/tXbqOMvO2wPHvqgUbdMygy3uzsW0MXZkkyxiSNtxHN291SvKXYOr6fkFgs78LAmn6udz+Ke28+nzk6qch5K7n/Wnpoqmc/S8svMzEtzZJ3jEqZSTgJ8yjZgxf66GLklW0u7/9fnsjRsVRp/7x/2Qmj/rdn8keX1j9n3bnhcB+I/ZplDgHeBPAMD3Idnezg81UAL8CQAAAAAAwO+zeZAQXwG/rP2/rgcAAAAAAAAAAAAAAAAAAOByuH0EF3lN12+yuAhf1pPc/6LM/hOvzYVdGs7VSDdLxdvLnsyl+tfNTxndu3NEz5+mfQ3D1Lc/39YBvoh0+7XPqHxQsDG40M45wfRqemrh+8kZ2o5GF5yfi2dhm2BpQY1yaPkBtrlcGd9etN0/0b96fqb2p9fquR7tq2vq+n8nuNfqPB93F7daLvdzo/xmhNWeWasF7eRb5RXtHKQmuJMtG3YubZHZhs52g7MhwhGraVhwfxOTu+U4rqXnHGjZEM5cFqOkyobU1qi5H/1bJP0QnYc1kkmVEEkOlBTByfQvri2TGqtWT4b2NQzTMEzD8Or7Vzu3/rT95Ntb2r95hnYfcJ2R/nG7PfphGoZpCYhRO7RxGoZp6O4lOvv2Ryz2lyFy9mdt80f4WRT5Iasz9J9C9K/zQwX0V6oyRkWuepgTvubMNqG6mp0DFAd3/gVOF58KlhWpoBQv6iRd1aVIMC0qbHQpPaehDClWEsRIL7o4uLuL69JVEtzjfnBDr+fhrtZFJpXPguneWtBO/6rgHr+n1+lJcXv0/ePm/m6eIe7QNPn26H178xyGZxPa6VLJvQuR6965OJiyI45m7rdHz4Npwv698+dVMlbKD6nPtq8h2L93LF5X+sGTLFjjDm5njJv9S403Xu1M+rRmPci17BygInNPVmCKB5tUgaH0t2v+QOnX72p6zkHSxX4SjFYTeueqzTcAZRb9wSeJAlhujGNTilba+5XgXiCIXuAzgrsQTTdtMtBNxrocarpM1snjadaOEEeC+ybtLbS/FRYh5oeUzp+2f7K25sluclV+KCM2Y+Ysx2plrFY8PixfrJJ6pN+0c4DDX56dTJlV1pR0USAbTI05VF/3anrewP0wIxo216c8cxchT/f/TvhBuINH84XgRrauXbQsk+1/UNJxPUWEDDQVxCuDe7b/geDePTseFov0VC+a80z8hOCe11lETT138qvc/fqX17VzANRzv149d7JaErv3VAX3YHPHD8toFQ9goktblXXnz6zn7ntKKq5WjxBLcrpKS/m6yhKzmucQzXZ5e9PRZehYgpyyw4a+dyWZ7Nyfd87YFy4uF6XtST+kdPKnuzx2V/phl7p67um6xlez87YjUM/9PT2nkn8Rck/Mqp47fxMw4YcD/69Aon56ed35bP/6eu7JGo31T8SjwT25VpA6RNuXyE7XNDIPHvkQbm26bI3CvwrpH+f6WJk5hcLbRoGRTTtfaXnLDwAAAOooS9sBAAD8DcL7mmXvWQIAAAAAAAAKibwveOry9KftAwAAAAAAAAAAAABQDXkb+dtS3kJ+uC7ip+3XcjU9tfx1/SDPda7vt5T8A2HepyGJuaxbAAAAAElFTkSuQmCC" alt="" />

登陆到另外一台dashboard正常work的机器上发现

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA68AAAAnCAIAAAB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KgSunyA/djtqsf+ffbQdrUM7tKzmunEUgKyMxdbpZ9w5wGLfk8jHwp3tL4SURIcSWcjYv1fiaeq7BxW5E/LWGg875t3OVnX2lYGu0AAACgF1LJbCvKzdObTMi5IfS3zpSJCPdILXLNc90HSy/Wl4L2DQK7sLoPRtOnK/Xnq7WUObq6x/PxXx/JtuRDjjwuGk2UvxevpEuwtylW41PMhln72G+DZLNh0TzSn7i4qtlZbMLyyLpK3LaGjNFZvJDie2mH0gk7AAAAAADcz7MevwWG5l3uGgYAAADAe0Pq49idCabpRCUfAAAAAAAAAAAAAAAAwDNgHkPWtbZ7tXwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAf/wPIoNlUjXiD0QAAAABJRU5ErkJggg==" alt="" />

然后决定删除这两个文件,再次刷新dashboard的url,很神奇的是work了,同时也发现该目录下新产生了这两个文件,并且权限和上图一样。

这个问题误打误撞的解决了,但是在操作openstack过程中发现openstack很不稳定,有的功能开始是好的,过一两天就不好用了,或是装一个东西怎么也装不上,然后多重装几次就好了,还是不明白其中的原因,但是要多学习,多探索! ^_^