Error on 'Save as database'

timothy timboyle at afrihost.co.za
Sat Sep 1 15:48:06 BST 2018


On Sat, 2018-09-01 at 10:06 -0400, Jack wrote:
> On 2018.09.01 09:50, timothy wrote:
> > Hi
> > KMyMoney Version 4.8.1-ebeeced071
> > Using KDE Development Platform 4.14.2
> > Running on LMDE 2 O/S
> > 
> > I get the following error during 'Save to database'
> > --------------------------------
> > Sorry-KMyMoney
> > Cannot save to current database: Error in function void
> > MyMoneyStorageSql::writeSchedule(const MyMoneySchedule&, QSqlQuery&,
> > bool) : writing Schedules
> > Driver = QSQLITE, Host = localhost, User = timothy, Database
> > = /home/timothy/data/sqlite/test.db
> > Driver Error:
> > Database Error No -1:
> > Text:
> > Error type 0
> > Executed: INSERT INTO kmmSchedules (id, name, type, typeString,
> > occurence, occurenceMultiplier, occurenceString, paymentType,
> > paymentTypeString, startDate, endDate, fixed, lastDayInMonth,  
> > autoEnter,
> > lastPayment, nextPaymentDue, weekendOption, weekendOptionString)  
> > VALUES
> > (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
> > Query error No 19: NOT NULL constraint failed: kmmSchedules.startDate
> > Unable to fetch row
> > Error type 1
> > -------------------------------------
> > 
> > My data is consistent.
> > The database file is created by KMM and tables, views etc are also
> > created with the appropriate column headings, but no values/data are
> > inserted.
> > I tried creating the db file separately, but got the same error.
> > 
> > I tried on Linux Mint 19 with Kmymoney 5 with the same kmm file and  
> > got
> > the same error with the same db configuration.
> > 
> > Is there something wrong with my .kmy file? How does the database  
> > handle
> > the numerator/denominator format of some kmm values? Am I doing or not
> > doing something to cause the error?
> > 
> > Any help please.
> > 
> > Regards
> > Timothy
> Hi Timothy,
> 
> Note that the error refers to schedules, and seems to be saying that a  
> value of startDate is NULL (i.e., missing) when it should not be.  I  
> don't see how this could happen, but look through your scheduled  
> transactions to see if any of them are, in fact, missing a start date.
> 
> I don't use the database back end myself, so I'll have to do some  
> looking.  Without seeing the SQL, I would guess that numerator and  
> denomenator are simply stored as two separate integers, but that  
> doesn't seem relevant to your problem.
> 
> It also seems odd that the message says "Query error" but that's right  
> after an Insert statement, so I'm not sure if there is only one or  
> actually two different errors.  In addition, that line of question  
> marks seems suspect.  I don't know if it's just printing those as  
> placeholders, or if it's actually trying to insert a bunch of values  
> which are missing or it can't interpret and prints question marks  
> instead.  Again, it will take a bit of digging into the code, unless  
> one of the developers chimes in.
> 
> Jack

Many thanks Jack for the pointers.

I tried cleaning up the scheduled transactions as suggested and found
one scheduled deposit which was way out of date and in fact should not
have been there at all.

The file then saved to the database cleanly and I could load it back in
without error.

The consistency check obviously does not go that finely into the data?

Regards
Timothy




More information about the KMyMoney mailing list