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

561 views
Skip to first unread message

Pingpan Cheng

unread,
May 29, 2014, 11:35:40 AM5/29/14
to erpnext-dev...@googlegroups.com
Hi all,

I reinstalled the frappe-bench and then encountered some problems. When I tried to start the erpnext, it shows me the error as the title.

The detailed logs:

 * Running on http://0.0.0.0:8000/
Traceback (most recent call last):
  File "/home/life/Desktop/gitHub/frappe-bench/env/bin/frappe", line 9, in <module>
    load_entry_point('frappe==4.0.1', 'console_scripts', 'frappe')()
  File "/home/life/Desktop/gitHub/frappe-bench/apps/frappe/frappe/cli.py", line 49, in main
    return run(fn, parsed_args)
  File "/home/life/Desktop/gitHub/frappe-bench/apps/frappe/frappe/cli.py", line 79, in run
    out = globals().get(fn)(**args)
  File "/home/life/Desktop/gitHub/frappe-bench/apps/frappe/frappe/cli.py", line 63, in new_fn
    return fn(*args, **new_kwargs)
  File "/home/life/Desktop/gitHub/frappe-bench/apps/frappe/frappe/cli.py", line 731, in serve
    frappe.app.serve(port=port, profile=profile, site=frappe.local.site, sites_path=sites_path)
  File "/home/life/Desktop/gitHub/frappe-bench/apps/frappe/frappe/app.py", line 134, in serve
    use_debugger=True, use_evalex=True)
  File "/home/life/Desktop/gitHub/frappe-bench/env/local/lib/python2.7/site-packages/werkzeug/serving.py", line 706, in run_simple
    test_socket.bind((hostname, port))
  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 tried to kill all the processes using port 8000 but it doesn't work. I tried to restart and then ran it again, the same error showed again. So I thought the problem doesn't lie in the port number? How to fix this? 

I noticed that there are similar posts, but there are no detailed solutions.

Thanks very much!

Rushabh Mehta

unread,
May 29, 2014, 1:10:25 PM5/29/14
to erpnext-dev...@googlegroups.com
Are you running something else on port 8000?


--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/631d53c3-0f71-4dcb-a856-d1c7cc40e17f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--



Twitter: @rushabh_mehta

Pratik Vyas

unread,
May 29, 2014, 1:22:27 PM5/29/14
to erpnext-dev...@googlegroups.com
On Thu, May 29, 2014 at 9:05 PM, Pingpan Cheng <pin...@umich.edu> wrote:
Did you also follow the production deployment steps? Because if you
did, this explains. gunicorn (production webserver) runs on port 8000.
If you kill it, supervisor will start it again (that's it's job).

>
> I tried to kill all the processes using port 8000 but it doesn't work. I
> tried to restart and then ran it again, the same error showed again. So I
> thought the problem doesn't lie in the port number? How to fix this?
>
> I noticed that there are similar posts, but there are no detailed solutions.
>
> Thanks very much!
>
> --
> Note:
>
> If you are posting an issue,
> 1. We should be able to replicate it at our end. So please give us as much
> information as you can. Please see it from the point of view of the person
> receiving the communication.
> 2. Paste your code at http://pastebin.com or http://gist.github.com and send
> only the URL via email
> 3. For sending images, use http://imgur.com or other similar services. Do
> not send images as attachments. Links are good. Same goes for any file you
> are going to send.
>
> End of Note
> ---
> You received this message because you are subscribed to the Google Groups
> "ERPNext Developer Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to erpnext-developer...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/erpnext-developer-forum/631d53c3-0f71-4dcb-a856-d1c7cc40e17f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Pratik
erpnext

Pingpan Cheng

unread,
May 29, 2014, 1:27:52 PM5/29/14
to erpnext-dev...@googlegroups.com
Hi Pratik,

I think gunicorn is the cause.

$ lsof -i :8000

COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
gunicorn 3472 life    5u  IPv4  16913      0t0  TCP localhost:8000 (LISTEN)
gunicorn 3477 life    5u  IPv4  16913      0t0  TCP localhost:8000 (LISTEN)
gunicorn 3478 life    5u  IPv4  16913      0t0  TCP localhost:8000 (LISTEN)


But how can I kill the gunicorn completely? Since supervisor will start it again once I killed it.


Thanks,
Pingpan

Pratik Vyas

unread,
May 29, 2014, 1:52:34 PM5/29/14
to erpnext-dev...@googlegroups.com
On Thu, May 29, 2014 at 10:57 PM, Pingpan Cheng <pin...@umich.edu> wrote:
> Hi Pratik,
>
> I think gunicorn is the cause.
>
> $ lsof -i :8000
>
> COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
> gunicorn 3472 life 5u IPv4 16913 0t0 TCP localhost:8000 (LISTEN)
> gunicorn 3477 life 5u IPv4 16913 0t0 TCP localhost:8000 (LISTEN)
> gunicorn 3478 life 5u IPv4 16913 0t0 TCP localhost:8000 (LISTEN)
>
>
> But how can I kill the gunicorn completely? Since supervisor will start it
> again once I killed it.
>

Like Frank Underwood, stop supervisor

`sudo supervisorctl stop`

But if you don't want to develop and just use ERPNext, it should be
accessible on port 80 (assuming nginx is also on).
>> > email to erpnext-developer...@googlegroups.com.
>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/erpnext-developer-forum/631d53c3-0f71-4dcb-a856-d1c7cc40e17f%40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Pratik
>> erpnext
>
> --
> Note:
>
> If you are posting an issue,
> 1. We should be able to replicate it at our end. So please give us as much
> information as you can. Please see it from the point of view of the person
> receiving the communication.
> 2. Paste your code at http://pastebin.com or http://gist.github.com and send
> only the URL via email
> 3. For sending images, use http://imgur.com or other similar services. Do
> not send images as attachments. Links are good. Same goes for any file you
> are going to send.
>
> End of Note
> ---
> You received this message because you are subscribed to the Google Groups
> "ERPNext Developer Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to erpnext-developer...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/erpnext-developer-forum/546f3827-e6e1-4dba-8c43-5e0a84a6b468%40googlegroups.com.

Pingpan Cheng

unread,
May 29, 2014, 2:14:51 PM5/29/14
to erpnext-dev...@googlegroups.com
Thanks, that really helps!
>> > email to erpnext-developer-forum+unsub...@googlegroups.com.
>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/erpnext-developer-forum/631d53c3-0f71-4dcb-a856-d1c7cc40e17f%40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Pratik
>> erpnext
>
> --
> Note:
>
> If you are posting an issue,
> 1. We should be able to replicate it at our end. So please give us as much
> information as you can. Please see it from the point of view of the person
> receiving the communication.
> 2. Paste your code at http://pastebin.com or http://gist.github.com and send
> only the URL via email
> 3. For sending images, use http://imgur.com or other similar services. Do
> not send images as attachments. Links are good. Same goes for any file you
> are going to send.
>
> End of Note
> ---
> You received this message because you are subscribed to the Google Groups
> "ERPNext Developer Forum" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to erpnext-developer-forum+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages