Errors when closing KMyMoney

Thomas Spuhler thomas.spuhler at btspuhler.com
Tue Mar 1 15:23:37 UTC 2016


On Monday, February 29, 2016 08:21:18 PM Jack wrote:
> On 2016.02.26 12:22, Thomas Spuhler wrote:
> > On Friday, February 26, 2016 11:54:29 AM aga wrote:
> > > On 25/02/16 23:13, Thomas Spuhler wrote:
> > > > On Wednesday, February 24, 2016 07:23:15 PM Thomas Baumgart wrote:
> > > >> On Tuesday 23 February 2016 14:58:24 Thomas Spuhler wrote:
> > > >>> I got again an error (crash) when exiting KMyMoney
> >>>>> 
> >>>>> Unknown account id 'A000101' in file
> >>>>> /home/iurt/rpmbuild/BUILD/kmymoney-4.7.2/kmymoney/mymoney/storage/mymo
> >>>>> neyseq accessmgr.cpp line 146
> >>>> 
> >>>> Hmm, looks like the application is trying to access an account
> >>>> that is not present (anymore).
> 
> I would like to go back to the beginning here.  Are you still getting
> the error?  Do you get the same error saving as a file as well as using
> the database?  
The error comes up on random closes. I haven't used the program much since I 
filed the report. And no, it hasn't come up again. I will let you know, when it 
will come up and if it will be the same error.
> As Thomas said, it is complaining that it can't find the
> account, but that account seems to be present based on what you
> extracted from the database (below).  I'm also not sure why it would be
> checking on accounts when exiting.  Can you confirm this error happens
> when you try to close the program, not when you try to do anything else?
> 
> > > >> What did you do before?
> > > > 
> > > > Entered data
> >>>> 
> >>>> Can you try to take a look at the file (it's compressed XML) and
> >>>> see where the pattern A000101 is referenced?
> >> 
> >> I'm pretty certain Thomas was referring to your data file, rather
> >> than the source code, as he wanted you to search for an account id
> >> 'A000101' which, it is hoped, will be found in your data file
> >> (xxx.kmy).
> > 
> > Allan, I don't think I have such a file, but found the information in
> > the database file
> > This is the line in table  kmmAccounts
> > 
> > ('A000100',NULL,'A000098',NULL,NULL,'2010-12-19',NULL,'12','Income','N','S
> > hort
> > Term',NULL,'USD','0/1','0',0),('A000101',NULL,'AStd::Income',NULL,'2016-0
> > 2-23
> As I said before, this looks like data from one and a half rows from
> the database.  Can you extract the complete record for A000101?
> 
> > > > This is the section of the cpp file:
> > > > /**
> > > > * This method is used to get a SQL reader for subsequent database
> > 
> > access
> > 
> > > >   */
> > > > 
> > > > KSharedPtr <MyMoneyStorageSql>
> > 
> > MyMoneySeqAccessMgr::connectToDatabase
> > 
> > > > (const KUrl& /*url*/)
> > > > {
> > > > 
> > > >    return KSharedPtr <MyMoneyStorageSql>();
> > > > 
> > > > }
> > > > 
> > > > bool MyMoneySeqAccessMgr::isStandardAccount(const QString& id)
> > 
> > const
> > 
> > > > {
> > > > 
> > > >    return id == STD_ACC_LIABILITY
> > > >    
> > > >           || id == STD_ACC_ASSET
> > > >           || id == STD_ACC_EXPENSE
> > > >           || id == STD_ACC_INCOME
> > > >           || id == STD_ACC_EQUITY;
> > > > 
> > > > }
> > > > 
> > > > void MyMoneySeqAccessMgr::setAccountName(const QString& id, const
> > 
> > QString&
> > 
> > > > name)
> > > > {
> > > > 
> > > >    if (!isStandardAccount(id))
> > > >    
> > > >      throw MYMONEYEXCEPTION("Only standard accounts can be
> > 
> > modified using
> > 
> > > > setAccountName()");
> > > > 
> > > >    MyMoneyAccount acc = m_accountList[id];
> > > >    acc.setName(name);
> > > >    m_accountList.modify(acc.id(), acc);
> > > > 
> > > > }
> > > > 
> > > > const MyMoneyAccount MyMoneySeqAccessMgr::account(const QString&
> > 
> > id) const
> > 
> > > > {
> > > > 
> > > >    // locate the account and if present, return it's data
> > > >    if (m_accountList.find(id) != m_accountList.end())
> > > >    
> > > >      return m_accountList[id];
> > > >    
> > > >    // throw an exception, if it does not exist
> > > >    QString msg = "Unknown account id '" + id + '\'';
> > > >    throw MYMONEYEXCEPTION(msg);
> > > > 
> > > > }
> 
> The above error says line 146 of the file, which (in the version I
> have) is that last "throw" command above.  I don't think the SQL stuff
> at the beginning of what you quote from the file is relevant.
> 
> > > >> This is very strange.
> 
> It is complaining it can't find an account which does seem to be
> present in the data.  It would really help if you can produce an
> anonymized file which still shows the error.
> 
> 
> Jack

-- 
Best regards
Thomas Spuhler

All of my e-mails have a valid digital signature
ID 60114E63
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kmymoney/attachments/20160301/79382fdb/attachment.sig>


More information about the KMyMoney mailing list