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

"Internal server error" when upgrading a room created with Conduit #16715

Closed
progval opened this issue Dec 1, 2023 · 1 comment · Fixed by #16725
Closed

"Internal server error" when upgrading a room created with Conduit #16715

progval opened this issue Dec 1, 2023 · 1 comment · Fixed by #16725
Labels
O-Uncommon Most users are unlikely to come across this or unexpected workflow 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

@progval
Copy link
Contributor

progval commented Dec 1, 2023

Description

Upgrading a room created with Conduit returns "Internal server error"

Steps to reproduce

  1. Create a room with Conduit
  2. Invite a Synapse user to it, make them admin
  3. Make the Synapse user upgrade the room (eg. /upgraderoom 11 in Eleweb)

Synapse returns {"errcode":"M_UNKNOWN","error":"Internal server error"}

Homeserver

matrix.org and Conduit

Synapse Version

1.96.1 (b=matrix-org-hotfixes,9c3b906b3a)

Installation Method

I don't know

Database

postgresql

Workers

Multiple workers

Platform

n/a

Configuration

No response

Relevant log output

Nothing from Conduit.

I tried it on matrix.org, `synapse-trace-id: b6592675a1c241fa`

Anything else that would be useful to know?

No response

@erikjohnston
Copy link
Member

Raw stack trace:

ValueError: max() arg is an empty sequence
  File "twisted/internet/defer.py", line 2000, in _inlineCallbacks
    result = context.run(gen.send, result)
  File "synapse/util/caches/response_cache.py", line 258, in cb
    return await callback(*args, **kwargs)
  File "synapse/handlers/room.py", line 306, in _upgrade_room
    await self.clone_existing_room(
  File "synapse/handlers/room.py", line 552, in clone_existing_room
    state_default_int, ban, max(event_power_levels.values())

Corresponds to:

state_default_int, ban, max(event_power_levels.values())

Sentry link: https://sentry.tools.element.io/organizations/element/issues/85240/?project=2

The power level content is:

{"users":{"@<redacted>":100,"@<redacted>":100,"@<redacted>":100}}

So looks like we need to correctly handle an empty/missing events key. I think we can change the max(event_power_levels.values()) to include a default=0?

@erikjohnston erikjohnston added S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. O-Uncommon Most users are unlikely to come across this or unexpected workflow Z-Help-Wanted We know exactly how to fix this issue, and would be grateful for any contribution labels Dec 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
O-Uncommon Most users are unlikely to come across this or unexpected workflow 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.

2 participants