-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Traceback: <class 'psycopg2.errors.CardinalityViolation'>: more than one row returned by a subquery used as an expression #6696
Comments
This is happening with the first execution of
Possibly that inner |
So this is due to To check if you have the same problem, you can run:
And see if any of the numbers in the To delete duplicate rows, I first took a backup and then ran:
This deleted 518 rows for me. Starting the server, things now work without the original exception. However the
This may cause room stats and the user directory to stop updating. But otherwise things seem to be running fine. |
Some more debugging information:
|
Closing for now as I haven't seen any more |
It may also be a good idea to reindex your
as recommended by https://www.postgresql.org/message-id/23007.1473604324%40sss.pgh.pa.us |
I've had another report of this from @jomat, which I think makes three now. I'm going to try taking it to the postgres mailing list. |
right, with the help of the postgres-general mailing list, I have an answer here: As per https://wiki.postgresql.org/wiki/Locale_data_changes, glibc changed the sort order for UTF8 locales in version 2.28. This will mean postgres will be confused about where in an index a given entry should be stored. Now, synapse should be safe, because the documentation says that you should set In short, if |
I'm going to call this resolved, though as per #6722 we could do better at stopping people getting into this mess. |
Instead just warn. This is a temporary workaround to allow provisioning new Modular hosts. See #6734 and #6696 (comment) Signed-off-by: Jason Robinson <[email protected]>
I try to dump working database with en_US.UTF-8 collation and import it back, but got several errors on creating indexes not only in
Maybe this was happens earlier, with older version of Synapse, or results of compression tool like this #4372 But solution is to remove duplicates. Here https://gist.github.com/MurzNN/fa8f3536be21426c55307761d8dcbc90 is SQL queries to remove duplicates. |
this is absolutely the sort of symptom you would expect from using a collation setting whose ordering has changed during the lifetime of the database. It is database-level corruption: an application (such Synapse or a compression tool) cannot cause it. |
I can't understand how this can happens even with wrong collation, if database already has unique index for fields? For example, in |
https://wiki.postgresql.org/wiki/Locale_data_changes explains it. The problem is that strings may sort in a different order depending on your OS version, which means that postgres cannot reliably find entries in the index. |
For completeness, Rich's email thread was https://www.postgresql.org/message-id/flat/288488b7-d3b6-905b-3706-43f7a3c7bc52%40matrix.org |
Description
I seem to be failing to handle a few PDUs sent to me due to an issue in federation_sender
Version information
Synapse v1.8.0
Edit: It turns out, when this happens, it's possible for the code that sends dummy events for fixing forward extremities to break. Thus, your server can build up forward extremities to the point where your server starts to churn and take up vast amounts of RAM and CPU.
The text was updated successfully, but these errors were encountered: