Page 1 of 1

malformed database - one more time

Posted: Wed Aug 28, 2013 9:05 pm
by Thomas Lohrum
I had another crash, which again resulted in a corrupted database. I can not reproduce. Nothing special i did either. But this time i had an annoying loss of data. The note i tried to save, when the crash occured got lost. I can not tell, whether this is a sqlite issue or the way CN integrates sqlite. I use secure settings, such as sqlite.pragma.journal_mode = WAL and sqlite.pragma.synchronous = FULL. I kindly ask you to enhance crash situations and to take care, no data gets lost. Imo, the least to do is to store the notes text (of the last active editor window, or even all of them) to a plain text-file besides the database file. This way at least i can get back my data.

Thomas

Re: malformed database - one more time

Posted: Thu Aug 29, 2013 5:39 am
by jjk
Hi all,

Support ++
I got also a malformed database, though I did nothing particular.

Re: malformed database - one more time

Posted: Thu Aug 29, 2013 6:08 am
by CintaNotes Developer
Hi,
could you both please tell me what is the value of your sqlite.pragma.journal_mode cintanotes.settings parameter please?
Thanks!

Re: malformed database - one more time

Posted: Thu Aug 29, 2013 6:31 am
by jjk
MEMORY for me.
TIA

Re: malformed database - one more time

Posted: Thu Aug 29, 2013 6:34 am
by jjk
Thomas Lohrum wrote:Imo, the least to do is to store the notes text (of the last active editor window, or even all of them) to a plain text-file besides the database file. This way at least i can get back my data.
Thomas

Or perhaps an XML file, updated automatically as daily or weekly backups.

Re: malformed database - one more time

Posted: Thu Aug 29, 2013 7:22 am
by CintaNotes Developer
jjk wrote:MEMORY for me.
TIA


Please change it to DELETE and this error shouldn't happen again.
New installations of CN now use DELETE mode automatically.

Re: malformed database - one more time

Posted: Thu Aug 29, 2013 9:15 am
by Thomas Lohrum
CintaNotes Developer wrote:Please change it to DELETE and this error shouldn't happen again.
New installations of CN now use DELETE mode automatically.

Hi Alex,

as posted, i use WAL. Still, crashes happen. I don't know, whether these are caused by CintaNotes or SQLite. But in the end, the database is malformed.

I did an integrity check; here is the result:

sqlite> pragma integrity_check;
*** in database main ***
On tree page 6683 cell 0: Bad ptr map entry key=6656 expected=(3,6683) got=(5,6631)
On tree page 6683 cell 0: 2nd reference to page 6656
Page 6682 is never used
rowid 12052 missing from index ix_Notes_Tags_tagid
rowid 12052 missing from index sqlite_autoindex_Notes_Tags_1
rowid 14691 missing from index ix_Notes_Tags_tagid
rowid 14691 missing from index sqlite_autoindex_Notes_Tags_1
wrong # of entries in index ix_Notes_Tags_tagid
wrong # of entries in index ix_Notes_Tags_noteid
wrong # of entries in index sqlite_autoindex_Notes_Tags_1


Thomas

Re: malformed database - one more time

Posted: Fri Aug 30, 2013 12:00 pm
by CintaNotes Developer
Thomas, thanks for the info!
Do I understand correctly that the DB became corrupted after CN crashed? Or was it a system crash?

According to the integrity check, mostly the indices suffered, and they are easy to rebuild (you already know how).
But I'm afraid to be able to fix this once and for all, we need a way to reproduce this kind of crash.

Re: malformed database - one more time

Posted: Fri Aug 30, 2013 5:54 pm
by Thomas Lohrum
CintaNotes Developer wrote:Thomas, thanks for the info!
Do I understand correctly that the DB became corrupted after CN crashed? Or was it a system crash?

I had several windows open at that time. When i saved one edited note using Ctrl+S, the error message was shown. Actually, as far as i remember, the first message was related to the malformed database. After that CN crashed and showed some weired errors.

CintaNotes Developer wrote:But I'm afraid to be able to fix this once and for all, we need a way to reproduce this kind of crash.

No easy doing. I had the debugging log running for several weeks without any crashes. Since this really affects speed, i turned it off at some point. The usual log that gets created on a crash was empty.

Thomas

Re: malformed database - one more time

Posted: Wed Oct 23, 2013 6:40 am
by CintaNotes Developer
Hi Thomas,

just wanted to ask if the same crash has happened again since then.. (in version 2.4)?

Re: malformed database - one more time

Posted: Wed Oct 23, 2013 8:29 am
by Thomas Lohrum
Hi Alex,

CintaNotes Developer wrote:Hi Thomas, just wanted to ask if the same crash has happened again since then.. (in version 2.4)?

No, i don't remember any crashes since then. Why? Anything special you changed in 2.4, which fixes the issue?

Thomas

Re: malformed database - one more time

Posted: Wed Oct 23, 2013 8:42 am
by CintaNotes Developer
Thomas Lohrum wrote:No, i don't remember any crashes since then. Why? Anything special you changed in 2.4, which fixes the issue?


Nope. Just hoping that there may be some new information on how to reproduce. The idea of a bug lurking somewhere is worrisome ;)