openstack-dashboard E: Sub-process /usr/bin/dpkg returned an error code (1)

asked 2017-07-23 14:27:51 -0500

Costas gravatar image

Hello,

I am a new member of Openstack and of course I have some problems.

I try to install openstack newton on my laptop using Ubuntu 16.04.

-Intel i7 -16Gb Ram -1TB hard disk

I followed the steps from this tutorial https://docs.openstack.org/newton/install-guide-ubuntu/horizon-install.html (https://docs.openstack.org/newton/ins...), properly I think (all services are up and running).

When I tried to Verify operation using http://controller/horizon or http://localhost/horizon or http://my_IP/horizon, I get the same error "500 Internal Server Error".

I did some changes like chmod of secret_key to 777 (I do not know how to bring back) and final I desided to uninstall it and install again but I have no success because I get the error below during the installation.

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)

Is there any solution or workaround to work properly?

Thanks, Costas

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2017-07-23 22:43:51 -0500

updated 2017-07-23 22:46:27 -0500

From the apt install output:

openstack-dashboard is already the newest version (3:11.0.2-0ubuntu1~cloud0).

Could it be that you didn't uninstall it properly?

horizon.utils.secret_key.FilePermissionError: Insecure permissions on key file /var/lib/openstack-dashboard/secret_key, should be 0600.

It seems to me that the permissions of this file were set incorrectly in the previous installation. This might well have been the cause of the HTTP 500. Why don't you chmod 600 and try again?

edit flag offensive delete link more

Comments

Hello Bernd Bausch, I changed the permissions to 600 and I installed the openstack-dashboard, then reconfigured the local_settings.py, reload the apache2 service and I tried to verify the operation. Unfortunately I got internal server error 500.

Costas gravatar imageCostas ( 2017-07-24 16:05:56 -0500 )edit

Similar problem, with solution, here: https://ask.openstack.org/en/question...

Changing ownership of secret_key fixed that particular problem.

Why wrong ownership? That's a different question :)

Bernd Bausch gravatar imageBernd Bausch ( 2017-07-24 20:37:50 -0500 )edit

You may also try deleting the secret_key file. Judging from the code, Horizon will create the file if it doesn't exist. Of course, then the permissions of the directory must be correct.

Bernd Bausch gravatar imageBernd Bausch ( 2017-07-24 20:41:45 -0500 )edit

I would like to thank you for your efforts!!!!

The problem solved:-)

So, I set permissions horizon:horizon because were root:root but I had the same problem. Continually I followed the steps below:

Costas gravatar imageCostas ( 2017-07-25 15:14:10 -0500 )edit

Delete the secret_key, uninstall the openstack-dashboard, reboot the server and reinstall again Edit the /etc/openstack-dashboard/local_settings.py file -> sudo chown -R www-data:www-data /var/lib/openstack-dashboard/secret_key -> Edit the /etc/apache2/conf-available/openstack-dashboard.conf file->

Costas gravatar imageCostas ( 2017-07-25 15:15:29 -0500 )edit
0

answered 2017-07-24 16:06:54 -0500

Costas gravatar image

Hello.

I changed the permissions to 600 and I installed the openstack-dashboard, then reconfigured the local_settings.py, reload the apache2 service and I tried to verify the operation. Unfortunately I got internal server error 500.

root@Controller:~# wget http://controller/horizon --2017-07-24 23:59:19-- http://controller/horizon Resolving controller (controller)... 172.16.10.231 Connecting to controller (controller)|172.16.10.231|:80... connected. HTTP request sent, awaiting response... 500 Internal Server Error 2017-07-24 23:59:19 ERROR 500: Internal Server Error.

root@Controller:~# wget http://localhost/horizon --2017-07-24 23:59:23-- http://localhost/horizon Resolving localhost (localhost)... ::1, 127.0.0.1 Connecting to localhost (localhost)|::1|:80... connected. HTTP request sent, awaiting response... 500 Internal Server Error 2017-07-24 23:59:23 ERROR 500: Internal Server Error.

root@Controller:~# wget http://172.16.10.231/horizon --2017-07-24 23:59:25-- http://172.16.10.231/horizon Connecting to 172.16.10.231:80... connected. HTTP request sent, awaiting response... 500 Internal Server Error 2017-07-24 23:59:25 ERROR 500: Internal Server Error.

The logs from error.log are below..

[Mon Jul 24 23:59:19.501360 2017] [wsgi:error] [pid 6094:tid 140080935548672] [remote 172.16.10.231:65320] mod_wsgi (pid=6094): Target WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi' cannot be loaded as Python module. [Mon Jul 24 23:59:19.501380 2017] [wsgi:error] [pid 6094:tid 140080935548672] [remote 172.16.10.231:65320] mod_wsgi (pid=6094): Exception occurred processing WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi'. [Mon Jul 24 23:59:19.501394 2017] [wsgi:error] [pid 6094:tid 140080935548672] [remote 172.16.10.231:65320] Traceback (most recent call last): [Mon Jul 24 23:59:19.501406 2017] [wsgi:error] [pid 6094:tid 140080935548672] [remote 172.16.10.231:65320] File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi", line 16, in <module> [Mon Jul 24 23:59:19.501422 2017] [wsgi:error] [pid 6094:tid 140080935548672] [remote 172.16.10.231:65320] application = get_wsgi_application() [Mon Jul 24 23:59:19.501427 2017] [wsgi:error] [pid 6094:tid 140080935548672] [remote 172.16.10.231:65320] File "/usr/lib/python2.7/dist-packages/django/core/wsgi.py", line 14, in get_wsgi_application [Mon Jul 24 23:59:19.501436 2017] [wsgi:error] [pid 6094:tid 140080935548672] [remote 172.16.10.231:65320] django.setup() [Mon Jul 24 23:59:19.501448 2017] [wsgi:error] [pid 6094:tid 140080935548672] [remote 172.16.10.231:65320] File "/usr/lib/python2.7/dist-packages/django/__init__.py", line 17, in setup [Mon Jul 24 23:59:19.501455 2017] [wsgi:error] [pid 6094:tid 140080935548672] [remote 172.16.10.231:65320] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) [Mon Jul 24 23:59:19.501459 2017] [wsgi:error] [pid 6094:tid 140080935548672] [remote 172.16.10.231:65320] File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 48, in __getattr__ [Mon Jul 24 23:59:19.501466 2017] [wsgi:error] [pid 6094:tid 140080935548672] [remote 172.16.10 ... (more)

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2017-07-23 14:27:51 -0500

Seen: 554 times

Last updated: Jul 24 '17