malformed database - one more time

Thomas Lohrum
Posts: 1324
Joined: Tue Mar 08, 2011 11:15 am

malformed database - one more time

Postby Thomas Lohrum » Wed Aug 28, 2013 9:05 pm

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
jjk
Posts: 11
Joined: Mon Dec 17, 2012 10:01 am
Contact:

Re: malformed database - one more time

Postby jjk » Thu Aug 29, 2013 5:39 am

Hi all,

Support ++
I got also a malformed database, though I did nothing particular.
User avatar
CintaNotes Developer
Site Admin
Posts: 5001
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: malformed database - one more time

Postby CintaNotes Developer » Thu Aug 29, 2013 6:08 am

Hi,
could you both please tell me what is the value of your sqlite.pragma.journal_mode cintanotes.settings parameter please?
Thanks!
Alex
jjk
Posts: 11
Joined: Mon Dec 17, 2012 10:01 am
Contact:

Re: malformed database - one more time

Postby jjk » Thu Aug 29, 2013 6:31 am

MEMORY for me.
TIA
jjk
Posts: 11
Joined: Mon Dec 17, 2012 10:01 am
Contact:

Re: malformed database - one more time

Postby jjk » Thu Aug 29, 2013 6:34 am

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.
User avatar
CintaNotes Developer
Site Admin
Posts: 5001
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: malformed database - one more time

Postby CintaNotes Developer » Thu Aug 29, 2013 7:22 am

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.
Alex
Thomas Lohrum
Posts: 1324
Joined: Tue Mar 08, 2011 11:15 am

Re: malformed database - one more time

Postby Thomas Lohrum » Thu Aug 29, 2013 9:15 am

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
User avatar
CintaNotes Developer
Site Admin
Posts: 5001
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: malformed database - one more time

Postby CintaNotes Developer » Fri Aug 30, 2013 12:00 pm

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.
Alex
Thomas Lohrum
Posts: 1324
Joined: Tue Mar 08, 2011 11:15 am

Re: malformed database - one more time

Postby Thomas Lohrum » Fri Aug 30, 2013 5:54 pm

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
User avatar
CintaNotes Developer
Site Admin
Posts: 5001
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: malformed database - one more time

Postby CintaNotes Developer » Wed Oct 23, 2013 6:40 am

Hi Thomas,

just wanted to ask if the same crash has happened again since then.. (in version 2.4)?
Alex
Thomas Lohrum
Posts: 1324
Joined: Tue Mar 08, 2011 11:15 am

Re: malformed database - one more time

Postby Thomas Lohrum » Wed Oct 23, 2013 8:29 am

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
User avatar
CintaNotes Developer
Site Admin
Posts: 5001
Joined: Fri Dec 12, 2008 4:45 pm
Contact:

Re: malformed database - one more time

Postby CintaNotes Developer » Wed Oct 23, 2013 8:42 am

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 ;)
Alex

Return to “Bug Reports”