Sunday, March 15, 2009

Windows Vista deception -- "Error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions"

I just got started on Vista after years of developing on XP. When I tried Django's
manage.py runserver
which defaults to localhost:8000, I got this error: 
Django version 1.1 alpha 1 SVN-10020, using settings 'mashup.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions

It turns out Aptana Studio is also using port 8000 for it internal server, so Vista instead of reporting that port 8000 is already binded to, rambles about access permissions. I had been doing the same thing in Windows XP, but apparently XP lets you run two servers on the same port without complaining (crazy!)

Solution:

manage.py runserver localhost:8001

Matt

16 comments:

  1. ha! the same here. thanks for the solution :)

    ReplyDelete
  2. @Richard: Anyway, my Vista test failed miserably. I couldn't stand having Vista chew up my 3GB of RAM without mercy, so I made the jump over to Ubuntu, and now Ubuntu doesn't know what to do with soo much memory at its disposal ;-)

    ReplyDelete
  3. Had this as well on windows 7, you think the error would be more descriptive that the port is already in use.

    ReplyDelete
  4. Thanks, saved me an hour of headache!

    ReplyDelete
  5. Thaaaaaaaaaaaaaaaaaaaank you!!
    First time a problem gets to be solved that fast and efficient!

    ReplyDelete
  6. Aptana HTTP Server uses, on default, ports from 8000 to 8500, so the problem can comeback also with django server started on 8001 port...
    my suggest (in Aptana): Window -> Preferences -> Aptana -> HTTP Server: change value of Port(s) field in [8001-8500].

    in this way the port 8000 (used by default from django built-in server) is free again ;)

    ReplyDelete
  7. Thank you! It greatly works for me! :)

    ReplyDelete
  8. Hi if i try send email using python script following error occurs: error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions

    So, can any one tell me how to resolve it...?

    ReplyDelete
  9. Can anyone tell me how to send sms using python script...?

    ReplyDelete
  10. I encountered the same question, just use the netstat -na, i found the port has been used. You can use other port that not be used.
    manage.py runserver

    ReplyDelete
  11. Yay, same thing happened to me and this helped! Thank you.

    ReplyDelete