Port in use Error

1,718 views
Skip to first unread message

TP

unread,
Mar 16, 2009, 1:08:21 PM3/16/09
to Django users
After creating a new project, when running manage.py i get the
following:


Validating models...
0 errors found

Django version 1.0.2 final, using settings 'mylu.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Error: That port is already in use.



Despite saying 0 errors at the top, is this still a problem?

Dougal Matthews

unread,
Mar 16, 2009, 1:13:42 PM3/16/09
to django...@googlegroups.com
It means another program is using the port you are trying to use. Do you have another server running? or skype by any chance?

If you can still view the website in the browser, its not a problem. If you can't you should use another port or close the program using the same port.

Dougal

---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/




2009/3/16 TP <tomMi....@gmail.com>

TP

unread,
Mar 16, 2009, 1:16:01 PM3/16/09
to Django users
Unfortunately the website doesnt work, just get a blank web page.

Im working from a University computer so im guessing it may be due to
that problem as I have no other programs running apart from Firefox

On Mar 16, 5:13 pm, Dougal Matthews <douga...@gmail.com> wrote:
> It means another program is using the port you are trying to use. Do you
> have another server running? or skype by any chance?
> If you can still view the website in the browser, its not a problem. If you
> can't you should use another port or close the program using the same port.
>
> Dougal
>
> ---
> Dougal Matthews - @d0ugalhttp://www.dougalmatthews.com/
>
> 2009/3/16 TP <tomMi.pres...@gmail.com>
>
>
>
> > After creating a new project, when running manage.py i get the
> > following:
>
> > Validating models...
> > 0 errors found
>
> > Django version 1.0.2 final, using settings 'mylu.settings'
> > Development server is running athttp://127.0.0.1:8000/

Daniel Roseman

unread,
Mar 16, 2009, 2:35:33 PM3/16/09
to Django users
On Mar 16, 5:16 pm, TP <tomMi.pres...@gmail.com> wrote:
> Unfortunately the website doesnt work, just get  a blank web page.
>
> Im working from a University computer so im guessing it may be due to
> that problem as I have no other programs running apart from Firefox
>

So use a different port number - eg
./manage.py runserver 127.0.0.1:8001
--
DR.

gordyt

unread,
Mar 17, 2009, 12:11:34 PM3/17/09
to Django users
TP I don't know if this applies to your situation or not, but...

On an app I'm currently writing I'm using UUID primary keys for some
of the models. When creating a new instance of one of those models,
say through the admin interface, the development server will start up
an instance of a process called "uuidd" (UUID generation daemon).

If I stop the development server and then start it again, sometimes I
get the same error that you reported. This is due to the uuidd
process having a socket connection stuck open to port 8000. I just
have to kill the uuidd process (sudo killall uuidd) to fix the issue.

Again, this is kind of a stretch as I do not know the details of your
app, but just something to consider. You can find out if there are
any processes using port 8000 very easily as follows:

sudo netstat -np | grep 8000

(This is on Ubuntu linux)

--gordon

TP

unread,
Mar 17, 2009, 12:17:00 PM3/17/09
to Django users
gordyt

Thanks this does help, I managed to overcome this problem yesterday,
but was still slightly confused as to
why I had the error in the first place, this helps me understand!

Thanks

pcastellazzi

unread,
Mar 26, 2009, 3:25:38 PM3/26/09
to Django users
The python uuid library use libuuid from e2fsprogs (at least in
ubuntu). This particular uuid library spanws a daemon called uuidd to
help with concurrent uuid generation. As far as i know the only way to
disable this behaviour is to compile libuuid with --disable-uuidd
option.

When you run ./manage.py runserver the first time, libuuid launch
uuidd with fork(2). This cause uuidd to inherit all open file
descriptors from the parent process. In this case the parent process
is the python interpreter running manage.py and the open file
descriptors are among other things the open tcp connections. After
that manage.py will (probably) hang whiel serving a request, and if it
is restarted by hand or by changing a file in your application it will
keep saying port already in use until you kill uuidd.

The most simple workaround is to launch uuidd without parameters. This
will make the daemon start without open tcp ports and the library will
not try to run uuidd by it self, then do your normal django
development stuff and when you are done you can kill uuidd with uuidd -
k.

rajeev

unread,
Apr 11, 2009, 6:12:52 PM4/11/09
to Django users
Hi,

I'm in the exact same situation
"
Validating models...
0 errors found

Django version 1.0.2 final, using settings 'mylu.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Error: That port is already in use. "


but the solution above doesn't solve my problem

./manage.py runserver 127.0.0.1:8001
gives me Permission denied (tho' I'm admin)

sudo netstat -np | grep 8000
->
tcp 511 0 127.0.0.1:8000 127.0.0.1:56853
CLOSE_WAIT -
tcp 443 0 127.0.0.1:8000 127.0.0.1:44749
CLOSE_WAIT -
tcp 438 0 127.0.0.1:8000 127.0.0.1:44746
CLOSE_WAIT -
tcp 438 0 127.0.0.1:8000 127.0.0.1:44748
CLOSE_WAIT -
tcp 443 0 127.0.0.1:8000 127.0.0.1:47211
CLOSE_WAIT -
tcp 524 0 127.0.0.1:8000 127.0.0.1:60170
CLOSE_WAIT -

On Mar 17, 9:17 am, TP <tomMi.pres...@gmail.com> wrote:
> gordyt
>
> Thanks this does help, I managed to overcome this problem yesterday,
> but was still slightly confused as to
> why I had the error in the first place, this helps me understand!
>
> Thanks

Reply all
Reply to author
Forward
0 new messages