Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

TypeError: '>' not supported between instances of 'NoneType' and 'int' when upgrading a room with missing powerlevel keys. #9378

Closed
Half-Shot opened this issue Feb 10, 2021 · 0 comments · Fixed by #9395
Assignees
Labels
S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. Z-Help-Wanted We know exactly how to fix this issue, and would be grateful for any contribution

Comments

@Half-Shot
Copy link
Collaborator

2021-02-10 21:24:57,160 - synapse.http.server - 91 - ERROR - POST-269- Failed handle request via 'RoomUpgradeRestServlet': <XForwardedForRequest at 0x7ff64c3a6520 method='POST' uri='/_matrix/client/r0/rooms/!GvvSMoCBZYwiTcVaOt%3Aamorgan.xyz/upgrade' clientproto='HTTP/1.0' site='8008'>
Traceback (most recent call last):
  File "/opt/synapse/lib/python3.8/site-packages/synapse/http/server.py", line 252, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/opt/synapse/lib/python3.8/site-packages/synapse/http/server.py", line 430, in _async_render
    callback_return = await raw_callback_return
  File "/opt/synapse/lib/python3.8/site-packages/synapse/rest/client/v2_alpha/room_upgrade_rest_servlet.py", line 76, in on_POST
    new_room_id = await self._room_creation_handler.upgrade_room(
  File "/opt/synapse/lib/python3.8/site-packages/synapse/handlers/room.py", line 171, in upgrade_room
    ret = await self._upgrade_response_cache.wrap(
  File "/opt/synapse/lib/python3.8/site-packages/twisted/internet/defer.py", line 1418, in _inlineCallbacks
    result = g.send(result)
  File "/opt/synapse/lib/python3.8/site-packages/synapse/handlers/room.py", line 229, in _upgrade_room
    await self.clone_existing_room(
  File "/opt/synapse/lib/python3.8/site-packages/synapse/handlers/room.py", line 433, in clone_existing_room
    needed_power_level = max(state_default, ban, max(event_power_levels.values()))
TypeError: '>' not supported between instances of 'NoneType' and 'int'
{
  "type": "m.room.power_levels",
  "sender": "@Half-Shot:half-shot.uk",
  "content": {
    "users": {
      "@Half-Shot:half-shot.uk": 100,
      "@andrewm:amorgan.xyz": 100
    },
    "events": {
      "m.room.avatar": 50,
      "m.room.name": 50,
      "m.room.history_visibility": 100,
      "m.room.canonical_alias": 50,
      "m.room.power_levels": 100
    },
    "invite": 0
  },
  "state_key": "",
  "event_id": "$158455031966iTegd:half-shot.uk",
  "origin_server_ts": 1584550319644,
  "unsigned": {
    "replaces_state": "$1550259911242TSzgv:amorgan.xyz",
    "age": 26095948439
  },
  "room_id": "!GvvSMoCBZYwiTcVaOt:amorgan.xyz"
}
@erikjohnston erikjohnston added S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. Z-Help-Wanted We know exactly how to fix this issue, and would be grateful for any contribution labels Feb 11, 2021
@clokep clokep self-assigned this Feb 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. Z-Help-Wanted We know exactly how to fix this issue, and would be grateful for any contribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants