Write failed: Broken pipe

247 views
Skip to first unread message

FSX

unread,
Nov 1, 2009, 5:31:30 PM11/1/09
to Tornado Web Server
I just switched to Tornado ~1 days ago and my app doesn't seems to
really stable. The only thing it says after a while is "Write failed:
Broken pipe". And I don't really know what that means.

Does someone also know how I can log stuff to a file? The app now
print to the console.

Thanks in advance,
Frank Smit

elij

unread,
Nov 1, 2009, 6:36:05 PM11/1/09
to python-...@googlegroups.com
On Sun, Nov 1, 2009 at 2:31 PM, FSX <6192...@gmail.com> wrote:
>
> I just switched to Tornado ~1 days ago and my app doesn't seems to
> really stable. The only thing it says after a while is "Write failed:
> Broken pipe". And I don't really know what that means.

'Broken pipe' usually means one end of the connection was terminated
(most often the client) and the other end was still trying to do
something (in this case write/send data). I sometimes see this when
browser clients hit the 'stop' button while a page is loading, or hit
refresh a bunch of times in a row. Not sure if you are running into
instances of that, or something else. If you are performing 'long
operations' and not having them be asynchronous (or having them be
asynchronous but taking too long), could be web clients getting
impatient and trying to refresh/reload.

> Does someone also know how I can log stuff to a file? The app now
> print to the console.

You can always just redirect stdout/stderr to a file. I use
daemontools and multilog for this myself.
Another option would be to add an additional python logging handler
(after parsing options, which adds an initial logging handler, as I
recall), that logs out to a file.

Frank Smit

unread,
Nov 2, 2009, 3:43:48 AM11/2/09
to python-...@googlegroups.com
I started my Tornado web application with "nohup /path/to/index.py &"
yesterday and it still runs. I'm still not sure why it crashes though.

Logging with "/path/to/index.py > tornado.log &" didn't seem to work
for some reason. It just showed the output in the consule and nothing
in the log file.

Best regards,
Frank Smit

2009/11/2 elij <eli...@gmail.com>:

elij

unread,
Nov 2, 2009, 12:09:04 PM11/2/09
to python-...@googlegroups.com
On Mon, Nov 2, 2009 at 12:43 AM, Frank Smit <6192...@gmail.com> wrote:
>
> I started my Tornado web application with "nohup /path/to/index.py &"
> yesterday and it still runs. I'm still not sure why it crashes though.
>
> Logging with "/path/to/index.py > tornado.log &" didn't seem to work
> for some reason. It just showed the output in the consule and nothing
> in the log file.

You need stderr too.
/path/to/index.py > tornado.log 2>&1 &

Reply all
Reply to author
Forward
0 new messages