Kmymoney 5.2.1 ruined my kmy file

After it updated Kmymoney to 5.2.1 then I had issues with Kmymoney not showing the 2 decimal points for one of my accounts. Then later it stopped booting up my kmy files and I would get the “Problem Opening Storage” comment

File /run/user/1000/doc/f0587e68/StevesIncome&Expenses1.kmy is already opened by another process.

I looked and found that /run is a temporary folder which should clear at reboot but for me it doesn’t. Also my file isn’t located at this location but at my /dropbox folder. Anybody got an idea of what has happened after the new update come through.

I read that someone had something similar and it turns out that /run/user/1000/ is associated with snap or flatbed.

Anyone can help me out?

That style of path is indeed used in flatpaks and I believe snaps to map filesystem paths into the sandbox. It sounds like the lockfile did not get deleted the last time KMyMoney was closed. I’m not sure how flatpaks work with dropbox, but you could try relaxing the filesystem permissions. You can run KMyMoney with flatpak run --filesystem=home org.kde.kmymoney to try it or use Flatseal to set the permissions. I don’t have a dropbox account to test it myself.

Or --filesystem=host for even broader permissions. I don’t know how dropbox appears to the flatpak.

I did what you said and run “flatpak run --filesystem=home org.kde.kmymoney”

It didn’t work still came up with the same error. I’ve got the output with any errors it encountered. If you want to see the output from terminal command I can send it to you as an email or you tell me how to send it to you

If the output is not sensitive you can put it in a pastebin like https://paste.opensuse.org/

Sorry I neglected to say, you may need to delete the lockfile manually. First make sure KMyMoney is closed. Then find the lockfile and delete it. It should be beside your .kmy file, but in this case it may be in /run/user/1000/doc/f0587e68/ instead. Then try opening KMyMoney again with the same command. Try opening your file again with the “Open” dialog so it doesn’t go through the /run/user/1000/doc/f0587e68/ path again.

Actually, now that I think a little more, you may not need to bother with the lockfile. Try just opening KMyMoney with the home permission and open your file with the “Open” dialog.

Since KMyMoney always tries to open the last opened file, you may as well start it with the option -n from the command line which suppresses this and allows to use the “Open” method.

1 Like

I tried your suggestion in terminal Kmymoney -n and after Kmymoney opens I tried to open my file ********Expenses.kmy I get the following error message

Cannot open file as requested.

Details Unknown account id ‘254-category’ ./kmymoney/mymoney/storage/mymoneystoragemgr.cpp:132

I don’t get the other error message signifying that the file is locked

I sort of remember that we had the same problem lately. This ID is not issued by KMyMoney. Did you import the date from some other tool?

Anyway, the account with ID 254-category is referenced by something (transaction, report, …) inside your file which causes the load to fail (your data was corrupt before but KMyMoney failed to report it in older versions). Maybe it is a matched transaction.

I don’t remember where this topic was discussed but maybe someone else here can chime in.

How about https://bugs.kde.org/show_bug.cgi?id=507416 where it was from an old import from Skrooge.

So there is no way for me to open this file and deleting the mismatched transactions?

When I was able to open it in Kmymoney 5.2.1, it did refer to a mismatch which I was trying to fix and then Kmymoney crashed. The old Kmymoney maybe 4.9 or 5.0 allowed me to open for 12 months without mentioning anything. Now 5.2.1 is not opening it.

What originally got imported has always been illegal syntax for the xml file (even if compressed in the kmy file) but it was never tested for, and so never triggered any special warning or action. Since 5.2 (I think) it is tested and caught on import, which then fails.

I’m a little unsure of what you have tried with which version. This thread has essentially changed topic from a 5.2.1 flatpak permission related issue to one about how to correct invalid data created by an old import.

Which exact version were you last able to use to open this file? Which version are you currently using? Released versions do not change, so if you did open the file, you should still be able to do so with the same version. Once you start using versions compiled from git (whether from master or 5.2 branch) things change in every version. Once we find a version that will let you open the file, we can address how to find and fix the bad references.

All my problems started to happen in the last few days (from Thursday),

1. when my program said there was a problem with 2 entries which I tried to fix it and then the programmed crashed at that stage. I tried to reboot kmymoney and then I got the issue of: “not able to open the file because it is already opened by another process" that is the following error.

“File /run/user/1000/doc/f0587e68/StevesIncome&Expenses1.kmy is already opened by another process“

As far as I remember I haven’t done an update in the last week so the version of the Kmymoney has been 5.2.1 for all of the problems which I have experienced. I probably haven’t used my Kmymoney for 2 weeks so maybe it was updated in that last 2 weeks. When I look at the software centre for my Ubuntu it shows Kmymoney as a flathub installation and its version is 5.2.1.

Just now I thought what version is on the Ubuntu deb repository so I look at synaptic program installer and it had an older version of Kmymoney 5.13.

So just now I uninstalled Kmymoney 5.2.1 from a flathub and installed Kmymoney 5.1.3 and tried to run .kmy program. But I got this message

Cannot open file as requested.

Details

Unknown account id ‘254-category’ ./kmymoney/mymoney/storage/mymoneystoragemgr.cpp:132

I tried to run an old backup copy of StevesIncome&Expenses1.kmy which I saved in July and it worked fine with Kmymoney 5.1.3

Ostroffjh, you mention

“Once we find a version that will let you open the file, we can address how to find and fix the bad references”

Can you now help me to fix the offending errors then I will install the Kmymoney 5.2.1 and start updating my income and expenditure and get it back to a current form

I’ll try to start with a more generic overview describing how I see the process. Please ask more questions if you need more details. The issue is that the id for some categories is something like 254-category instead of A0123456. You need to identify each category with such an id, create a new category to replace it, delete the old category and use the new category you just created when the program asks where to assign any references to the old one.

Unfortunately, I don’t know of any way to search for such categories in KMyMoney. Also, the Show Transaction Details was not added until 5.2, so that won’t be able to help you. What you can do is use grep on your data file. Off the top of my head ‘grep “ACCOUNT.?id=.?-category\” datafile.xml’ should be close. You are looking for ACCOUNT lines in the file where id=”nnn-category”. Depending on your comfort with playing with grep, you might also do it in two steps - ‘grep “^<ACCOUNT” file.xml | grep “-category”’ which finds any line starting with <ACCOUNT and later containing “-category”. Once you find those lines, you can see the name attribute to get the name of the category. Note if your file is kmy and not xml, you should be able to use zgrep instead of grep.

I can open my file with 5.2.1 if the file was created in 5.1.3 and then edit it. But when I save it as a 5.2.1 version. It won’t let me open it up again it says that the file is already open even if I have closed Kmymoney.kmy file.

This is the error I get (I no longer have it in dropbox)

File /home/xxxxx/Documents/Data_base/Finance/Finance_SGL_5_2_1_Version.kmy is already opened by another process

I tried what you said Ostroffjh above but couldn’t find anything. Now since I can edit the file in 5.2.1 and if I don’t close the file how can I find the offending Category and amend it?

Details Unknown account id ‘254-category’

Is that path on a local drive or some network share? Try to open a file you store on a local disc. Does it also show the above message?

Answering your question: This is a local drive not a network.

Regarding my original problem

When Kmymoney updated to 5.2.1 I got the following error:

Details Unknown account id ‘254-category’

and couldn’t open my file. In order to solve my original error ‘254-category’ I was told I had to remove the offending category and my file should run in the new version of Kmymoney

KDE Site issue

Also I am only allowed to reply to this post 3 times according to the KDE platform. This is very difficult if I want to solve my problem. Surely for the person who gives the original post of a problem should have more than 3 replies to solve it.

A limit of three replies to a post does seem very strange. Did it give any reason? Unfortunately, the KMM team has no control over discuss.kde.org, so that would have to be addressed with a new post targetted at the platform itself.

I’m a little confused. Your problem was created long ago when you imported data (from gnucash?) which created an invalid id for the category, which was not tested for by KMM. Fortunately, that id did not cause any problems. In 5.2.0, the routine which opens the data file checks for invalid syntax, and now refuses to open that file.

Some of your attempts to open the file give an error about it already being open in another process. The first thing to do is look for a lock file in the same folder as the data file. If you find one, and are absolutely certain nothing else has the file open, you can just delete the lock file. If that happens consistently, let us know, as it might be a new bug. It might also be a left over lock file from when you were perviously using dropbox, although that doesn’t seem likely.

When you say you couldn’t find anything using my suggestions, please be more specific. what command(s) did you use, and what was the result?

You also say you can now edit the file in 5.2.1, but how, if it complains about the problem category? If you can actually edit the file in 5.2.1, something in the data has changed.

In terms of finding the offending Category, I think you need to use grep or zgrep (grep works for plain text (including xml) files, but zgrep works for compressed files, such as .kmy. You can simply ‘zgrep 254-category your-date-file.kmy’ but that will show you not only the <ACCOUNT …..> line which defines the account for that category (and the “name” attribute on that line shows you the Category you need to replace) but will also list every transaction that uses it. “zgrep 254-category your-data-file.kmy | grep ACCOUNT” should limit it to the one line you need. Once you have the category name, you can open your file (most likely in 5.1.3, create a new category (use a name different from the old one so you can distinguish, and you can change it later) and the delete the old category, telling KMM to use the new category as a replacement.

  1. Limit to 3 replies. Here is the comment given: “New users are temporarily limited to 3 replies in the same topic. Please consider visiting other topics to keep getting to know the community.”
  2. Yesterday, I opened my old 5.1.3 version Kmymoney.kmy file (July 2025) and entered all the expenditure I had done since July 2025 to today using my 5.1.3 program
  3. My “5.2.1 version Kmymoney” can open my “5.1.3 version file” but after opening it and saving it as the new version 5.2.1, it wont open it again after closing it, it says: “File /home/steveglilley/Documents/Data_base/Finance/Finance_SGL_5_2_1_Version.kmy is already opened by another process.“
  4. Yes there is a lock file there “Finance_SGL_5_2_1_Version.kmy.lck” in the same directory, when I delete it and try to open the file again (Finance_SGL_5_2_1_Version.kmy ) it still refuses to open it saying the same issue: “File /home/steveglilley/Documents/Data_base/Finance/Finance_SGL_5_2_1_Version.kmy is already opened by another process.”
  5. And I haven’t yet got this error message yet which I got previously, ie: “Details Unknown account id ‘254-category’“