-1

I'm currently attempting to setup a SiriServer (that's beside the point) on Xubuntu 12.10 x64, when I run the server python returns error

socket.error: [Errno 98] Address already in use.

The server by default is attempting to run on port 443, which unfortunetly is required in order for this application to work.

To double check if anything is running on port 443, I execute the following:

lsof -i :443

There's no results, unless I have something like Chrome or Firefox open, which I end up closing. Here's the full return from attempting to run the server application.

dustin@dustin-xubuntu:~/Applications/SiriServer$ sudo python siriServer.py
CRITICAL load_plugins Failed loading plugin due to missing module: 'Wordnik library not found. Please install wordnik library! e.g. sudo easy_install wordnik'
INFO <module> Starting Server
Traceback (most recent call last):
  File "siriServer.py", line 493, in <module>
    server = SiriServer('', options.port)
  File "siriServer.py", line 425, in __init__
    self.bind((host, port))
  File "/usr/lib/python2.7/asyncore.py", line 342, in bind
    return self.socket.bind(addr)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 98] Address already in use

I'm stuck on what to do, as this is the last part of setting up this application. Any help is appreciated.

Dustin
  • 101
  • 1
  • 1
  • 5

2 Answers2

2

Have you tried netstat -an | grep LISTEN ? to see if anything else is listening on this port. Also of note 443 is < 1024 so to bind to that port you would need to be running this command as root.

trent
  • 3,094
  • 18
  • 17
  • However, if you check with netstat first if the port is available before attempting to bind the port there can be an race condition if some other process binds the port between the time where netstat was executed and when python tries to bind the port. This can most often be ignored since it's a really rare case, but it's possible. – Johan Bjäreholt Jan 18 '19 at 10:21
0

Make sure to run the lsof -i :443 as root. Alternately, run as a non-privileged user

netstat -ant | grep :443

to at least see if something is on that port.

You could also make sure you are checking for the correct port by strategically adding

print options.port prior to the call to SiriServer(...)