Bug 509104 - Database-Error when deleting unused Payees
Summary: Database-Error when deleting unused Payees
Status: REPORTED
Alias: None
Product: kmymoney
Classification: Applications
Component: database (other bugs)
Version First Reported In: 5.2.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-04 12:53 UTC by Fabiano Caruana
Modified: 2025-09-07 16:13 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot Error (49.19 KB, image/png)
2025-09-04 12:53 UTC, Fabiano Caruana
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabiano Caruana 2025-09-04 12:53:43 UTC
Created attachment 184708 [details]
Screenshot Error

SOFTWARE/OS VERSIONS

KMyMoney 5.2.1 and 5.1.3
Linux OpenSuse 16.0 and 15.6

Hello KMyMoney Team,

Serious error when using an SQLite database (possibly also MySQL).
If I try to delete payees with the status "unused," the stored account numbers are deleted for all payees.
I can also save the database (without an error message).
That's not enough. From now on, I can no longer save anything to the database.
Error message: payeeIdentifier with id 'IDENT00005' not found ... (see screenshot)
All records in the "kmmPayeeIdentifier" table have been deleted.
All records are still present in the "kmmPayeesPayeeIdentifier" table.
This problem also occurs with KMyMoney 5.1.3.
But this wasn't always the case, and I can't determine when the problem started.

The problem only affects the database. When used with the .kmy file, everything works normally, and the account numbers are not deleted.

FYI: I work with SQLCipher with encryption, but I've also written my own database analyses in SQL, so I want to continue working with databases.
Workaround for me:
- Save in .kmy file
- Delete payees with "unused" status
- Save changed data in a new database.

Regards
Udo

It looks like Bug 413535 https://bugs.kde.org/show_bug.cgi?id=413535 ?
Comment 1 Jack 2025-09-07 16:13:17 UTC
It does look like the same issue, but since that was resolved by manually resetting the "bad" transactions to point to valid accounts, it doesn't actually help any.  Since saving to a .kmy file works OK, there seems to be no problem with the main logic.  We will need to dig into the code which saves the data as an sql database.