anewusername/mxpp

Possible to get into a state where messages are received but not sent

Opened this issue · 2 comments

WARNING A MatrixRequestError occured during sync. WARNING Problem occured serverside. Waiting 5 seconds WARNING A MatrixRequestError occured during sync. WARNING Problem occured serverside. Waiting 10 seconds WARNING A MatrixRequestError occured during sync. WARNING Problem occured serverside. Waiting 20 seconds ERROR Exception thrown during sync Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 377, in _make_request httplib_response = conn.getresponse(buffering=True) TypeError: getresponse() got an unexpected keyword argument 'buffering'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 560, in urlopen
body=body, headers=headers)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 379, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1197, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 376, in send
timeout=timeout
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 610, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 247, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/lib/python3/dist-packages/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 560, in urlopen
body=body, headers=headers)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 379, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1197, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/tyler/mxpp/src/matrix-client/matrix_client/client.py", line 338, in listen_forever
self._sync(timeout_ms)
File "/home/tyler/mxpp/src/matrix-client/matrix_client/client.py", line 437, in _sync
response = self.api.sync(self.sync_token, timeout_ms, filter=self.sync_filter)
File "/home/tyler/mxpp/src/matrix-client/matrix_client/api.py", line 94, in sync
api_path=MATRIX_V2_API_PATH)
File "/home/tyler/mxpp/src/matrix-client/matrix_client/api.py", line 545, in _send
verify=self.validate_cert
File "/usr/lib/python3/dist-packages/requests/api.py", line 53, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 426, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 377, in _make_request
httplib_response = conn.getresponse(buffering=True)
TypeError: getresponse() got an unexpected keyword argument 'buffering'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 560, in urlopen
body=body, headers=headers)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 379, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1197, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 376, in send
timeout=timeout
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 610, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 247, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/lib/python3/dist-packages/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 560, in urlopen
body=body, headers=headers)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 379, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1197, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/tyler/mxpp/mxpp/main.py", line 536, in
main()
File "/home/tyler/mxpp/mxpp/main.py", line 529, in main
bot.matrix.listen_forever()
File "/home/tyler/mxpp/src/matrix-client/matrix_client/client.py", line 338, in listen_forever
self._sync(timeout_ms)
File "/home/tyler/mxpp/src/matrix-client/matrix_client/client.py", line 437, in _sync
response = self.api.sync(self.sync_token, timeout_ms, filter=self.sync_filter)
File "/home/tyler/mxpp/src/matrix-client/matrix_client/api.py", line 94, in sync
api_path=MATRIX_V2_API_PATH)
File "/home/tyler/mxpp/src/matrix-client/matrix_client/api.py", line 545, in _send
verify=self.validate_cert
File "/usr/lib/python3/dist-packages/requests/api.py", line 53, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 426, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))
INFO XMPP received tylerfreedman.com : A server or plugin update was found: Openfire 4.1.6
ERROR xmpp_message: JID tylerfreedman.com NOT IN ROSTER!?
ERROR Error processing event handler: <bound method BridgeBot.xmpp_message of <main.BridgeBot object at 0x7f8aeb935710>>
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/sleekxmpp/xmlstream/xmlstream.py", line 1708, in _event_runner
func(*args)
File "/home/tyler/mxpp/mxpp/main.py", line 410, in xmpp_message
room = self.get_room_for_topic(from_jid)
File "/home/tyler/mxpp/mxpp/main.py", line 138, in get_room_for_topic
room_id = self.topic_room_id_map[jid]
KeyError: 'tylerfreedman.com'
ERROR Error handling {jabber:client}message stanza
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/sleekxmpp/xmlstream/xmlstream.py", line 1708, in _event_runner
func(*args)
File "/home/tyler/mxpp/mxpp/main.py", line 410, in xmpp_message
room = self.get_room_for_topic(from_jid)
File "/home/tyler/mxpp/mxpp/main.py", line 138, in get_room_for_topic
room_id = self.topic_room_id_map[jid]
KeyError: 'tylerfreedman.com'
ERROR 'tylerfreedman.com'
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/sleekxmpp/xmlstream/xmlstream.py", line 1708, in _event_runner
func(*args)
File "/home/tyler/mxpp/mxpp/main.py", line 410, in xmpp_message
room = self.get_room_for_topic(from_jid)
File "/home/tyler/mxpp/mxpp/main.py", line 138, in get_room_for_topic
room_id = self.topic_room_id_map[jid]
KeyError: 'tylerfreedman.com'
INFO XMPP received phone@tylerfreedman.com/MAXS : New SMS Received

What's missing between the top and bottom lines are the matrix messages I've attempted to send. If I restart mxpp, everything will work fine for a while, until I get back into this state.

Thanks! I have encountered this as well, and will work on fixing it next.

Sub-issues:

  • poor handling of disconnect/reconnect
  • no way to tell from within Matrix that bot has disconnected from XMPP
  • Matrix messages sent when disconnected from XMPP are lost

I think I've fixed the issues with exceptions not propagating correctly; I'll keep an eye out for further problems.