python-matrix-bot-api icon indicating copy to clipboard operation
python-matrix-bot-api copied to clipboard

Personnal invite event may cause client not starting with the account

Open Arkhesis opened this issue 5 years ago • 0 comments

Hello,

I'm using this api for a year, but today I got problem. The bot didn't want to start :

Invalid server URL
Traceback (most recent call last):
  File "/home/nemesis/work/matrix_python/lib/python3.7/site-packages/matrix_bot_api/matrix_bot_api.py", line 19, in __init__
    self.client.login_with_password(username, password)
  File "/home/nemesis/work/matrix_python/lib/python3.7/site-packages/matrix_client/client.py", line 249, in login_with_password
    return self.login(username, password, limit, sync=True)
  File "/home/nemesis/work/matrix_python/lib/python3.7/site-packages/matrix_client/client.py", line 280, in login
    self._sync()
  File "/home/nemesis/work/matrix_python/lib/python3.7/site-packages/matrix_client/client.py", line 585, in _sync
    room._put_event(event)
  File "/home/nemesis/work/matrix_python/lib/python3.7/site-packages/matrix_client/room.py", line 303, in _put_event
    self._process_state_event(event)
  File "/home/nemesis/work/matrix_python/lib/python3.7/site-packages/matrix_client/room.py", line 638, in _process_state_event
    self.invite_only = econtent["join_rule"] == "invite"
KeyError: 'join_rule'

The only strange event in the account is an invite for a 1v1 conversation (not a classique room) that the bot account didn't manage to join (with a riot web client it says "Not a known server").

{"origin": "matrix.org", "signatures": {"matrix.org": {"ed25519:auto": "<hidden>"}}, "origin_server_ts": 1553856733905, "sender": "@kinkytail:matrix.org", "event_id": "$155385673349614DuYTT:matrix.org", "prev_events": [["$155385673349613QxrNs:matrix.org", {"sha256": "<hidden>"}]], "unsigned": {"age": 2320585970}, "state_key": "", "content": {"join_rule": "invite"}, "depth": 4, "prev_state": [], "room_id": "!hDFaaeRcvjsxlBEWxS:matrix.org", "auth_events": [["$155385673349611Jdcyk:matrix.org", {"sha256": "<hidden>"}], ["$155385673349612EtixW:matrix.org", {"sha256": "<hidden>"}], ["$155385673349613QxrNs:matrix.org", {"sha256": "<hidden>"}]], "hashes": {"sha256": "<hidden>"}, "type": "m.room.join_rules"}

My bot start fine with a another mxid but not with his own now.

Arkhesis avatar Apr 25 '19 14:04 Arkhesis