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

/createRoom creates an empty room when there is an error sending events #8895

Open
t3chguy opened this issue Dec 8, 2020 · 5 comments
Open
Labels
A-Create-Room P4 (OBSOLETE: use S- labels.) Okay backlog: will not schedule, will accept patches S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@t3chguy
Copy link
Member

t3chguy commented Dec 8, 2020

If somehow your createRoom request is too large, like if for example you send a base64 encoded avatar instead of an mxc URL (wrongly) then the request fails with a 413 but a new Empty room is created and sent to the user with none of the parameters the user asked for.

Example request payload:

{
  "visibility": "public",
  "name": "Test Space 17",
  "creation_content": {
    "type": "m.space"
  },
  "initial_state": [
    {
      "type": "m.room.avatar",
      "content": {
        "avatar": "data:image/png;base64,iVBOR..............AAAAASUVORK5CYII="
      }
    },
    {
      "type": "m.room.guest_access",
      "state_key": "",
      "content": {
        "guest_access": "can_join"
      }
    }
  ],
  "power_level_content_override": {
    "events_default": 100
  },
  "preset": "private_chat"
}

(avatar truncated Github would not let me post)

image

Expectation: Empty room is not created.

Possibly related to #8625 but am operating in Monolith mode.

@clokep clokep added z-bug (Deprecated Label) z-p2 (Deprecated Label) labels Dec 8, 2020
@richvdh
Copy link
Member

richvdh commented Dec 10, 2020

yeah I think this is closely related to #8625: it boils down to the fact that createRoom is not atomic, and exceptions (for any reason) in the middle of it give you a broken room.

@richvdh richvdh changed the title Synapse createRoom 413 creates an Empty room /createRoom creates an empty room when there is an error sending events Aug 1, 2022
@richvdh
Copy link
Member

richvdh commented Aug 1, 2022

Per #13427: the same happens if you hit the rate-limiter.

@richvdh richvdh added T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. P4 (OBSOLETE: use S- labels.) Okay backlog: will not schedule, will accept patches S-Minor Blocks non-critical functionality, workarounds exist. A-Create-Room and removed z-bug (Deprecated Label) z-p2 (Deprecated Label) labels Aug 1, 2022
@RomanOlegovich
Copy link

@richvdh Can workers help solve this problem?

@richvdh
Copy link
Member

richvdh commented Aug 5, 2022

@richvdh Can workers help solve this problem?

No, if anything they are likely to exacerbate the problem as it increases the chances of a failure creating one of the events in the new room.

@RomanOlegovich
Copy link

@richvdh What is a way to fix this and create room with expected alias, may be delete broken room and re-create again?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Create-Room P4 (OBSOLETE: use S- labels.) Okay backlog: will not schedule, will accept patches S-Minor Blocks non-critical functionality, workarounds exist. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

4 participants