winfried / HelpIM

*obsoleted* An chat-system for online psycho-social counselling
11 stars 3 forks source link

Exception in bot: IO Error: [Errno 32] Broken pipe #251

Closed winfried closed 11 years ago

winfried commented 11 years ago

An unconfirmed report mentions this may occur when a chat is closed (by the client?) by closing the browser window, not by clicking on 'stop'.

The exception comes in two variations:

Traceback (most recent call last): File "/usr/local/bin/django-admin.py", line 5, in management.execute_from_command_line() File "/usr/local/lib/python2.6/dist-packages/django/core/management/init.py", line 429, in execute_from_command_line utility.execute() File "/usr/local/lib/python2.6/dist-packages/django/core/management/init.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 191, in run_from_argv self.execute(_args, _options.dict) File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 220, in execute output = self.handle(_args, _options) File "/usr/local/lib/python2.6/dist-packages/helpim/rooms/management/commands/runbot.py", line 92, in handle bot.run() File "/usr/local/lib/python2.6/dist-packages/helpim/rooms/bot.py", line 1064, in run self.roomCleanup() File "/usr/local/lib/python2.6/dist-packages/helpim/rooms/bot.py", line 992, in roomCleanup self.closeRoom(room) File "/usr/local/lib/python2.6/dist-packages/helpim/rooms/bot.py", line 1552, in closeRoom roomstate.leave() File "/usr/lib/pymodules/python2.6/pyxmpp/jabber/muc.py", line 491, in leave self.manager.stream.send(p) File "/usr/lib/pymodules/python2.6/pyxmpp/streambase.py", line 538, in send return self._send(stanza) File "/usr/lib/pymodules/python2.6/pyxmpp/streambase.py", line 552, in _send self._write_node(stanza.xmlnode) File "/usr/lib/pymodules/python2.6/pyxmpp/streambase.py", line 527, in _write_node self._write_raw(s) File "/usr/lib/pymodules/python2.6/pyxmpp/streamtls.py", line 159, in _write_raw raise FatalStreamError("IO Error: "+str(e)) pyxmpp.exceptions.FatalStreamError: IO Error: [Errno 32] Broken pipe

Traceback (most recent call last): File "/usr/local/bin/django-admin.py", line 5, in management.execute_from_command_line() File "/usr/local/lib/python2.6/dist-packages/django/core/management/init.py", line 429, in execute_from_command_line utility.execute() File "/usr/local/lib/python2.6/dist-packages/django/core/management/init.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 191, in run_from_argv self.execute(_args, _options.dict) File "/usr/local/lib/python2.6/dist-packages/django/core/management/base.py", line 220, in execute output = self.handle(_args, _options) File "/usr/local/lib/python2.6/dist-packages/helpim/rooms/management/commands/runbot.py", line 92, in handle bot.run() File "/usr/local/lib/python2.6/dist-packages/helpim/rooms/bot.py", line 1069, in run busy = self.stream.loop_iter(eventTimeout) File "/usr/lib/pymodules/python2.6/pyxmpp/streambase.py", line 598, in loop_iter return self._loop_iter(timeout) File "/usr/lib/pymodules/python2.6/pyxmpp/streambase.py", line 619, in _loop_iter self._process() File "/usr/lib/pymodules/python2.6/pyxmpp/streamtls.py", line 193, in _process StreamBase._process(self) File "/usr/lib/pymodules/python2.6/pyxmpp/streambase.py", line 650, in _process self.close() File "/usr/lib/pymodules/python2.6/pyxmpp/streambase.py", line 292, in close return self._close() File "/usr/lib/pymodules/python2.6/pyxmpp/streambase.py", line 298, in _close self._disconnect() File "/usr/lib/pymodules/python2.6/pyxmpp/streambase.py", line 265, in _disconnect self._send_stream_end() File "/usr/lib/pymodules/python2.6/pyxmpp/streambase.py", line 417, in _send_stream_end self._write_raw(s[end:]) File "/usr/lib/pymodules/python2.6/pyxmpp/streamtls.py", line 159, in _write_raw raise FatalStreamError("IO Error: "+str(e)) pyxmpp.exceptions.FatalStreamError: IO Error: [Errno 32] Broken pipe

winfried commented 11 years ago

Some additional information on this bug: It can be reproduced by using illegal characters in the nickname, like <, >, &, ', and ". Just before this error occurs, prosody disconnects the bot because it sent invalid xml:

Apr 11 15:56:39 c2sa3d6fb0 info Disconnecting client, stream:error is: not-well-formed Apr 11 15:56:39 c2sa3d6fb0 info Client disconnected: not-well-formed Apr 11 15:56:39 c2sa3d6fb0 info Destroying session for _@localhost/HelpIM (_@localhost)

The care worker sees with the parted message of the bot something like: "(Disconnected: not-well-formed)"

The operation that causes the error is 'write_raw'.

winfried commented 11 years ago

fix confirmed