From 86c6a6ca4b29800329d33aad79963532c340e61c Mon Sep 17 00:00:00 2001 From: wbob Date: Fri, 19 Jun 2026 16:22:40 +0200 Subject: [PATCH] Log table name in "No row found" error (#19869) Bringing it up to parity with the other 404 StoreErrors naming the table name already. More helpful response when debugging issues with incomplete relations. Concretly: a user that got partly removed and then reinstated, missing an entry in 'profiles' table. This should also contribute to a better understanding of #2807 and #2173 --- changelog.d/19869.bugfix | 1 + synapse/storage/database.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/19869.bugfix diff --git a/changelog.d/19869.bugfix b/changelog.d/19869.bugfix new file mode 100644 index 0000000000..2772db850f --- /dev/null +++ b/changelog.d/19869.bugfix @@ -0,0 +1 @@ +Make simple_select_one_onecol_txn() more helpful by naming the table of the select - as all other query wrapper functions already did. diff --git a/synapse/storage/database.py b/synapse/storage/database.py index 39c0631d50..023014276b 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py @@ -1879,7 +1879,7 @@ class DatabasePool: if allow_none: return None else: - raise StoreError(404, "No row found") + raise StoreError(404, f"No row found ({table})") @staticmethod def simple_select_onecol_txn(