On 10/31/06, Dan Williams <dcbw(a)redhat.com> wrote:
can you insert the extra print to find out what the error is?
except socket.error, e:
if e[0] == 98: # Address already in use
print "Error: couldn't bind to address '%s:%s'. Is the
server already running?" % (hostname, port)
os._exit(1)
print "Other error: %s" % e
Obviously there should be a catch-all there so this wouldn't happen, but
I'm curious what the error is.
Here is the surprising answer to the problem... I added the print
statement and got (-2, 'Name or service not known'). That sort of
surprised me because I was running with host=localhost. I tried
pinging localhost and sure enough, the name couldn't be resolved. It
turns out that FC6 has this little gem in /etc/hosts:
::1 localhost.localdomain localhost
I changed it to 127.0.0.1 and the problem went away. Frankly I'm kind
of surprised that IPv6 didn't just work anyway... I guess this is a
bug for someone else though ;-)