element-hq / element-hq/synapse

Internal server error when deleting a room with the Admin API with invalid `new_room_user_id`

Open
#13,630 0 comments 0 reactions 0 assignees View on GitHub
A-Admin-API A-Validation O-Uncommon S-Minor T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#13630](https://github.com/matrix-org/synapse/issues/13630).

---

hallo
i want to delete rooms on my server with this command. unfortunately i always get this error.

```
curl -XDELETE "https://my.spdns.org/_synapse/admin/v2/rooms/$room_id" \
-H "Authorization: Bearer $TOKEN" \
-d'{"new_room_user_id": "", "message": "This room has been removed", "room_name": "", "block": true, "purge": true }'
{"errcode":"M_UNKNOWN","error":"Internal server error"}
```
my synapse shows the following in the log file:

```
2022-08-25 17:43:26,232 - synapse.http.server - 185 - ERROR - DELETE-182 - Failed handle request via 'RoomRestV2Servlet':
Traceback (most recent call last):
File "/home/alex/synapse/env/lib/python3.9/site-packages/twisted/internet/defer.py", line 1660, in _inlineCallbacks
result = current_context.run(gen.send, result)
StopIteration: 1
```

During handling of the above exception, another exception occurred:

```
Traceback (most recent call last):
File "/home/alex/synapse/env/lib/python3.9/site-packages/synapse/http/server.py", line 368, in _async_render_wrapper
callback_return = await self._async_render(request)
File "/home/alex/synapse/env/lib/python3.9/site-packages/synapse/http/server.py", line 574, in _async_render
callback_return = await raw_callback_return
File "/home/alex/synapse/env/lib/python3.9/site-packages/synapse/rest/admin/rooms.py", line 119, in on_DELETE
delete_id = self._pagination_handler.start_shutdown_and_purge_room(
File "/home/alex/synapse/env/lib/python3.9/site-packages/synapse/handlers/pagination.py", line 751, in start_shutdown_and_purge_room
if not self.hs.is_mine_id(new_room_user_id):
File "/home/alex/synapse/env/lib/python3.9/site-packages/synapse/server.py", line 343, in is_mine_id
return string.split(":", 1)[1] == self.hostname
IndexError: list index out of range
```

any idea whats wrong?
thanks anan

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.