I have two users, of which user A has created an account and shares it (Read/Write) with user B.
User B can add transactions to this account, can read transactions from it, but when user B tries to delete or share a transaction from the shared account, it fails and this error triggers. It does not matter whether the transaction was created by user A or B.
It seems to me like the action when splitting calls the transactionMapper via SharedExpenseService:171 → TransactionMapper:58 to look up the transaction with WHERE t.id = ? AND a.user_id = ?, and finds nothing, so it throws the DoesNotExistException.
But at glance (haven't gone into details), the query maybe scopes the transaction to the current user's own accounts (a.user_id). So when the user tries an action that lives on a shared/other user's account, the lookup returns zero rows and the split fails.
For delete, it is more simple but same root: TransactionMapper::find() is scoped to the current user only it seems, so it fails.
DoesNotExistException
Did expect one result but found none when executing: query "SELECT t.* FROM *PREFIX*budget_transactionst INNER JOIN *PREFIX*budget_accountsa ON t.account_id = a.id WHERE (t.id = :dcValue1) AND (a.user_id = :dcValue2)";
Here is the redacted error json for a delete, for split one follows below (but same pattern):
{
"reqId": "ahwCCDgMXTrgEDsDL4IgrQAAADc",
"level": 3,
"time": "2026-05-31T09:40:24+00:00",
"remoteAddr": "<REDACTED_IP>",
"user": "<REDACTED_USER>",
"app": "budget",
"method": "DELETE",
"url": "/index.php/apps/budget/api/transactions/9",
"scriptName": "/index.php",
"message": "Budget app error: Did expect one result but found none when executing: query "SELECT t.* FROM *PREFIX*budget_transactionst INNER JOIN *PREFIX*budget_accountsa ON t.account_id = a.id WHERE (t.id = :dcValue1) AND (a.user_id = :dcValue2)"; ",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36 Edg/148.0.0.0",
"version": "33.0.4.1",
"exception": {
"Exception": "OCP\AppFramework\Db\DoesNotExistException",
"Message": "Did expect one result but found none when executing: query "SELECT t.* FROM *PREFIX*budget_transactionst INNER JOIN *PREFIX*budget_accountsa ON t.account_id = a.id WHERE (t.id = :dcValue1) AND (a.user_id = :dcValue2)"; ",
"Code": 0,
"Trace": [
{ "file": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php", "line": 382, "function": "findOneQuery", "class": "OCP\AppFramework\Db\QBMapper", "type": "->" },
{ "file": "/var/www/nextcloud/apps/budget/lib/Db/TransactionMapper.php", "line": 58, "function": "findEntity", "class": "OCP\AppFramework\Db\QBMapper", "type": "->" },
{ "file": "/var/www/nextcloud/apps/budget/lib/Service/TransactionService.php", "line": 44, "function": "find", "class": "OCA\Budget\Db\TransactionMapper", "type": "->" },
{ "file": "/var/www/nextcloud/apps/budget/lib/Service/TransactionService.php", "line": 510, "function": "find", "class": "OCA\Budget\Service\TransactionService", "type": "->" },
{ "file": "/var/www/nextcloud/apps/budget/lib/Controller/TransactionController.php", "line": 338, "function": "delete", "class": "OCA\Budget\Service\TransactionService", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "line": 205, "function": "destroy", "class": "OCA\Budget\Controller\TransactionController", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "line": 118, "function": "executeController", "class": "OC\AppFramework\Http\Dispatcher", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/AppFramework/App.php", "line": 153, "function": "dispatch", "class": "OC\AppFramework\Http\Dispatcher", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/Route/Router.php", "line": 321, "function": "main", "class": "OC\AppFramework\App", "type": "::" },
{ "file": "/var/www/nextcloud/lib/base.php", "line": 1155, "function": "match", "class": "OC\Route\Router", "type": "->" },
{ "file": "/var/www/nextcloud/index.php", "line": 25, "function": "handleRequest", "class": "OC", "type": "::" }
],
"File": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
"Line": 284,
"message": "Budget app error: Did expect one result but found none when executing: query "SELECT t.* FROM *PREFIX*budget_transactionst INNER JOIN *PREFIX*budget_accountsa ON t.account_id = a.id WHERE (t.id = :dcValue1) AND (a.user_id = :dcValue2)"; ",
"transactionId": "9",
"CustomMessage": "Budget app error: Did expect one result but found none when executing: query "SELECT t.* FROM *PREFIX*budget_transactionst INNER JOIN *PREFIX*budget_accountsa ON t.account_id = a.id WHERE (t.id = :dcValue1) AND (a.user_id = :dcValue2)"; ",
}
}
{
"reqId": "ahwAPzgMXTrgEDsDL4IejwAAADw",
"level": 3,
"time": "2026-05-31T09:32:47+00:00",
"remoteAddr": "<REDACTED_IP>",
"user": "<REDACTED_USER>",
"app": "budget",
"method": "POST",
"url": "/index.php/apps/budget/api/shared/shares/split",
"scriptName": "/index.php",
"message": "Failed to split 50/50",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36 Edg/148.0.0.0",
"version": "33.0.4.1",
"exception": {
"Exception": "OCP\AppFramework\Db\DoesNotExistException",
"Message": "Did expect one result but found none when executing: query "SELECT t.* FROM *PREFIX*budget_transactionst INNER JOIN *PREFIX*budget_accountsa ON t.account_id = a.id WHERE (t.id = :dcValue1) AND (a.user_id = :dcValue2)"; ",
"Code": 0,
"Trace": [
{ "file": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php", "line": 382, "function": "findOneQuery", "class": "OCP\AppFramework\Db\QBMapper", "type": "->" },
{ "file": "/var/www/nextcloud/apps/budget/lib/Db/TransactionMapper.php", "line": 58, "function": "findEntity", "class": "OCP\AppFramework\Db\QBMapper", "type": "->" },
{ "file": "/var/www/nextcloud/apps/budget/lib/Service/SharedExpenseService.php", "line": 171, "function": "find", "class": "OCA\Budget\Db\TransactionMapper", "type": "->" },
{ "file": "/var/www/nextcloud/apps/budget/lib/Controller/SharedExpenseController.php", "line": 318, "function": "splitFiftyFifty", "class": "OCA\Budget\Service\SharedExpenseService", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "line": 205, "function": "splitFiftyFifty", "class": "OCA\Budget\Controller\SharedExpenseController", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "line": 118, "function": "executeController", "class": "OC\AppFramework\Http\Dispatcher", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/AppFramework/App.php", "line": 153, "function": "dispatch", "class": "OC\AppFramework\Http\Dispatcher", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/Route/Router.php", "line": 321, "function": "main", "class": "OC\AppFramework\App", "type": "::" },
{ "file": "/var/www/nextcloud/index.php", "line": 25, "function": "handleRequest", "class": "OC", "type": "::" }
],
"File": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
"Line": 284,
"message": "Failed to split 50/50",
"CustomMessage": "Failed to split 50/50"
},
"userId": "<REDACTED_USER>",
"id": "6a1c00f9defc3"
}
I have two users, of which user A has created an account and shares it (Read/Write) with user B.
User B can add transactions to this account, can read transactions from it, but when user B tries to delete or share a transaction from the shared account, it fails and this error triggers. It does not matter whether the transaction was created by user A or B.
It seems to me like the action when splitting calls the transactionMapper via SharedExpenseService:171 → TransactionMapper:58 to look up the transaction with WHERE t.id = ? AND a.user_id = ?, and finds nothing, so it throws the DoesNotExistException.
But at glance (haven't gone into details), the query maybe scopes the transaction to the current user's own accounts (a.user_id). So when the user tries an action that lives on a shared/other user's account, the lookup returns zero rows and the split fails.
For delete, it is more simple but same root: TransactionMapper::find() is scoped to the current user only it seems, so it fails.
DoesNotExistException
Did expect one result but found none when executing: query "SELECT
t.* FROM*PREFIX*budget_transactionstINNER JOIN*PREFIX*budget_accountsaONt.account_id=a.idWHERE (t.id= :dcValue1) AND (a.user_id= :dcValue2)";Here is the redacted error json for a delete, for split one follows below (but same pattern):
{
"reqId": "ahwCCDgMXTrgEDsDL4IgrQAAADc",
"level": 3,
"time": "2026-05-31T09:40:24+00:00",
"remoteAddr": "<REDACTED_IP>",
"user": "<REDACTED_USER>",
"app": "budget",
"method": "DELETE",
"url": "/index.php/apps/budget/api/transactions/9",
"scriptName": "/index.php",
"message": "Budget app error: Did expect one result but found none when executing: query "SELECT
t.* FROM*PREFIX*budget_transactionstINNER JOIN*PREFIX*budget_accountsaONt.account_id=a.idWHERE (t.id= :dcValue1) AND (a.user_id= :dcValue2)"; ","userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36 Edg/148.0.0.0",
"version": "33.0.4.1",
"exception": {
"Exception": "OCP\AppFramework\Db\DoesNotExistException",
"Message": "Did expect one result but found none when executing: query "SELECT
t.* FROM*PREFIX*budget_transactionstINNER JOIN*PREFIX*budget_accountsaONt.account_id=a.idWHERE (t.id= :dcValue1) AND (a.user_id= :dcValue2)"; ","Code": 0,
"Trace": [
{ "file": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php", "line": 382, "function": "findOneQuery", "class": "OCP\AppFramework\Db\QBMapper", "type": "->" },
{ "file": "/var/www/nextcloud/apps/budget/lib/Db/TransactionMapper.php", "line": 58, "function": "findEntity", "class": "OCP\AppFramework\Db\QBMapper", "type": "->" },
{ "file": "/var/www/nextcloud/apps/budget/lib/Service/TransactionService.php", "line": 44, "function": "find", "class": "OCA\Budget\Db\TransactionMapper", "type": "->" },
{ "file": "/var/www/nextcloud/apps/budget/lib/Service/TransactionService.php", "line": 510, "function": "find", "class": "OCA\Budget\Service\TransactionService", "type": "->" },
{ "file": "/var/www/nextcloud/apps/budget/lib/Controller/TransactionController.php", "line": 338, "function": "delete", "class": "OCA\Budget\Service\TransactionService", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "line": 205, "function": "destroy", "class": "OCA\Budget\Controller\TransactionController", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "line": 118, "function": "executeController", "class": "OC\AppFramework\Http\Dispatcher", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/AppFramework/App.php", "line": 153, "function": "dispatch", "class": "OC\AppFramework\Http\Dispatcher", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/Route/Router.php", "line": 321, "function": "main", "class": "OC\AppFramework\App", "type": "::" },
{ "file": "/var/www/nextcloud/lib/base.php", "line": 1155, "function": "match", "class": "OC\Route\Router", "type": "->" },
{ "file": "/var/www/nextcloud/index.php", "line": 25, "function": "handleRequest", "class": "OC", "type": "::" }
],
"File": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
"Line": 284,
"message": "Budget app error: Did expect one result but found none when executing: query "SELECT
t.* FROM*PREFIX*budget_transactionstINNER JOIN*PREFIX*budget_accountsaONt.account_id=a.idWHERE (t.id= :dcValue1) AND (a.user_id= :dcValue2)"; ","transactionId": "9",
"CustomMessage": "Budget app error: Did expect one result but found none when executing: query "SELECT
t.* FROM*PREFIX*budget_transactionstINNER JOIN*PREFIX*budget_accountsaONt.account_id=a.idWHERE (t.id= :dcValue1) AND (a.user_id= :dcValue2)"; ",}
}
{
"reqId": "ahwAPzgMXTrgEDsDL4IejwAAADw",
"level": 3,
"time": "2026-05-31T09:32:47+00:00",
"remoteAddr": "<REDACTED_IP>",
"user": "<REDACTED_USER>",
"app": "budget",
"method": "POST",
"url": "/index.php/apps/budget/api/shared/shares/split",
"scriptName": "/index.php",
"message": "Failed to split 50/50",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36 Edg/148.0.0.0",
"version": "33.0.4.1",
"exception": {
"Exception": "OCP\AppFramework\Db\DoesNotExistException",
"Message": "Did expect one result but found none when executing: query "SELECT
t.* FROM*PREFIX*budget_transactionstINNER JOIN*PREFIX*budget_accountsaONt.account_id=a.idWHERE (t.id= :dcValue1) AND (a.user_id= :dcValue2)"; ","Code": 0,
"Trace": [
{ "file": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php", "line": 382, "function": "findOneQuery", "class": "OCP\AppFramework\Db\QBMapper", "type": "->" },
{ "file": "/var/www/nextcloud/apps/budget/lib/Db/TransactionMapper.php", "line": 58, "function": "findEntity", "class": "OCP\AppFramework\Db\QBMapper", "type": "->" },
{ "file": "/var/www/nextcloud/apps/budget/lib/Service/SharedExpenseService.php", "line": 171, "function": "find", "class": "OCA\Budget\Db\TransactionMapper", "type": "->" },
{ "file": "/var/www/nextcloud/apps/budget/lib/Controller/SharedExpenseController.php", "line": 318, "function": "splitFiftyFifty", "class": "OCA\Budget\Service\SharedExpenseService", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "line": 205, "function": "splitFiftyFifty", "class": "OCA\Budget\Controller\SharedExpenseController", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "line": 118, "function": "executeController", "class": "OC\AppFramework\Http\Dispatcher", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/AppFramework/App.php", "line": 153, "function": "dispatch", "class": "OC\AppFramework\Http\Dispatcher", "type": "->" },
{ "file": "/var/www/nextcloud/lib/private/Route/Router.php", "line": 321, "function": "main", "class": "OC\AppFramework\App", "type": "::" },
{ "file": "/var/www/nextcloud/index.php", "line": 25, "function": "handleRequest", "class": "OC", "type": "::" }
],
"File": "/var/www/nextcloud/lib/public/AppFramework/Db/QBMapper.php",
"Line": 284,
"message": "Failed to split 50/50",
"CustomMessage": "Failed to split 50/50"
},
"userId": "<REDACTED_USER>",
"id": "6a1c00f9defc3"
}