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

synapse_port_db fails to port sqlite database #8652

@Sorixelle

Description

@Sorixelle

Description

When running synapse_port_db to port my SQLite database to Postgres, the port fails with the following error:

2020-10-25 11:36:25,120 - synapse_port_db - 197 - ERROR - Failed to insert: destination_rooms
Traceback (most recent call last):
  File "/usr/bin/synapse_port_db", line 195, in insert_many_txn
    txn.executemany(sql, rows)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/database.py", line 215, in executemany
    self._do_execute(self.txn.executemany, sql, *args)
  File "/opt/venvs/matrix-synapse/lib/python3.8/site-packages/synapse/storage/database.py", line 238, in _do_execute
    return func(sql, *args)
psycopg2.errors.ForeignKeyViolation: insert or update on table "destination_rooms" violates foreign key constraint "destination_rooms_destination_fkey"
DETAIL:  Key (destination)=(dodoid.com) is not present in table "destinations".

After some discussion in #synapse:matrix.org, it appears that this may have been caused by an oversight in #8230.

Steps to reproduce

  • Using a homeserver running on an SQLite database, attempt to port the database to Postgres with synapse_port_db
  • After some time, the port will fail with an error similar to the above.

Version information

  • Homeserver: icodeinht.ml

If not matrix.org:

  • Version: 1.21.2

  • Install method: apt

  • Platform: Ubuntu 20.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    z-bug(Deprecated Label)z-regression(Deprecated Label)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions