0

I'm using Bottle server to implement my own server using an implementation not so far away from the simple "hello world" here , my own implementation is (without the routing section of course):
bottleApp =bottle.app() bottleApp.run(host='0.0.0.0',port=80, debug=true)

My server is keep getting unresponsive all the time and then I get in the Browser: Connection reset by peer, broken pipe errno 32
The logs give me almost exactly the same stack traces such as in question.

Here are my own logs:
Broken pipe stack trace
connection reset by peer stack trace

What I tried so far, without success:

  1. Wrapping the server run line with try except, something like, shown here the answer of "mhawke". This stopped the error messages in logs, apparently because I caught them in except clause, but problem is that when catching the exception like that it means that we have been thrown out of the run method context, and I want to catch it in a way it will not cause my server to fall.
    I don't know if its possible without touching the inner implementations files of bottle.

  2. Adding this before server run line:
    from signal import signal, SIGPIPE, SIG_DFL signal(SIGPIPE,SIG_DFL)
    As suggested here, but it seems that it didn't had any impact on not getting Broken pipe\connection reset errors and server responsiveness.

  3. I thought of trying also the second answer here, but I don't have any idea where to locate this code in the context of the bottle server.

Community
  • 1
  • 1
JavaSa
  • 5,813
  • 16
  • 71
  • 121

1 Answers1

0

This sounds like a permissions issue or a firewall.

if you really need to listen on port 80, then you need to run with a privileged account. Also you will probably need to open port 80 for tcp traffic.

I can see your using something that appears to be Posix (Linux/Unix/OSx) If you post what OS you are using I can edit this answer to be more specific as to how to open the firewall and execute privileged commands (probably sudo but who knows).

iLoveTux
  • 3,552
  • 23
  • 31