Bug 425169 - Cannot open file unknown account id
Summary: Cannot open file unknown account id
Status: RESOLVED WORKSFORME
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.1.0
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-09 18:51 UTC by andy_1717
Modified: 2021-12-02 04:38 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andy_1717 2020-08-09 18:51:23 UTC
SUMMARY
Saved a file and had the error message appear:
Unknown account id 'A000065' /build/kmymoney/src/kmymoney-5.1.0/kmymoney/kmymoney/storage/mymoneystoragemgr.cpp:142

STEPS TO REPRODUCE
1. unknown, maybe I deleted a scheduled payment before saving when the error happened. I deleted a few categories as well.

I can open other saved files but not this one.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Manjaro

ADDITIONAL INFORMATION
I opened kmymoney to a blank or preexisting file and turned off 'check schedules on start up' but I get the same error. I've lost a lot of data if I can't get this back. Don't think I'll use this product again if that's the case.
Comment 1 jmadero 2020-08-09 21:09:04 UTC
> 
> ADDITIONAL INFORMATION
> I opened kmymoney to a blank or preexisting file and turned off 'check
> schedules on start up' but I get the same error. I've lost a lot of data if
> I can't get this back. Don't think I'll use this product again if that's the
> case.

Usually not a good move to "threaten" to stop using free software. The reply is usually "ok, then stop using it".

I'm assuming you are not willing to share the file itself so that a developer can try to open it? Are you able to follow these instructions to open the file and visually inspect? https://docs.kde.org/stable5/en/extragear-office/kmymoney/details.formats.html
Comment 2 Jack 2020-08-09 22:20:40 UTC
In particular, I would add that if you uncompress the file, you should grep for A000065.  There "should" be a line beginning with ACCOUNT with that as the id= value.  If there is no such line present, then the account seems to have been deleted without deleting all other references to it, which should not happen.  Did you delete any account(s) during the last successful use of the file?  Did you notice any odd or warning messages?  Without any more information, it's going to be very hard (if even possible) for the developers to figure out what happened, and to figure out if there is a possibility of resolving the problem.

On backups - when was your last good backup of the file?  Do you happen to have automatic backups turned on?  If so, then in the same directory as your file.kmy should be file.kmy.1~ up to file.kmy.10~ (depending on the configuration setting.)
Comment 3 Thomas Baumgart 2020-08-10 05:41:42 UTC
I am expecting, that grepping for A000065 does not show the ACCOUNT line, because otherwise KMyMoney would not present the error message provided. More intersting is to know, where A000065
Comment 4 Thomas Baumgart 2020-08-10 05:44:11 UTC
I am expecting, that grepping for A000065 does not show the ACCOUNT line, because otherwise KMyMoney would not present the error message provided. More intersting is to know, where A000065

(sorry, accidentally pressed the save button too early)

is referenced (the type of node would be a minimum, anything else you can provide is very welcome).
Comment 5 andy_1717 2020-08-10 09:04:30 UTC
(In reply to jmadero from comment #1)
> > 
> > ADDITIONAL INFORMATION
> > I opened kmymoney to a blank or preexisting file and turned off 'check
> > schedules on start up' but I get the same error. I've lost a lot of data if
> > I can't get this back. Don't think I'll use this product again if that's the
> > case.
> 
> Usually not a good move to "threaten" to stop using free software. The reply
> is usually "ok, then stop using it".
> 
> I'm assuming you are not willing to share the file itself so that a
> developer can try to open it? Are you able to follow these instructions to
> open the file and visually inspect?
> https://docs.kde.org/stable5/en/extragear-office/kmymoney/details.formats.
> html

To address your comment about threating. I think it's important that developers or anyone helping understands the impact of a bug, which is what I've provided. No software owner should be happy with a bug that will loose them customers, regardless if it's free.

The file is encrypted and won't let me use gunzip after I changed the file name. Not sure if there's any other steps I need to do. I read all the pages on the link you provided and they didn't say anything else. I'd rather not share the file and I'd rather rebuild from scratch.
Comment 6 Thomas Baumgart 2020-08-10 11:16:00 UTC
Believe us that the developers of KMyMoney are very cautious if it comes to this kind of problem. Data loss must not happen. The second largest is data inconsistency, btw.  On the other hand, if data loss happens nevertheless, they are very helpful to get your data back and understand the sensitivity of the data itself. But for this to be successful, they need your support on your end. This includes being precise and giving as much information as possible. Please tell us any commercial package where you get this kind of support?

You mention, that your file is encrypted. In case your data file has been written through GPG (the KMyMoney method) your can simply use 

  gpg -d filename.kmy > filename.xml

to decrypt it. Then run the checks that have been mentioned before on filename.xml. In case we find something to fix your problem, we will do it on filename.xml. KMyMoney can read this file directly and encrypt it during the next save.
Comment 7 andy_1717 2020-08-10 12:45:26 UTC
(In reply to Thomas Baumgart from comment #6)
> Believe us that the developers of KMyMoney are very cautious if it comes to
> this kind of problem. Data loss must not happen. The second largest is data
> inconsistency, btw.  On the other hand, if data loss happens nevertheless,
> they are very helpful to get your data back and understand the sensitivity
> of the data itself. But for this to be successful, they need your support on
> your end. This includes being precise and giving as much information as
> possible. Please tell us any commercial package where you get this kind of
> support?
> 
> You mention, that your file is encrypted. In case your data file has been
> written through GPG (the KMyMoney method) your can simply use 
> 
>   gpg -d filename.kmy > filename.xml
> 
> to decrypt it. Then run the checks that have been mentioned before on
> filename.xml. In case we find something to fix your problem, we will do it
> on filename.xml. KMyMoney can read this file directly and encrypt it during
> the next save.

I found the backups thank you! Is there anywhere I can put a suggestion into the developers. I think autosave and autosave versions should be 'on' by default. As a new user to this software I could have lost hours of work if I didn't go through all the settings first.

I have decrypted that file now with that command thanks. Here is the only line that has the account referenced (Line 30). I've starred out some sensitive data and I can upload the full XLM if it helps, I'll need time to star out the sensitive data that's all:


<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE KMYMONEY-FILE>
<KMYMONEY-FILE>
 <FILEINFO>
  <CREATION_DATE date="2020-07-26"/>
  <LAST_MODIFIED_DATE date="2020-08-09"/>
  <VERSION id="1"/>
  <FIXVERSION id="5"/>
 </FILEINFO>
 <USER email="" name="******">
  <ADDRESS street="" zipcode="" county="" city="" telephone=""/>
 </USER>
 <INSTITUTIONS count="6">
  <INSTITUTION id="I000001" manager="" sortcode="********" name="Nationwide">
   <ADDRESS street="" zip="" city="" telephone=""/>
   <ACCOUNTIDS>
    <ACCOUNTID id="A000001"/>
    <ACCOUNTID id="A000008"/>
    <ACCOUNTID id="A000105"/>
    <ACCOUNTID id="A000121"/>
   </ACCOUNTIDS>
   <KEYVALUEPAIRS>
    <PAIR value="********" key="bic"/>
    <PAIR value="" key="url"/>
   </KEYVALUEPAIRS>
  </INSTITUTION>
  <INSTITUTION id="I000002" manager="" sortcode="********" name="MBNA">
   <ADDRESS street="" zip="" city="" telephone=""/>
   <ACCOUNTIDS>
    <ACCOUNTID id="A000093"/>'A000065'
   </ACCOUNTIDS>
Comment 8 andy_1717 2020-08-10 12:48:05 UTC
Might be worth noting that I have auto save to every 5 min. And that's why I'm a little unsure what was the last thing I changed as I was changing a few things. I did delete some accounts but nothing related to 000093 which is my credit card account. Not sure what the 000065 account was but I'll check my old versions and see if they have more entries of 000065.

Main thing is I have my data back.
Comment 9 antoine 2020-08-10 12:57:56 UTC
> 
> I have decrypted that file now with that command thanks. Here is the
> only line
> that has the account referenced (Line 30). I've starred out some
> sensitive data
> and I can upload the full XLM if it helps, I'll need time to star out
> the
> sensitive data that's all:
> 

You can save your file as an anonymous file, All your personal data
will become anonymous.

https://docs.kde.org/stable4/en/extragear-office/kmymoney/details.formats.anonymous.html
Comment 10 andy_1717 2020-08-14 20:06:31 UTC
I've obtained the following lines containing the account id 65. I can't tell if account id is a payee or category. I did delete the category "Other Tax" but that makes to change the category of any linked transaction.
I didn't touch the budget section. The last deletion I made was deleted a scheduled payment have setting it up straight away.

This might be related to Bug 402699 as I did delete categories but it's meant to be fixed. 

  <ACCOUNT type="13" name="Supplies" number="" parentaccount="AStd::Expense" institution="" description="" id="A000061" currency="GBP" lastmodified="" opened="1900-01-01" lastreconciled=""/>
  <ACCOUNT type="13" name="Taxes" number="" parentaccount="AStd::Expense" institution="" description="" id="A000062" currency="GBP" lastmodified="" opened="1900-01-01" lastreconciled="">
   <SUBACCOUNTS>
    <SUBACCOUNT id="A000065"/>
    <SUBACCOUNT id="A000066"/>
   </SUBACCOUNTS>
  </ACCOUNT>
  <ACCOUNT type="13" name="Other Tax" number="" parentaccount="A000062" institution="" description="" id="A000065" currency="GBP" lastmodified="2020-08-04" opened="1900-01-01" lastreconciled=""/>

  <TRANSACTION commodity="GBP" memo="" id="T000000000000000197" entrydate="2020-08-04" postdate="2020-08-03">
   <SPLITS>
    <SPLIT payee="P000014" account="A000001" number="" memo="" action="" id="S0001" reconciledate="" price="1/1" value="-2843/100" shares="-2843/100" reconcileflag="1" bankid=""/>
    <SPLIT payee="P000014" account="A000065" number="" memo="" action="" id="S0002" reconciledate="" price="1/1" value="2843/100" shares="2843/100" reconcileflag="0" bankid=""/>
   </SPLITS>
  </TRANSACTION>

  <SCHEDULED_TX type="1" occurenceMultiplier="1" endDate="" name="Road Tax" startDate="2020-08-01" lastDayInMonth="0" id="SCH000009" lastPayment="2020-08-03" occurence="32" fixed="1" autoEnter="1" weekendOption="1" paymentType="1">
   <PAYMENTS/>
   <TRANSACTION commodity="GBP" memo="" id="" entrydate="" postdate="2020-09-01">
    <SPLITS>
     <SPLIT payee="P000014" account="A000001" number="" memo="" action="" id="S0001" reconciledate="" price="1/1" value="-2843/100" shares="-2843/100" reconcileflag="1" bankid=""/>
     <SPLIT payee="" account="A000065" number="" memo="" action="" id="S0002" reconciledate="" price="1/1" value="2843/100" shares="2843/100" reconcileflag="0" bankid=""/>
    </SPLITS>


   <ACCOUNT budgetsubaccounts="0" id="A000065" budgetlevel="monthbymonth">
    <PERIOD start="2021-07-01" amount="2843/100"/>
    <PERIOD start="2021-08-01" amount="2843/100"/>
    <PERIOD start="2021-09-01" amount="2843/100"/>
    <PERIOD start="2021-10-01" amount="2843/100"/>
    <PERIOD start="2021-11-01" amount="2843/100"/>
    <PERIOD start="2021-12-01" amount="2843/100"/>
   </ACCOUNT>
Comment 11 andy_1717 2020-08-14 20:09:02 UTC
(In reply to andy_1717 from comment #10)
> I've obtained the following lines containing the account id 65. I can't tell
> if account id is a payee or category. I did delete the category "Other Tax"
> but that makes to change the category of any linked transaction.
> I didn't touch the budget section. The last deletion I made was deleted a
> scheduled payment have setting it up straight away.
> 
> This might be related to Bug 402699 as I did delete categories but it's
> meant to be fixed. 
> 
>   <ACCOUNT type="13" name="Supplies" number="" parentaccount="AStd::Expense"
> institution="" description="" id="A000061" currency="GBP" lastmodified=""
> opened="1900-01-01" lastreconciled=""/>
>   <ACCOUNT type="13" name="Taxes" number="" parentaccount="AStd::Expense"
> institution="" description="" id="A000062" currency="GBP" lastmodified=""
> opened="1900-01-01" lastreconciled="">
>    <SUBACCOUNTS>
>     <SUBACCOUNT id="A000065"/>
>     <SUBACCOUNT id="A000066"/>
>    </SUBACCOUNTS>
>   </ACCOUNT>
>   <ACCOUNT type="13" name="Other Tax" number="" parentaccount="A000062"
> institution="" description="" id="A000065" currency="GBP"
> lastmodified="2020-08-04" opened="1900-01-01" lastreconciled=""/>
> 
>   <TRANSACTION commodity="GBP" memo="" id="T000000000000000197"
> entrydate="2020-08-04" postdate="2020-08-03">
>    <SPLITS>
>     <SPLIT payee="P000014" account="A000001" number="" memo="" action=""
> id="S0001" reconciledate="" price="1/1" value="-2843/100" shares="-2843/100"
> reconcileflag="1" bankid=""/>
>     <SPLIT payee="P000014" account="A000065" number="" memo="" action=""
> id="S0002" reconciledate="" price="1/1" value="2843/100" shares="2843/100"
> reconcileflag="0" bankid=""/>
>    </SPLITS>
>   </TRANSACTION>
> 
>   <SCHEDULED_TX type="1" occurenceMultiplier="1" endDate="" name="Road Tax"
> startDate="2020-08-01" lastDayInMonth="0" id="SCH000009"
> lastPayment="2020-08-03" occurence="32" fixed="1" autoEnter="1"
> weekendOption="1" paymentType="1">
>    <PAYMENTS/>
>    <TRANSACTION commodity="GBP" memo="" id="" entrydate=""
> postdate="2020-09-01">
>     <SPLITS>
>      <SPLIT payee="P000014" account="A000001" number="" memo="" action=""
> id="S0001" reconciledate="" price="1/1" value="-2843/100" shares="-2843/100"
> reconcileflag="1" bankid=""/>
>      <SPLIT payee="" account="A000065" number="" memo="" action=""
> id="S0002" reconciledate="" price="1/1" value="2843/100" shares="2843/100"
> reconcileflag="0" bankid=""/>
>     </SPLITS>
> 
> 
>    <ACCOUNT budgetsubaccounts="0" id="A000065" budgetlevel="monthbymonth">
>     <PERIOD start="2021-07-01" amount="2843/100"/>
>     <PERIOD start="2021-08-01" amount="2843/100"/>
>     <PERIOD start="2021-09-01" amount="2843/100"/>
>     <PERIOD start="2021-10-01" amount="2843/100"/>
>     <PERIOD start="2021-11-01" amount="2843/100"/>
>     <PERIOD start="2021-12-01" amount="2843/100"/>
>    </ACCOUNT>
GRAMMAR
*I did delete the category "Other Tax" but that makes you change the category of any linked transaction.
I didn't touch the budget section. The last deletion I made was I deleted a scheduled payment after setting it up straight away.
Comment 12 Jack 2020-09-22 21:03:54 UTC
If you were using 5.1.0, then I don't think Bug 402699 would still be relevant, but I obviously can't be certain.  Just in case it might trigger any ideas, do you remember if "Other Tax" had any subcategories?  I assume it was nested under the "Taxes" category.  Since you have recovered your data, and I doubt it will be possible to reproduce the issue, I don't see any point in keeping this bug open, but I'm not sure the appropriate status to apply.
Comment 13 Jack 2021-11-02 19:37:55 UTC
Unless someone has anything to add, this will eventually get closed as "WORKSFORME"
Comment 14 Bug Janitor Service 2021-11-17 04:39:08 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 15 Bug Janitor Service 2021-12-02 04:38:42 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!