listen on localhost:8000: [Errno 98] Address already in use.

1,351 views
Skip to first unread message

Sameer Regmi

unread,
Nov 20, 2009, 4:10:37 PM11/20/09
to codenode-devel
I installed codenode, and when I do
$ codenode-admin run

I get error message :
2009-11-20 13:05:02-0800 [-] twisted.internet.error.CannotListenError:
Couldn't listen on localhost:8000: [Errno 98] Address already in use.

Could you let me know how I can solve this.

Full traceback:

sameer@tahoe:~/all/codenode/mycodenode$ codenode-admin run
/home/sameer/usr/lib/python/Twisted-8.2.0-py2.6-linux-x86_64.egg/
twisted/persisted/sob.py:12: DeprecationWarning: the md5 module is
deprecated; use hashlib instead
import os, md5, sys
/home/sameer/usr/lib/python/Twisted-8.2.0-py2.6-linux-x86_64.egg/
twisted/python/filepath.py:12: DeprecationWarning: the sha module is
deprecated; use the hashlib module instead
import sha
Removing stale pidfile /home/sameer/all/codenode/mycodenode/twistd.pid
2009-11-20 13:05:02-0800 [-] Log opened.
2009-11-20 13:05:02-0800 [-] twistd 8.2.0 (/usr/bin/python 2.6.2)
starting up.
2009-11-20 13:05:02-0800 [-] reactor class:
twisted.internet.selectreactor.SelectReactor.
2009-11-20 13:05:02-0800 [-] Traceback (most recent call last):
2009-11-20 13:05:02-0800 [-] File "/home/sameer/usr/bin/twistd",
line 5, in <module>
2009-11-20 13:05:02-0800 [-] pkg_resources.run_script
('Twisted==8.2.0', 'twistd')
2009-11-20 13:05:02-0800 [-] File "/usr/lib/python2.6/dist-packages/
pkg_resources.py", line 448, in run_script
2009-11-20 13:05:02-0800 [-] self.require(requires)[0].run_script
(script_name, ns)
2009-11-20 13:05:02-0800 [-] File "/usr/lib/python2.6/dist-packages/
pkg_resources.py", line 1166, in run_script
2009-11-20 13:05:02-0800 [-] execfile(script_filename, namespace,
namespace)
2009-11-20 13:05:02-0800 [-] File "/home/sameer/usr/lib/python/
Twisted-8.2.0-py2.6-linux-x86_64.egg/EGG-INFO/scripts/twistd", line
21, in <module>
2009-11-20 13:05:02-0800 [-] run()
2009-11-20 13:05:02-0800 [-] File "/home/sameer/usr/lib/python/
Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/scripts/twistd.py", line
27, in run
2009-11-20 13:05:02-0800 [-] app.run(runApp, ServerOptions)
2009-11-20 13:05:02-0800 [-] File "/home/sameer/usr/lib/python/
Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/application/app.py", line
694, in run
2009-11-20 13:05:02-0800 [-] runApp(config)
2009-11-20 13:05:02-0800 [-] File "/home/sameer/usr/lib/python/
Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/scripts/twistd.py", line
23, in runApp
2009-11-20 13:05:02-0800 [-] _SomeApplicationRunner(config).run()
2009-11-20 13:05:02-0800 [-] File "/home/sameer/usr/lib/python/
Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/application/app.py", line
423, in run
2009-11-20 13:05:02-0800 [-] self.postApplication()
2009-11-20 13:05:02-0800 [-] File "/home/sameer/usr/lib/python/
Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/scripts/_twistd_unix.py",
line 206, in postApplication
2009-11-20 13:05:02-0800 [-] self.startApplication
(self.application)
2009-11-20 13:05:02-0800 [-] File "/home/sameer/usr/lib/python/
Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/scripts/_twistd_unix.py",
line 311, in startApplication
2009-11-20 13:05:02-0800 [-] service.IService
(application).privilegedStartService()
2009-11-20 13:05:02-0800 [-] File "/home/sameer/usr/lib/python/
Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/application/service.py",
line 273, in privilegedStartService
2009-11-20 13:05:02-0800 [-] service.privilegedStartService()
2009-11-20 13:05:02-0800 [-] File "/home/sameer/usr/lib/python/
Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/application/service.py",
line 273, in privilegedStartService
2009-11-20 13:05:02-0800 [-] service.privilegedStartService()
2009-11-20 13:05:02-0800 [-] File "/home/sameer/usr/lib/python/
Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/application/internet.py",
line 85, in privilegedStartService
2009-11-20 13:05:02-0800 [-] self._port = self._getPort()
2009-11-20 13:05:02-0800 [-] File "/home/sameer/usr/lib/python/
Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/application/internet.py",
line 116, in _getPort
2009-11-20 13:05:02-0800 [-] *self.args, **self.kwargs)
2009-11-20 13:05:02-0800 [-] File "/home/sameer/usr/lib/python/
Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/internet/posixbase.py",
line 356, in listenTCP
2009-11-20 13:05:02-0800 [-] p.startListening()
2009-11-20 13:05:02-0800 [-] File "/home/sameer/usr/lib/python/
Twisted-8.2.0-py2.6-linux-x86_64.egg/twisted/internet/tcp.py", line
858, in startListening
2009-11-20 13:05:02-0800 [-] raise CannotListenError,
(self.interface, self.port, le)
2009-11-20 13:05:02-0800 [-] twisted.internet.error.CannotListenError:
Couldn't listen on localhost:8000: [Errno 98] Address already in use.

Alex Clemesha

unread,
Nov 23, 2009, 3:31:18 AM11/23/09
to codenod...@googlegroups.com
On Fri, Nov 20, 2009 at 1:10 PM, Sameer Regmi <reg...@gmail.com> wrote:
I installed codenode, and when I do
$ codenode-admin run

I get error message :
2009-11-20 13:05:02-0800 [-] twisted.internet.error.CannotListenError:
Couldn't listen on localhost:8000: [Errno 98] Address already in use.

Could you let me know how I can solve this.

You already have another program listening on the port "8000".
Maybe another running Codenode instance? Just stop that one and
start the other.


To choose another port, you have to use "twistd', which "codenode-admin"
is a wrapper of (I consider this a bug / missing feature, and we'll fix this).
If you want to use twistd right now, I can explain how to do that if needed.



-Alex




 



--
Alex Clemesha
clemesha.org

Sameer Regmi

unread,
Nov 23, 2009, 3:35:01 AM11/23/09
to codenod...@googlegroups.com
On Mon, Nov 23, 2009 at 12:31 AM, Alex Clemesha <clem...@gmail.com> wrote:


On Fri, Nov 20, 2009 at 1:10 PM, Sameer Regmi <reg...@gmail.com> wrote:
I installed codenode, and when I do
$ codenode-admin run

I get error message :
2009-11-20 13:05:02-0800 [-] twisted.internet.error.CannotListenError:
Couldn't listen on localhost:8000: [Errno 98] Address already in use.

Could you let me know how I can solve this.

You already have another program listening on the port "8000".
Maybe another running Codenode instance? Just stop that one and
start the other.
Yes we have another program (website) listening on that port and I should not stop that so I need to choose another port.


To choose another port, you have to use "twistd', which "codenode-admin"
is a wrapper of (I consider this a bug / missing feature, and we'll fix this).
If you want to use twistd right now, I can explain how to do that if needed.
Yes, could you explain that to me. Thank you very much.

Alex Clemesha

unread,
Nov 23, 2009, 3:52:59 AM11/23/09
to codenod...@googlegroups.com
On Mon, Nov 23, 2009 at 12:35 AM, Sameer Regmi <reg...@gmail.com> wrote:
On Mon, Nov 23, 2009 at 12:31 AM, Alex Clemesha <clem...@gmail.com> wrote:


On Fri, Nov 20, 2009 at 1:10 PM, Sameer Regmi <reg...@gmail.com> wrote:
I installed codenode, and when I do
$ codenode-admin run

I get error message :
2009-11-20 13:05:02-0800 [-] twisted.internet.error.CannotListenError:
Couldn't listen on localhost:8000: [Errno 98] Address already in use.

Could you let me know how I can solve this.

You already have another program listening on the port "8000".
Maybe another running Codenode instance? Just stop that one and
start the other.
Yes we have another program (website) listening on that port and I should not stop that so I need to choose another port.


To choose another port, you have to use "twistd', which "codenode-admin"
is a wrapper of (I consider this a bug / missing feature, and we'll fix this).
If you want to use twistd right now, I can explain how to do that if needed.
Yes, could you explain that to me. Thank you very much.

I just remembered an easier way of changing ports is to edit the "APP_PORT" settings option
in the file "frontend/settings.py" in the directory that is create when you did
"codenode-admin init -name mycodenode".


The better way is for someone to improve this function:
http://github.com/codenode/codenode/blob/master/codenode/management/commands.py#L50
to allow the passing of the frontend port. It could be a fairly easy first patch if you feel up
to it :-) - else just use the settings file.


-Alex





 



--
Alex Clemesha
clemesha.org

Sameer Regmi

unread,
Nov 23, 2009, 7:55:38 PM11/23/09
to codenod...@googlegroups.com
On Mon, Nov 23, 2009 at 12:52 AM, Alex Clemesha <clem...@gmail.com> wrote:


On Mon, Nov 23, 2009 at 12:35 AM, Sameer Regmi <reg...@gmail.com> wrote:
On Mon, Nov 23, 2009 at 12:31 AM, Alex Clemesha <clem...@gmail.com> wrote:


On Fri, Nov 20, 2009 at 1:10 PM, Sameer Regmi <reg...@gmail.com> wrote:
I installed codenode, and when I do
$ codenode-admin run

I get error message :
2009-11-20 13:05:02-0800 [-] twisted.internet.error.CannotListenError:
Couldn't listen on localhost:8000: [Errno 98] Address already in use.

Could you let me know how I can solve this.

You already have another program listening on the port "8000".
Maybe another running Codenode instance? Just stop that one and
start the other.
Yes we have another program (website) listening on that port and I should not stop that so I need to choose another port.


To choose another port, you have to use "twistd', which "codenode-admin"
is a wrapper of (I consider this a bug / missing feature, and we'll fix this).
If you want to use twistd right now, I can explain how to do that if needed.
Yes, could you explain that to me. Thank you very much.

I just remembered an easier way of changing ports is to edit the "APP_PORT" settings option
in the file "frontend/settings.py" in the directory that is create when you did
"codenode-admin init -name mycodenode".
Thank you, that solved the problem.
Reply all
Reply to author
Forward
0 new messages