Ask Your Question
1

Devstack fails to start apache2 - "Address already in use" : "could not bind to address"

asked 2014-09-09 18:26:53 -0500

patriotemeritus gravatar image

updated 2014-09-10 01:56:46 -0500

Tried to install devstack icehouse on Ubuntu 14.04 with the following "localrc" file:

DEST=/opt/stack

# Logging
LOGFILE=$DEST/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=False
SCREEN_LOGDIR=$DEST/logs/screen

# Credentials
ADMIN_PASSWORD=openstack
MYSQL_PASSWORD=openstack
RABBIT_PASSWORD=openstack
SERVICE_PASSWORD=openstack
SERVICE_TOKEN=tokentoken

# Github's Branch
GLANCE_BRANCH=stable/icehouse
HORIZON_BRANCH=stable/icehouse
KEYSTONE_BRANCH=stable/icehouse
NOVA_BRANCH=stable/icehouse
NEUTRON_BRANCH=stable/icehouse
HEAT_BRANCH=stable/icehouse
CEILOMETER_BRANCH=stable/icehouse

# Neutron - Networking Service
DISABLED_SERVICES=n-net
ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta,q-metering,neutron

# Neutron - Load Balancing
ENABLED_SERVICES+=,q-lbaas

# Heat - Orchestration Service
ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
HEAT_STANDALONE=True

# Ceilometer - Metering Service (metering + alarming)
ENABLED_SERVICES+=,ceilometer-acompute,ceilometer-acentral,ceilometer-collector,ceilometer-api
ENABLED_SERVICES+=,ceilometer-alarm-notify,ceilometer-alarm-eval

All seems to be going well until Horizon /Apache are being started up, then the following error appears: "(98)Address already in use: AH00072: make_sock: could not bind to address [::]:5000" and i can't seem to figure out what's causing it.

Any ideas on what could be causing this problem, or how to solve it? I've come across something related to this being a bug here ( https://bugs.launchpad.net/devstack/+bug/1340660 (https://bugs.launchpad.net/devstack/+...) ) but i'm not entirely sure it's the same thing and also I don't see a solution yet

NB: The process behind port 5000, in my case is python (...and i have no idea why). If i kill it and restart apache, i can get to the horizon log-in page, but i can't log in with the given credentials.

The installation log where the error appears is below. The apache2 error logs are actually empty.

2014-09-09 23:02:39.113 | + start_horizon
2014-09-09 23:02:39.113 | + restart_apache_server
2014-09-09 23:02:39.113 | + restart_service apache2
2014-09-09 23:02:39.113 | + is_ubuntu
2014-09-09 23:02:39.113 | + [[ -z deb ]]
2014-09-09 23:02:39.113 | + '[' deb = deb ']'
2014-09-09 23:02:39.114 | + sudo /usr/sbin/service apache2 restart
2014-09-09 23:02:39.124 |  * Restarting web server apache2
2014-09-09 23:02:39.231 | (98)Address already in use: AH00072: make_sock: could not bind to address [::]:5000
2014-09-09 23:02:39.231 | (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:5000
2014-09-09 23:02:39.232 | no listening sockets available, shutting down
2014-09-09 23:02:39.232 | AH00015: Unable to open logs
2014-09-09 23:02:39.245 | Action 'start' failed.
2014-09-09 23:02:39.245 | The Apache error log may have more information.
2014-09-09 23:02:59.335 |    ...fail!
2014-09-09 23:02:59.336 |  * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
2014-09-09 23:02:59.336 | + exit_trap
2014-09-09 23:02:59.336 | + local r=1
2014-09-09 23:02:59.337 | ++ jobs -p
2014-09-09 23:02:39.113 | + '[' deb = deb ']'
2014-09-09 23:02:39.114 | + sudo /usr/sbin/service apache2 restart
2014-09-09 23:02:39.124 |  * Restarting web server apache2
2014-09-09 23:02:39.231 | (98)Address already in use: AH00072: make_sock: could not bind ...
(more)
edit retag flag offensive close merge delete

Comments

there must be another app using same port try to use different port.

SGPJ gravatar imageSGPJ ( 2014-09-09 18:56:54 -0500 )edit

Yes as I mentioned in the post, python is the process behind port 5000, but python ends up on that port on account of the devstack setup. I'm not entirely sure why Apache is trying to bind to port 5000, shouldn't it be binding to 80? (I'm sort of a noob to openstack so i may get things wrong)

patriotemeritus gravatar imagepatriotemeritus ( 2014-09-09 19:35:15 -0500 )edit

4 answers

Sort by ยป oldest newest most voted
1

answered 2014-09-10 02:41:18 -0500

SGPJ gravatar image

Refer to /opt/stack/horizon/doc/source/quickstart.rst and openstack_dashboard/local/local_settings.py for port 80

Edit below horizon.conf file to port 80 and restart by:

 sudo service apache2 restart

File /etc/apache2/sites-available/horizon.conf

<VirtualHost *:80>
    WSGIScriptAlias / /opt/stack/horizon/openstack_dashboard/wsgi/django.wsgi
    WSGIDaemonProcess horizon user=os group=os processes=3 threads=10 home=/opt/stack/horizon
    WSGIApplicationGroup %{GLOBAL}

    SetEnv APACHE_RUN_USER os
    SetEnv APACHE_RUN_GROUP os
    WSGIProcessGroup horizon

    DocumentRoot /opt/stack/horizon/.blackhole/
    Alias /media /opt/stack/horizon/openstack_dashboard/static

    <Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>

    <Directory /opt/stack/horizon/>
        Options Indexes FollowSymLinks MultiViews

        AllowOverride None
        Order allow,deny
        allow from all
        Require all granted
    </Directory>

    ErrorLog /var/log/apache2/horizon_error.log
    LogLevel warn
    CustomLog /var/log/apache2/horizon_access.log combined
</VirtualHost>

WSGISocketPrefix /var/run/apache2
edit flag offensive delete link more

Comments

Unfortunately in my horizon.conf file it already indicates port 80.

patriotemeritus gravatar imagepatriotemeritus ( 2014-09-16 06:39:45 -0500 )edit
1

answered 2016-06-23 14:22:02 -0500

hk gravatar image

In some case of openstack gives this error because port describe in file "/etc/httpd/conf.d/wsgi-keystone.conf" is same as keystone endpoint URL port. so it conflict and both keystone and httpd service not start simultaneously.

for its if you change port of keystone endpoint then you would require to change in lots of other openstack service config file

so change port 5000 to 5001 and 35357 to 35358 in file "/etc/httpd/conf.d/wsgi-keystone.conf".and reboot. then both service will work simultaneouly in above file if you set to port 80 then it will conflict with "/etc/httpd/conf/httpd.conf". so kindly change as above then it work work.

edit flag offensive delete link more
0

answered 2016-08-07 04:55:14 -0500

Afaque gravatar image

updated 2016-08-07 04:56:55 -0500

In some cases this issue comes due to blocking by firewall or SElinux.

For SElinux check, it should be Permissive. $getenforce (output should be Permissive)

If it is not, make it Permissive $setenforce 0 (temporary allow )

And dissable iptables $service stop iptables

Then restart apache service $service apache2 restart

edit flag offensive delete link more
0

answered 2014-09-16 12:38:27 -0500

patriotemeritus gravatar image

The answer I eventually found that solved my problem:

  • Keystone is actually the rogue process that is sitting on port 5000.
  • The "unstack.sh" in the latest master in the stable/icehouse that i have, is not entirely undoing the stacking process of the previous icehouse that was in place. It does not clean everything off from the previous devstack (icehouse stable from 4 months ago) that was running on the system. Particularly, cleaning up the keystone process running at port 5000 was not being done by this "unstack.sh". (NB: No amount of unstacking with the newer devstack icehouse will remove all traces properly of an older devstack because the scripts seem to be different. Even using the "clean.sh" didn't do the trick).
  • In the current version of icehouse, keystone is now being started up by apache, that's why apache is seen to be trying to bind to port 5000

The fix itself that worked for me was to remove the "keystone.conf" and recreate a blank one in it's place:

sudo rm /etc/apache2/sites-available/keystone.conf
sudo touch /etc/apache2/sites-available/keystone.conf

The ./unstack.sh, ./clean.sh, remove all traces of mysql (as described here: http://stackoverflow.com/questions/10853004/removing-mysql-5-5-completely (http://stackoverflow.com/questions/10...) ) ... and finally ./stack.sh again

The reason why i created an empty keystone.conf file was that when i removed it and "unstacked" and "stacked" again, for some reason a new "keystone.conf" file was not being created. The devstack installation script would just stop and throw some error about not being able to find the "keystone.conf" at the aforementioned location. Creating an empty one seems to have done the trick. I guess emptying the original keystone.conf might produce the same result as what i've done here.

You can read more about this problem and some parts of the solution here: https://bugs.launchpad.net/devstack/+bug/1340660 (https://bugs.launchpad.net/devstack/+...)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-09-09 18:26:53 -0500

Seen: 6,352 times

Last updated: Aug 07 '16