Reply to topic

Database corruption

jbernardo
Registered Member
Posts
18
Karma
0

Database corruption

Sun Dec 16, 2018 11:42 am
Hello,
I am finding that I might have database corruption issues. Specifically, national account number, IBAN and BIC aren't saved for the payees. In some cases, pressing "update" after inserting them seems to work. In others, it gives an error of an ID not found. I checked on DB browser, and the tables kmmNationalAccountNumber and kmmIbanBic are almost empty.
However, the second issue with this corruption is that now I have several payees "sharing" the national account or the IBAN/BIC .
I can introduce these values again, but apparently I'll need to remove all relations to these two tables.

Anyone can point me to the full KMyMoney database schema, as the one in chapters 22/23 is incomplete and doesn't mention these two tables?
jbernardo
Registered Member
Posts
18
Karma
0

Re: Database corruption

Sun Dec 16, 2018 12:02 pm
:( Even the account and IBANs that were correct are now missing from the db. seems like closing kmymoney with a crash on introducing these values empties these two tables.
User avatar ipwizard
KDE Developer
Posts
691
Karma
3
OS

Re: Database corruption

Sun Dec 16, 2018 12:09 pm
That is not good. On the other hand, that is what backups are good for. But seriously, which version of KMyMoney are you using? This is a significant bit of information which is currently missing.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.0 64bit, KF5
jbernardo
Registered Member
Posts
18
Karma
0

Re: Database corruption

Sun Dec 16, 2018 1:57 pm
Oops... Sorry, I am running version 4.8.2 under MX Linux (debian based).

As for backups, it is a bit late... I have so much information on the DB, in particular stuff hand-corrected dating back 4 years or more, that I don't really want to go back. And my backups might already be corrupted, I need to check the older versions, from around January, if the issue was already there.
jbernardo
Registered Member
Posts
18
Karma
0

Re: Database corruption

Sun Dec 16, 2018 2:09 pm
Just had the same error on a payee to which I had added IBAN/National Number, I was trying to set the default account.
"Unable to modify payee
Details
payeeIdentifier with id "IDENT000005" not found. thrown in
$HOME/kmymoney/kmymoney-4.8.2/kmymoney/mymoney/storage/mymoneystoragesql.cpp:3,522"

kmmPayeeIdentifier is empty.

Should I clear kmmPayeesPayeeIdentifier and start again adding the IBANs?
jbernardo
Registered Member
Posts
18
Karma
0

Re: Database corruption

Sun Dec 16, 2018 2:26 pm
Ok, it looks like I might need to do a full bug report now. I decided to save the database with another name to preserve the corrupted one and being able to continue to work inputting my expenses, and just found out that the new db is created with an empty kmmPayeesPayeeIdentifier, and doesn't have a kmmNationalAccountNumber and kmmIbanBic.
Started added IBAN/BIC/National account number on the new copy of the DB, and at least the first one has two properly created entries in kmmPayeesPayeeIdentifier, another two in kmmPayeeIdentifier, and one each in kmmNationalAccountNumber and kmmIbanBic, with the correct ID.
If this workaround holds, I'll be doing backups more often, in particular of these 4 tables, and checking the database after every use of kmymoney...
User avatar ipwizard
KDE Developer
Posts
691
Karma
3
OS

Re: Database corruption

Sun Dec 16, 2018 2:33 pm
It might be feasible to take a look at the data (using some sort of SQL browser). The following tables seem to be of interest:
  1. kmmPayees
  2. kmmPayeesPayeeIdentifier
  3. kmmPayeeIdentifier
  4. kmmIbanBic
Except the first one, it seems to be safe to clear all data contained. The kmmNationalAccountNumber table might not be present if not used. AFAIR it is created on the fly if needed. The same applies to the kmmIbanBic table.

p.s. I wrote this in parallel to your last message.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.0 64bit, KF5
jbernardo
Registered Member
Posts
18
Karma
0

Re: Database corruption

Sun Dec 16, 2018 2:48 pm
I've opened bug #402194 - https://bugs.kde.org/show_bug.cgi?id=402194
On my machine the IBAN, National Account, and PayeeIdentifier entries keep being deleted on their respective tables, while PayeesPayeeIdentifier keeps growing.
User avatar ipwizard
KDE Developer
Posts
691
Karma
3
OS

Re: Database corruption

Sun Dec 16, 2018 2:58 pm
Did you already try to use 5.0.2 instead (if you can)?


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.0 64bit, KF5
jbernardo
Registered Member
Posts
18
Karma
0

Re: Database corruption

Sun Dec 16, 2018 3:18 pm
ipwizard wrote:Did you already try to use 5.0.2 instead (if you can)?

I think I'll need to build it for MX Linux... :) I thought on using an appimage, but it starts by claiming that "QT SQL driver SQLITE is no longer installed on your system".
jbernardo
Registered Member
Posts
18
Karma
0

Re: Database corruption

Sun Dec 16, 2018 3:47 pm
“Curiouser and curiouser!”
Saving to postgres (which means I need to create a DB called KMyMoney as the db created by kmymoney is called kmymoney and the inserts then fail) ends up failing, apparently with a non-terminated string in a kmmSplits transaction. Time to try to find and correct it on 4.8.2, maybe it is connected to the issue at hand.


Ok, I found four (times two) entries in kmmSplits with the memo field as a BLOB. Those entries would break the export to postgresql, no idea if they had anything to do with the disappearing IBANs. Replaced them with text using "DB Browser for SQLITE", apparently didn't break anything. Should I open a bug also for this, errors exporting to postgresql when a field is a blob instead of text?

The disappearing IBANs/National account number continue despite removing the blobs from kmmSplits. Apparently there is no direct connection. Time to check with 5.0.2 appimage.

 
Reply to topic

Bookmarks



Who is online

Registered users: airdrik, Art.of.Jules, Baidu [Spider], Bing [Bot], claydoh, emonhaque, farid, Google [Bot], pasis, smankowski, Yahoo [Bot]