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

Internal server error on deletion of empty room #12948

Closed
kruthoff opened this issue Jun 2, 2022 · 1 comment
Closed

Internal server error on deletion of empty room #12948

kruthoff opened this issue Jun 2, 2022 · 1 comment

Comments

@kruthoff
Copy link

kruthoff commented Jun 2, 2022

Description

I'm trying to delete/purge an empty room, but it results in an internal server error because of a postgres fk violation. Can this be resolved? Any help is much appreciated.

Steps to reproduce

odroid@odroidh2:~$ synadm room delete '!KlacjKWnARbprTLuRM:nova.chat'
avatar: null
canonical_alias: null
creator: '@eric:nova.chat'
encryption: null
federatable: true
guest_access: null
history_visibility: null
join_rules: null
joined_local_devices: 0
joined_local_members: 0
joined_members: 0
name: null
public: false
room_id: '!KlacjKWnARbprTLuRM:nova.chat'
state_events: 1134
topic: null
version: '5'

members: []
total: 0

Are you sure you want to delete this room? (y/N): y
WARNING Synapse returned status code 500
errcode: M_UNKNOWN
error: Internal server error

odroid@odroidh2:~$
root@odroidh2:/etc/matrix-synapse# tail /var/log/matrix-synapse/homeserver.log
    r = func(cursor, *args, **kwargs)
  File "/opt/venvs/matrix-synapse/lib/python3.9/site-packages/synapse/storage/databases/main/purge_events.py", line 328, in _purge_room_txn
    txn.execute("DELETE FROM rooms WHERE room_id = ?", (room_id,))
  File "/opt/venvs/matrix-synapse/lib/python3.9/site-packages/synapse/storage/database.py", line 352, in execute
    self._do_execute(self.txn.execute, sql, *args)
  File "/opt/venvs/matrix-synapse/lib/python3.9/site-packages/synapse/storage/database.py", line 394, in _do_execute
    return func(sql, *args, **kwargs)
psycopg2.errors.ForeignKeyViolation: update or delete on table "rooms" violates foreign key constraint "destination_rooms_room_id_fkey" on table "destination_rooms"
DETAIL:  Key (room_id)=(!KlacjKWnARbprTLuRM:nova.chat) is still referenced from table "destination_rooms".

root@odroidh2:/etc/matrix-synapse#

Version information

  • Homeserver: fluse.duckdns.org

If not matrix.org:

  • Version: {"server_version":"1.60.0","python_version":"3.9.2"}

  • Install method: deb package

  • Platform: Linux odroidh2 5.10.0-14-amd64 #1 SMP Debian 5.10.113-1 (2022-04-29) x86_64 GNU/Linux
@clokep
Copy link
Member

clokep commented Jun 2, 2022

Duplicate of #12787, which is fixed on develop (see #12889).

@clokep clokep closed this as completed Jun 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants