Re: [sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-19 Thread Tim Bradshaw
On 19 Jun 2009, at 06:36, hiral wrote:

> I am running application which uses the db over the NFS. If I move  
> the db
> over the local drive then it's working fine.
> So I m observing this bug in NFS environment frequently.
> In the same test environment (in which I am getting db corrupted),  
> if I use
> the sqlite-3.6.4 and above it works perfectly fine.

A couple of things to look at.
* what are the NFS mount options?  In particular do not, ever, use  
soft mounts[*].
* what client and server are you using?  Typically Linux / anything  
not linux is a recepie for trouble, as Linux's NFS implementation is a  
bit of a joke in terms of standards (actually, it has been more than a  
bit of a joke at various times).

--tim

[*] Really, not ever
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-19 Thread Simon Davies
2009/6/19 hiral :
> Hi Simon / John,
>
> Thank you for replies.
>
>> You are able to repeatably corrupt the db under SQLite 3.5.9? It would
>> be worthwhile publishing a script that can do that.
>  > "was getting error often" or "did get error ONCE"??
> I am running application which uses the db over the NFS. If I move the db
> over the local drive then it's working fine.
> So I m observing this bug in NFS environment frequently.
> In the same test environment (in which I am getting db corrupted), if I use
> the sqlite-3.6.4 and above it works perfectly fine.
>
>
.
.
snip
.
.
> Yes, 'disk image malformed' message I am observing on NFS.
> Environment:
> CentOS 4.4
> nfs-utils-lib-1.0.6-3
> system-config-nfs-1.2.8-1
> nfs-utils-1.0.6-70.EL4
> nfs-utils-lib-devel-1.0.6-3
> nfs-utils-1.0.6-70.EL4
> - db is on NFS drive, but not shared by thread/processes/users
> - not using thread
>
> Some interesting information:
> When I debuged the sqlite-3.5.9 code, and observed that it's getting
> corrupted at following condition...

This is where corruption is detected, not where caused.

> - in sqlite3BtreeInitPage() it returns with SQLITE_CORRUPT_BKPT based on
> some condition (see below)...
>
> SQLITE_PRIVATE int sqlite3BtreeInitPage(
>  MemPage *pPage,        /* The page to be initialized */
>  MemPage *pParent       /* The parent.  Might be NULL */
> ){
>     ...
>     if( pPage->nCell==0 && pParent!=0 && pParent->pgno!=1 ){
>     /* All pages must have at least one cell, except for root pages */
>     return SQLITE_CORRUPT_BKPT;
>     }
>     ...
> }
>
> I would appreciate your help in debuging this bug.

If you have found a version that does not manifest the 'bug' why not
use that? (It has already been debugged!)

> Thank you.
> -Hiral
>

Rgds,
Simon
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-18 Thread hiral
Hi Simon / John,

Thank you for replies.

> You are able to repeatably corrupt the db under SQLite 3.5.9? It would
> be worthwhile publishing a script that can do that.
 > "was getting error often" or "did get error ONCE"??
I am running application which uses the db over the NFS. If I move the db
over the local drive then it's working fine.
So I m observing this bug in NFS environment frequently.
In the same test environment (in which I am getting db corrupted), if I use
the sqlite-3.6.4 and above it works perfectly fine.


> I think you should get the latest version and test thoroughly.
I tested the application with sqlite-3.6.4 and above upto sqlite-3.6.15 but
didn't observe corrpted db error.
So it lead me to suspect that there is some bug in sqlite-3.5.9 which is
getting touched by my application.

> What is the "it" that was corrupting the db when you ran (what?) with
> 3.5.9 but is no longer corrupting the db with 3.6.4?? Did you run enough
> tests with 3.6.4 for long enough ?
John, I am running my application using sqlite-3.5.9 and if I place the db
file over the NFS then when it inserts data into the the db, then at some
point it gives 'disk image malformed' message.
Now when the same application (without any modification) I try with
sqlite-3.6.4 and above then I am not observing the 'disk image malformed
message'.

> Consider that the cause may be closer to home ... in an earlier message
> you wrote "I am using sqlite-3.5.9 and observing a 'disk image
> malformed' error nfs, on doing 'PRAGMA integrity_check' I got following
> messages...". Is that "nfs" what I think it is? What exactly is the
> environment: simultaneous users? db file on a network share? threads?
> unsafe pragma usage?
Yes, 'disk image malformed' message I am observing on NFS.
Environment:
CentOS 4.4
nfs-utils-lib-1.0.6-3
system-config-nfs-1.2.8-1
nfs-utils-1.0.6-70.EL4
nfs-utils-lib-devel-1.0.6-3
nfs-utils-1.0.6-70.EL4
- db is on NFS drive, but not shared by thread/processes/users
- not using thread

Some interesting information:
When I debuged the sqlite-3.5.9 code, and observed that it's getting
corrupted at following condition...
- in sqlite3BtreeInitPage() it returns with SQLITE_CORRUPT_BKPT based on
some condition (see below)...

SQLITE_PRIVATE int sqlite3BtreeInitPage(
 MemPage *pPage,/* The page to be initialized */
 MemPage *pParent   /* The parent.  Might be NULL */
){
 ...
 if( pPage->nCell==0 && pParent!=0 && pParent->pgno!=1 ){
 /* All pages must have at least one cell, except for root pages */
 return SQLITE_CORRUPT_BKPT;
 }
 ...
}

I would appreciate your help in debuging this bug.
Thank you.
-Hiral

On Thu, Jun 18, 2009 at 6:58 PM, John Machin  wrote:

> On 18/06/2009 10:40 PM, hiral wrote:
> > Hi Simon,
> >
> > Thank you for your quick reply.
> >
> > I am sorry for more general questions.
> >
> > As I mentioned I was getting corrupted db error with sqlite-3.5.9,
>
> "was getting error often" or "did get error ONCE"??
>
> > but when
> > I tried with sqlite-3.6.4 it is no more corrupting the db.
>
> What is the "it" that was corrupting the db when you ran (what?) with
> 3.5.9 but is no longer corrupting the db with 3.6.4?? Did you run enough
> tests with 3.6.4 for long enough ?
>
> > -- so was it a bug with sqlite-3.5.9 ? and got fixed in sqlite-3.6.4
>
> Consider that the cause may be closer to home ... in an earlier message
> you wrote "I am using sqlite-3.5.9 and observing a 'disk image
> malformed' error nfs, on doing 'PRAGMA integrity_check' I got following
> messages...". Is that "nfs" what I think it is? What exactly is the
> environment: simultaneous users? db file on a network share? threads?
> unsafe pragma usage?
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-18 Thread John Machin
On 18/06/2009 10:40 PM, hiral wrote:
> Hi Simon,
> 
> Thank you for your quick reply.
> 
> I am sorry for more general questions.
> 
> As I mentioned I was getting corrupted db error with sqlite-3.5.9, 

"was getting error often" or "did get error ONCE"??

> but when
> I tried with sqlite-3.6.4 it is no more corrupting the db.

What is the "it" that was corrupting the db when you ran (what?) with 
3.5.9 but is no longer corrupting the db with 3.6.4?? Did you run enough 
tests with 3.6.4 for long enough ?

> -- so was it a bug with sqlite-3.5.9 ? and got fixed in sqlite-3.6.4

Consider that the cause may be closer to home ... in an earlier message 
you wrote "I am using sqlite-3.5.9 and observing a 'disk image 
malformed' error nfs, on doing 'PRAGMA integrity_check' I got following 
messages...". Is that "nfs" what I think it is? What exactly is the 
environment: simultaneous users? db file on a network share? threads? 
unsafe pragma usage?

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-18 Thread Simon Davies
2009/6/18 hiral :
> Hi Simon,
>
> Thank you for your quick reply.
>
> I am sorry for more general questions.
>
> As I mentioned I was getting corrupted db error with sqlite-3.5.9, but when
> I tried with sqlite-3.6.4 it is no more corrupting the db.
> -- so was it a bug with sqlite-3.5.9 ? and got fixed in sqlite-3.6.4

You are able to repeatably corrupt the db under SQLite 3.5.9? It would
be worthwhile publishing a script that can do that.

I see nothing in the change list (http://www.sqlite.org/changes.html)
concerning such a major bugfix going from 3.5.9 to 3.6.4

> -- is it safe to upgrade from sqlite-3.5.9  to sqlite-3.6.14.2 ? as I am
> working on critical application how safe it is ?

I am in no position to speak authoritatively; I think you should get
the latest version and test thoroughly.

>
> Thank you.
> -Hiral

Rgds,
Simon
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-18 Thread hiral
Hi Simon,

Thank you for your quick reply.

I am sorry for more general questions.

As I mentioned I was getting corrupted db error with sqlite-3.5.9, but when
I tried with sqlite-3.6.4 it is no more corrupting the db.
-- so was it a bug with sqlite-3.5.9 ? and got fixed in sqlite-3.6.4
-- is it safe to upgrade from sqlite-3.5.9  to sqlite-3.6.14.2 ? as I am
working on critical application how safe it is ?

Thank you.
-Hiral
On Thu, Jun 18, 2009 at 4:17 PM, Simon Davies <
simon.james.dav...@googlemail.com> wrote:

> 2009/6/17 hiral :
> > Hi Simon,
> >
> >  I looked into it but couldn't find the exact reason for my bug.
> >
> >  If you have any idea please let me know.
>
> Sorry, other than the link, I can not help.
>
> >
> >  Also I would appreciate, if you can let me know what does this error
> mean
> > in terms of btree/pager module of sqlite
> >
> >>> sqlite> PRAGMA integrity_check;
> >>> *** in database main ***
> >>> Page 5275 is never used
> >>> wrong # of entries in index sqlite_autoindex__1
>
> Other than that the db is corrupt, I could not say.
> If I ever get a corrupted db (from users with unsafe environments), I
> extract whatever data it is possible to extract ( see .dump in sqlite3
> command line utility), and reconstruct a new db using that data.
> It has not seemed worthwhile trying to analyse/repair a corrupt db.
> Identifying where the db has been corrupted will not necessarily
> indicate the event that caused it.
>
> > Thank you.
> > -Hiral
>
> Rgds,
> Simon
>  ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-18 Thread Simon Davies
2009/6/17 hiral :
> Hi Simon,
>
>  I looked into it but couldn't find the exact reason for my bug.
>
>  If you have any idea please let me know.

Sorry, other than the link, I can not help.

>
>  Also I would appreciate, if you can let me know what does this error mean
> in terms of btree/pager module of sqlite
>
>>> sqlite> PRAGMA integrity_check;
>>> *** in database main ***
>>> Page 5275 is never used
>>> wrong # of entries in index sqlite_autoindex__1

Other than that the db is corrupt, I could not say.
If I ever get a corrupted db (from users with unsafe environments), I
extract whatever data it is possible to extract ( see .dump in sqlite3
command line utility), and reconstruct a new db using that data.
It has not seemed worthwhile trying to analyse/repair a corrupt db.
Identifying where the db has been corrupted will not necessarily
indicate the event that caused it.

> Thank you.
> -Hiral

Rgds,
Simon
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-17 Thread hiral
Hi Simon,

 I looked into it but couldn't find the exact reason for my bug.

 If you have any idea please let me know.

 Also I would appreciate, if you can let me know what does this error mean
in terms of btree/pager module of sqlite

>> sqlite> PRAGMA integrity_check;
>> *** in database main ***
>> Page 5275 is never used
>> wrong # of entries in index sqlite_autoindex__1
Thank you.
-Hiral
On Wed, Jun 17, 2009 at 9:42 PM, Simon Davies <
simon.james.dav...@googlemail.com> wrote:

> 2009/6/17 hiral :
> > Any suggestion on this !!!
>
> Your database has been corrupted.
> http://www.sqlite.org/lockingv3.html#how_to_corrupt
>
> Rgds,
> Simon
>
> >
> > On Tue, Jun 16, 2009 at 4:34 PM, h o  wrote:
> >
> >> Hi,
> >>
> >> I am using sqlite-3.5.9 and observing a 'disk image malformed' error
> >> nfs, on doing 'PRAGMA integrity_check' I got following messages...
> >>
> >> SQLite version 3.5.9
> >> Enter ".help" for instructions
> >> sqlite> PRAGMA integrity_check;
> >> *** in database main ***
> >> Page 5275 is never used
> >> wrong # of entries in index sqlite_autoindex__1
> >> sqlite>
> >>
> >> Can you please let me know what is the problem here.
> >>
> >> Thank you.
> >> -Hiral
> >>
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-17 Thread Simon Davies
2009/6/17 hiral :
> Any suggestion on this !!!

Your database has been corrupted.
http://www.sqlite.org/lockingv3.html#how_to_corrupt

Rgds,
Simon

>
> On Tue, Jun 16, 2009 at 4:34 PM, h o  wrote:
>
>> Hi,
>>
>> I am using sqlite-3.5.9 and observing a 'disk image malformed' error
>> nfs, on doing 'PRAGMA integrity_check' I got following messages...
>>
>> SQLite version 3.5.9
>> Enter ".help" for instructions
>> sqlite> PRAGMA integrity_check;
>> *** in database main ***
>> Page 5275 is never used
>> wrong # of entries in index sqlite_autoindex__1
>> sqlite>
>>
>> Can you please let me know what is the problem here.
>>
>> Thank you.
>> -Hiral
>>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-17 Thread hiral
Any suggestion on this !!!

On Tue, Jun 16, 2009 at 4:34 PM, h o  wrote:

> Hi,
>
> I am using sqlite-3.5.9 and observing a 'disk image malformed' error
> nfs, on doing 'PRAGMA integrity_check' I got following messages...
>
> SQLite version 3.5.9
> Enter ".help" for instructions
> sqlite> PRAGMA integrity_check;
> *** in database main ***
> Page 5275 is never used
> wrong # of entries in index sqlite_autoindex__1
> sqlite>
>
> Can you please let me know what is the problem here.
>
> Thank you.
> -Hiral
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-16 Thread h o
Hi,

I am using sqlite-3.5.9 and observing a 'disk image malformed' error
nfs, on doing 'PRAGMA integrity_check' I got following messages...

SQLite version 3.5.9
Enter ".help" for instructions
sqlite> PRAGMA integrity_check;
*** in database main ***
Page 5275 is never used
wrong # of entries in index sqlite_autoindex__1
sqlite>

Can you please let me know what is the problem here.

Thank you.
-Hiral
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-12 Thread Oza, Hiral_Dineshbhai
Hi,

I am using sqlite-3.5.9 and observing a 'disk image malformed' error
after executing several sql statements on nfs after running 'PRAGMA
integrity_check' got following messages...

SQLite version 3.5.9
Enter ".help" for instructions
sqlite> PRAGMA integrity_check;
*** in database main ***
Page 5275 is never used
wrong # of entries in index sqlite_autoindex__1
sqlite>

Can you please let me know what is the cause of this bug.

Thank you.
-Hiral
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-12 Thread Oza, Hiral_Dineshbhai
Hi,

I am using sqlite-3.5.9 and observing a 'disk image malformed' error
after executing several sql statements on nfs after running 'PRAGMA
integrity_check' got following messages...

SQLite version 3.5.9
Enter ".help" for instructions
sqlite> PRAGMA integrity_check;
*** in database main ***
Page 5275 is never used
wrong # of entries in index sqlite_autoindex__1
sqlite>

Can you please let me know what is the cause of this bug.

Thank you.
-Hiral
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users