Ask Your Question
0

swift-init all start unable to bind to port

asked 2014-03-18 12:38:26 -0500

updated 2014-03-18 12:39:52 -0500

I ran swift-init all start on an allinone installation done on Ubuntu using devstack.

It is failing while trying to start the object-server with the following error:

Traceback (most recent call last):
  File "/usr/local/bin/swift-proxy-server", line 7, in <module>
    execfile(__file__)
  File "/opt/stack/swift/bin/swift-proxy-server", line 23, in <module>
    sys.exit(run_wsgi(conf_file, 'proxy-server', default_port=8080, **options))
  File "/opt/stack/swift/swift/common/wsgi.py", line 379, in run_wsgi
    sock = get_socket(conf, default_port=kwargs.get('default_port', 8080))
  File "/opt/stack/swift/swift/common/wsgi.py", line 171, in get_socket
    bind_addr[0], bind_addr[1], bind_timeout))
Exception: Could not bind to 0.0.0.0:8080 after trying for 30 seconds


Traceback (most recent call last):
  File "/usr/local/bin/swift-container-server", line 7, in <module>
    execfile(__file__)
  File "/opt/stack/swift/bin/swift-container-server", line 24, in <module>
    'container-server', default_port=6001, **options))
  File "/opt/stack/swift/swift/common/wsgi.py", line 379, in run_wsgi
    sock = get_socket(conf, default_port=kwargs.get('default_port', 8080))
  File "/opt/stack/swift/swift/common/wsgi.py", line 171, in get_socket
    bind_addr[0], bind_addr[1], bind_timeout))
Exception: Could not bind to 0.0.0.0:6011 after trying for 30 seconds


Traceback (most recent call last):
  File "/usr/local/bin/swift-account-server", line 7, in <module>
    execfile(__file__)
  File "/opt/stack/swift/bin/swift-account-server", line 24, in <module>
    'account-server', default_port=6002, **options))
  File "/opt/stack/swift/swift/common/wsgi.py", line 379, in run_wsgi
    sock = get_socket(conf, default_port=kwargs.get('default_port', 8080))
  File "/opt/stack/swift/swift/common/wsgi.py", line 171, in get_socket
    bind_addr[0], bind_addr[1], bind_timeout))
Exception: Could not bind to 0.0.0.0:6012 after trying for 30 seconds


Traceback (most recent call last):
  File "/usr/local/bin/swift-object-server", line 7, in <module>
    execfile(__file__)
  File "/opt/stack/swift/bin/swift-object-server", line 27, in <module>
    **options))
  File "/opt/stack/swift/swift/common/wsgi.py", line 379, in run_wsgi
    sock = get_socket(conf, default_port=kwargs.get('default_port', 8080))
  File "/opt/stack/swift/swift/common/wsgi.py", line 171, in get_socket
    bind_addr[0], bind_addr[1], bind_timeout))
Exception: Could not bind to 0.0.0.0:6013 after trying for 30 seconds

Any idea what is going on here?

edit retag flag offensive close merge delete

Comments

I guess the ports are already in use. Can you check if the service(s) are already running. Also, check which process are listening on the port (I usually check it using 'netstat -pan |grep <port-no>' command).

unmesh-gurjar gravatar imageunmesh-gurjar ( 2014-03-19 01:33:34 -0500 )edit

Already tried that. The ports are not in use.

mithilarun gravatar imagemithilarun ( 2014-03-19 07:49:58 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-03-19 09:18:54 -0500

SamYaple gravatar image

Some things to look at:

  1. Something is already bound to that port, run netstat -plnt to find out what.

  2. Some swift process has been orphaned and is still running on that port (but not showing up with netstat? doesn't seem likely)

  3. You have multiple conf files in your swift directory all using the same bind address.

My vote is on option 3 because you said netstat doesn't show the ports in use, but clearly a swift process cannot bind them. Thus leading me to think one gets bound, the other fails, then everything terminates on error.

edit flag offensive delete link more

Comments

I am hitting the same issue but neither of the 3 situations you suggested seem to be my case.

It seems that the actual PID where swift is running is different from the PID in /var/run/swift. So swift-init thinks the proxy server isn't running (but it is, and listening on that port). Any ideas? Thx

phillipviana gravatar imagephillipviana ( 2016-01-20 10:33:50 -0500 )edit

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-03-18 12:38:26 -0500

Seen: 2,513 times

Last updated: Mar 19 '14