openstack-dashboard 安装 - 通过 apt 设置返回许多 python 错误,包括“不安全的权限”

openstack-dashboard 安装 - 通过 apt 设置返回许多 python 错误,包括“不安全的权限”

我是Openstack的新成员,当然我遇到了一些问题。

我尝试使用 Ubuntu 16.04 在我的笔记本电脑上安装 openstack newton。

  • 英特尔 i7
  • 16GB 内存
  • 1TB 硬盘

我按照以下步骤进行操作本教程,我认为正确(所有服务均已正常运行)。

http://controller/horizon当我尝试使用或 http:// localhost/horizo​​n 或验证操作时http://my_IP/horizon,我得到了同样的错误

500 Internal Server Error

我做了一些类似的更改(chmod我不知道如何恢复),最后我决定卸载它并再次安装,但我没有成功,因为我在安装过程中出现以下错误。secret_key777

root@Controller:~# apt install openstack-dashboard 
Reading package lists... Done 
Building dependency tree 
Reading state information... Done 
openstack-dashboard is already the newest version (3:11.0.2-0ubuntu1~cloud0). 
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 
1 not fully installed or removed. 
After this operation, 0 B of additional disk space will be used. 
Do you want to continue? [Y/n] y 
Setting up openstack-dashboard (3:11.0.2-0ubuntu1~cloud0) ... Collecting and compressing static assets... 

Traceback (most recent call last): 
File "manage.py", line 25, in <module> execute_from_command_line(sys.argv) 
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line utility.execute() 
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 303, in execute settings.INSTALLED_APPS 
File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 48, in __getattr__ self._setup(name) 
File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 44, in _setup self._wrapped = Settings(settings_module) 
File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 92, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) 
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) 
File "/usr/share/openstack-dashboard/openstack_dashboard/settings.py", line 335, in <module> from local.local_settings import * # noqa 
File "/usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py", line 125, in <module> SECRET_KEY = secret_key.generate_or_read_from_file('/var/lib/openstack-dashboard/secret_key') 
File "/usr/share/openstack-dashboard/horizon/utils/secret_key.py", line 70, in generate_or_read_from_file key = read_from_file(key_file) 
File "/usr/share/openstack-dashboard/horizon/utils/secret_key.py", line 51, in read_from_file os.path.abspath(key_file)) horizon.utils.secret_key.FilePermissionError: Insecure permissions on key file /var/lib/openstack-dashboard/secret_key, should be 0600. 
dpkg: error processing package openstack-dashboard (--configure): subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing: openstack-dashboard 
E: Sub-process /usr/bin/dpkg returned an error code (1)

有什么解决方案或解决方法可以解决这个问题吗?

答案1

你(几乎)已经得到了答案:

密钥文件的权限不安全/var/lib/openstack-dashboard/secret_key,应该0600

  1. 在指示的文件上设置给定的权限掩码:

    sudo chmod 0600 /var/lib/openstack-dashboard/secret_key
    
  2. 配置半安装的包:

    sudo apt-get install -f
    

相关内容