Re: [sqlite] Disk I/O Error

2012-10-25 Thread Joe Mistachkin

Caio Honma wrote:
>
> I was trying to query from a huge table (150,000,000 lines+) using a left
> join statement, using mode csv and using an output to file.. after several
> minutes I got the Disk I/O error. I searched this maillist for some
> possible answers (tried to check_integrity, but the db was ok, then I
> installed the Process Monitor).
> 

Can you enable logging via the SQLITE_CONFIG_LOG configuration option
before calling any other SQLite APIs?  This should help to narrow down the
operation returning the error.

http://www.sqlite.org/c3ref/c_config_getmalloc.html#sqliteconfiglog

Example:

void logging_callback(void *notUsed, int iCode, const char *zErrmsg){
  /* handle output here... */
  fprintf(stdout, "%d: %s\n", iCode, zErrmsg);
}

sqlite3_config(SQLITE_CONFIG_LOG, logging_callback, 0);

--
Joe Mistachkin

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


Re: [sqlite] disk I/O error

2011-11-22 Thread Dan Kennedy

On 11/22/2011 04:14 PM, Tal Tabakman wrote:

Thanks for the reply,

this thing is that I get this while doing a select operation,

now, I know that I get a lot of results from this select, but I am not
writing anything to my DB explicitly. what am I missing here ?



Some SELECT need to write to disk. To sort large numbers of rows
without an index for example. What does your SELECT statement
look like?

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


Re: [sqlite] disk I/O error

2011-11-22 Thread Tal Tabakman
Thanks for the reply,

this thing is that I get this while doing a select operation,

now, I know that I get a lot of results from this select, but I am not
writing anything to my DB explicitly. what am I missing here ?

On unix, you should usually only get SQLITE_IOERR_WRITE if write() returns
-1 for some reason other than ENOSPC - in other words, if the write failed
for some reason other than the disk being full.


On Mon, Nov 21, 2011 at 11:05 AM, Tal Tabakman wrote:

> As a continuation to the bellow:
> I am using linux RH5
> "uname -a" on my machine gives:
> Linux vl-talt 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64
> x86_64 x86_64 GNU/Linux
>
>
> On Sun, Nov 20, 2011 at 6:53 AM, Tal Tabakman  >wrote:
>
> >* in a continuation to the below, it seems I get the following extended 
> >err*>* code*>* SQLITE_IOERR_WRITE*>* what are the reasons for that one ? is 
> >it a symptom of mem blow-up ?*>* cheers*>* Tal*>**>**What operating system 
> >did you say you were using?
>
>
> >* >* Hi Guys,*>* in which cases can I get sqlite3 error "disk I/O error", 
> >is*>* it only when*>* disk is full ?*>* any other reasons for getting this 
> >one*>* ?*>***>* Lots of reasons.  Use sqlite3_extended_errcode() to get a 
> >more detailed*>* error code that can help isolate the problem.  And/or 
> >use*>* sqlite3_config(SQLITE_CONFIG_LOG,...) to register a callback function 
> >that*>* will give more detailed error messages.*>* 
> >___*
>
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] disk I/O error

2011-11-21 Thread Richard Hipp
On unix, you should usually only get SQLITE_IOERR_WRITE if write() returns
-1 for some reason other than ENOSPC - in other words, if the write failed
for some reason other than the disk being full.

On Mon, Nov 21, 2011 at 4:05 AM, Tal Tabakman wrote:

> As a continuation to the bellow:
> I am using linux RH5
> "uname -a" on my machine gives:
> Linux vl-talt 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64
> x86_64 x86_64 GNU/Linux
>
>
> On Sun, Nov 20, 2011 at 6:53 AM, Tal Tabakman  gmail.com  >>wrote:
>
> >* in a continuation to the below, it seems I get the following extended
> err*>* code*>* SQLITE_IOERR_WRITE*>* what are the reasons for that one ? is
> it a symptom of mem blow-up ?*>* cheers*>* Tal*>**>**What operating system
> did you say you were using?
>
>
> >* >* Hi Guys,*>* in which cases can I get sqlite3 error "disk I/O error",
> is*>* it only when*>* disk is full ?*>* any other reasons for getting this
> one*>* ?*>***>* Lots of reasons.  Use sqlite3_extended_errcode() to get a
> more detailed*>* error code that can help isolate the problem.  And/or
> use*>* sqlite3_config(SQLITE_CONFIG_LOG,...) to register a callback
> function that*>* will give more detailed error messages.*>*
> ___*
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


Re: [sqlite] disk I/O error

2011-11-20 Thread Filip Navara
On Sun, Nov 20, 2011 at 1:21 PM, Richard Hipp  wrote:
> On Sun, Nov 20, 2011 at 6:53 AM, Tal Tabakman wrote:
>
>> in a continuation to the below, it seems I get the following extended err
>> code
>> SQLITE_IOERR_WRITE
>> what are the reasons for that one ? is it a symptom of mem blow-up ?
>> cheers
>> Tal
>>
>>
> What operating system did you say you were using?
>

Just a note: Most recent versions of SQLite on Windows are broken
whenever sqlite3_config(SQLITE_CONFIG_LOG, ...) is used. It is fixed
in the repository, but not in any officially released version.

For debugging this kind of problems on Windows it is very helpful to
make a log with Process Monitor
(http://technet.microsoft.com/en-us/sysinternals/bb896645) and filter
the results on the directory containing the database file. I'd be
willing to look at it if such an error is reproduced and the log is
available.

Best regards,
Filip Navara
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] disk I/O error

2011-11-20 Thread Richard Hipp
On Sun, Nov 20, 2011 at 6:53 AM, Tal Tabakman wrote:

> in a continuation to the below, it seems I get the following extended err
> code
> SQLITE_IOERR_WRITE
> what are the reasons for that one ? is it a symptom of mem blow-up ?
> cheers
> Tal
>
>
What operating system did you say you were using?


> >* Hi Guys,*>* in which cases can I get sqlite3 error "disk I/O error", is
> it only when*>* disk is full ?*>* any other reasons for getting this one
> ?*>**
> Lots of reasons.  Use sqlite3_extended_errcode() to get a more detailed
> error code that can help isolate the problem.  And/or use
> sqlite3_config(SQLITE_CONFIG_LOG,...) to register a callback function that
> will give more detailed error messages.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


Re: [sqlite] disk I/O error

2011-11-17 Thread Richard Hipp
On Thu, Nov 17, 2011 at 3:04 PM, Tal Tabakman wrote:

> Hi Guys,
> in which cases can I get sqlite3 error "disk I/O error", is it only when
> disk is full ?
> any other reasons for getting this one ?
>

Lots of reasons.  Use sqlite3_extended_errcode() to get a more detailed
error code that can help isolate the problem.  And/or use
sqlite3_config(SQLITE_CONFIG_LOG,...) to register a callback function that
will give more detailed error messages.


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



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


Re: [sqlite] Disk I/O Error

2011-11-01 Thread Richard Hipp
On Tue, Nov 1, 2011 at 3:09 PM, Kyle McKay  wrote:

> "If write() is interrupted by a signal after it successfully writes some
> data, it shall return the number of bytes written."
>
> and it doesn't appear that SQLite currently permits that behavior either
> with or without the above patch.
>

See http://www.sqlite.org/src/artifact/ddda0b1c5a?ln=3104-3108


> --
>
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Disk I/O Error

2011-11-01 Thread Kyle McKay

On November 1, 2011 08:48:25 PDT, Richard Hipp wrote:
On Tue, Nov 1, 2011 at 10:40 AM, Korey Calmettes wrote:



When we are able to reproduce the problem again, I will run these
checks.  It's fairly random however consistent.  I will e-mail the
results to you later today.



If you are able, please recompile using the version of SQLite here:

http://www.sqlite.org/src/ci/72256634773f?sbs=1

which includes a patch that will retry read() system calls that return
fewer bytes than expected.  Let us know if this clears the problem.   
Note
that this patch is on a branch and probably won't go onto the trunk  
unless

we hear back positive results from you.


It's not just read system calls that are allowed to do that.  The  
POSIX spec. for read is at:


http://pubs.opengroup.org/onlinepubs/009695399/functions/read.html

and says:

"If a read() is interrupted by a signal after it has successfully read  
some data, it shall return the number of bytes read."


which the above patch handles.  However, the POSIX spec. for write is  
at:


http://pubs.opengroup.org/onlinepubs/007904975/functions/write.html

and it says basically the same thing:

"If write() is interrupted by a signal after it successfully writes  
some data, it shall return the number of bytes written."


and it doesn't appear that SQLite currently permits that behavior  
either with or without the above patch.

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


Re: [sqlite] Disk I/O Error

2011-11-01 Thread Dan Kennedy

On 11/02/2011 12:37 AM, Korey Calmettes wrote:

I don't think the file is truncated.


What is the size of the file on disk?





Interesting stuff here when I run pragma integrity_check:

/data # sqlite3 test.db "pragma integrity_check;"
*** in database main ***
Page 480: unable to get the page. error code=522
Page 481: unable to get the page. error code=522
Page 482: unable to get the page. error code=522
On tree page 32 cell 3: Child page depth differs
Page 485: unable to get the page. error code=522
On tree page 32 cell 5: Child page depth differs
On tree page 32 cell 6: Child page depth differs
Page 487: unable to get the page. error code=522
On tree page 32 cell 7: Child page depth differs
On tree page 32 cell 8: Child page depth differs
Page 493: unable to get the page. error code=522
On tree page 32 cell 13: Child page depth differs
On tree page 32 cell 14: Child page depth differs
Page 495: unable to get the page. error code=522
On tree page 32 cell 15: Child page depth differs
On tree page 32 cell 16: Child page depth differs
Page 505: unable to get the page. error code=522
On tree page 45 cell 4: Child page depth differs
On tree page 45 cell 5: Child page depth differs
Page 421: unable to get the page. error code=522
On tree page 15 cell 1: Child page depth differs
Page 422: unable to get the page. error code=522
On tree page 15 cell 3: Child page depth differs
Page 424: unable to get the page. error code=522
On tree page 15 cell 4: Child page depth differs
On tree page 15 cell 5: Child page depth differs
Page 49: unable to get the page. error code=522
Page 33: unable to get the page. error code=522
Page 34: unable to get the page. error code=522
Page 472: unable to get the page. error code=522
Page 473: unable to get the page. error code=522
Page 474: unable to get the page. error code=522
Page 475: unable to get the page. error code=522
Page 476: unable to get the page. error code=522
Page 477: unable to get the page. error code=522
Page 478: unable to get the page. error code=522
Page 479: unable to get the page. error code=522
Error: disk I/O error

Also, the page size is 1024.

Korey

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp
Sent: October 31, 2011 2:32 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Disk I/O Error

On Mon, Oct 31, 2011 at 5:01 PM, Korey Calmettes
<kcalmet...@icontime.com>wrote:


Hello,

We are having a random problem with our system that has be puzzled at
this point.

First a little background.  We have an embedded system running an ARM
processor and JFFS file system.  We are running 3.7.7.1.  I e-mailed
about a month ago about enabling WAL on our system.  Found out that I
needed to set SQLITE_SHM_DIRECTORY to our tmpfs file system when
compiling as JFFS doesn't support shared mmap files.

This has been working fine, however throughout our testing, we have
been hitting a problem.  It seems that some tables are no longer
accessible giving a Disk I/O Error.  I logged into the command line
interface and replicated the problem.  I ran ".log stdout" and here

are the results.


sqlite>  select password from auth;
(522) statement aborts at 7: [select password from auth;]
Error: disk I/O error

However access to other tables will work without any problems.



Error code 522 is SQLITE_IOERR_SHORT_READ.  It is generated here:

  http://www.sqlite.org/src/artifact/07acbb3e074e?ln=3012

SQLite was trying to read N bytes and got back M byes where M>0 and M

I searched for how to read the log without success.  I am hopeful that



someone would be able to tell me what's going on.

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





--
D. Richard Hipp
d...@sqlite.org
___
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] Disk I/O Error

2011-11-01 Thread Richard Hipp
Please copy the database file to a workstation and try "PRAGMA
integrity_check" on the work station.  This will help us to decide if the
problem is with the SQLite code (or JFFS) or a if it is a corrupt database.

On Tue, Nov 1, 2011 at 1:37 PM, Korey Calmettes <kcalmet...@icontime.com>wrote:

> I don't think the file is truncated.
>
> Interesting stuff here when I run pragma integrity_check:
>
> /data # sqlite3 test.db "pragma integrity_check;"
> *** in database main ***
> Page 480: unable to get the page. error code=522
> Page 481: unable to get the page. error code=522
> Page 482: unable to get the page. error code=522
> On tree page 32 cell 3: Child page depth differs
> Page 485: unable to get the page. error code=522
> On tree page 32 cell 5: Child page depth differs
> On tree page 32 cell 6: Child page depth differs
> Page 487: unable to get the page. error code=522
> On tree page 32 cell 7: Child page depth differs
> On tree page 32 cell 8: Child page depth differs
> Page 493: unable to get the page. error code=522
> On tree page 32 cell 13: Child page depth differs
> On tree page 32 cell 14: Child page depth differs
> Page 495: unable to get the page. error code=522
> On tree page 32 cell 15: Child page depth differs
> On tree page 32 cell 16: Child page depth differs
> Page 505: unable to get the page. error code=522
> On tree page 45 cell 4: Child page depth differs
> On tree page 45 cell 5: Child page depth differs
> Page 421: unable to get the page. error code=522
> On tree page 15 cell 1: Child page depth differs
> Page 422: unable to get the page. error code=522
> On tree page 15 cell 3: Child page depth differs
> Page 424: unable to get the page. error code=522
> On tree page 15 cell 4: Child page depth differs
> On tree page 15 cell 5: Child page depth differs
> Page 49: unable to get the page. error code=522
> Page 33: unable to get the page. error code=522
> Page 34: unable to get the page. error code=522
> Page 472: unable to get the page. error code=522
> Page 473: unable to get the page. error code=522
> Page 474: unable to get the page. error code=522
> Page 475: unable to get the page. error code=522
> Page 476: unable to get the page. error code=522
> Page 477: unable to get the page. error code=522
> Page 478: unable to get the page. error code=522
> Page 479: unable to get the page. error code=522
> Error: disk I/O error
>
> Also, the page size is 1024.
>
> Korey
>
> -Original Message-
> From: sqlite-users-boun...@sqlite.org
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp
> Sent: October 31, 2011 2:32 PM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Disk I/O Error
>
> On Mon, Oct 31, 2011 at 5:01 PM, Korey Calmettes
> <kcalmet...@icontime.com>wrote:
>
> > Hello,
> >
> > We are having a random problem with our system that has be puzzled at
> > this point.
> >
> > First a little background.  We have an embedded system running an ARM
> > processor and JFFS file system.  We are running 3.7.7.1.  I e-mailed
> > about a month ago about enabling WAL on our system.  Found out that I
> > needed to set SQLITE_SHM_DIRECTORY to our tmpfs file system when
> > compiling as JFFS doesn't support shared mmap files.
> >
> > This has been working fine, however throughout our testing, we have
> > been hitting a problem.  It seems that some tables are no longer
> > accessible giving a Disk I/O Error.  I logged into the command line
> > interface and replicated the problem.  I ran ".log stdout" and here
> are the results.
> >
> > sqlite> select password from auth;
> > (522) statement aborts at 7: [select password from auth;]
> > Error: disk I/O error
> >
> > However access to other tables will work without any problems.
> >
>
> Error code 522 is SQLITE_IOERR_SHORT_READ.  It is generated here:
>
> http://www.sqlite.org/src/artifact/07acbb3e074e?ln=3012
>
> SQLite was trying to read N bytes and got back M byes where M>0 and M
> Perchance is your database file truncated?  What happens when you run
> "PRAGMA integrity_check" on the database?  What is the page size of your
> database?
>
>
>
> >
> > I searched for how to read the log without success.  I am hopeful that
>
> > someone would be able to tell me what's going on.
> >
> > Korey
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___

Re: [sqlite] Disk I/O Error

2011-11-01 Thread Korey Calmettes
I don't think the file is truncated.

Interesting stuff here when I run pragma integrity_check:

/data # sqlite3 test.db "pragma integrity_check;"
*** in database main ***
Page 480: unable to get the page. error code=522 
Page 481: unable to get the page. error code=522 
Page 482: unable to get the page. error code=522 
On tree page 32 cell 3: Child page depth differs 
Page 485: unable to get the page. error code=522 
On tree page 32 cell 5: Child page depth differs 
On tree page 32 cell 6: Child page depth differs 
Page 487: unable to get the page. error code=522 
On tree page 32 cell 7: Child page depth differs 
On tree page 32 cell 8: Child page depth differs 
Page 493: unable to get the page. error code=522 
On tree page 32 cell 13: Child page depth differs 
On tree page 32 cell 14: Child page depth differs 
Page 495: unable to get the page. error code=522 
On tree page 32 cell 15: Child page depth differs 
On tree page 32 cell 16: Child page depth differs 
Page 505: unable to get the page. error code=522 
On tree page 45 cell 4: Child page depth differs 
On tree page 45 cell 5: Child page depth differs 
Page 421: unable to get the page. error code=522 
On tree page 15 cell 1: Child page depth differs 
Page 422: unable to get the page. error code=522 
On tree page 15 cell 3: Child page depth differs 
Page 424: unable to get the page. error code=522 
On tree page 15 cell 4: Child page depth differs 
On tree page 15 cell 5: Child page depth differs 
Page 49: unable to get the page. error code=522 
Page 33: unable to get the page. error code=522 
Page 34: unable to get the page. error code=522 
Page 472: unable to get the page. error code=522 
Page 473: unable to get the page. error code=522 
Page 474: unable to get the page. error code=522 
Page 475: unable to get the page. error code=522 
Page 476: unable to get the page. error code=522 
Page 477: unable to get the page. error code=522 
Page 478: unable to get the page. error code=522 
Page 479: unable to get the page. error code=522
Error: disk I/O error

Also, the page size is 1024.

Korey

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp
Sent: October 31, 2011 2:32 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Disk I/O Error

On Mon, Oct 31, 2011 at 5:01 PM, Korey Calmettes
<kcalmet...@icontime.com>wrote:

> Hello,
>
> We are having a random problem with our system that has be puzzled at 
> this point.
>
> First a little background.  We have an embedded system running an ARM 
> processor and JFFS file system.  We are running 3.7.7.1.  I e-mailed 
> about a month ago about enabling WAL on our system.  Found out that I 
> needed to set SQLITE_SHM_DIRECTORY to our tmpfs file system when 
> compiling as JFFS doesn't support shared mmap files.
>
> This has been working fine, however throughout our testing, we have 
> been hitting a problem.  It seems that some tables are no longer 
> accessible giving a Disk I/O Error.  I logged into the command line 
> interface and replicated the problem.  I ran ".log stdout" and here
are the results.
>
> sqlite> select password from auth;
> (522) statement aborts at 7: [select password from auth;]
> Error: disk I/O error
>
> However access to other tables will work without any problems.
>

Error code 522 is SQLITE_IOERR_SHORT_READ.  It is generated here:

 http://www.sqlite.org/src/artifact/07acbb3e074e?ln=3012

SQLite was trying to read N bytes and got back M byes where M>0 and M
> I searched for how to read the log without success.  I am hopeful that

> someone would be able to tell me what's going on.
>
> Korey
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



--
D. Richard Hipp
d...@sqlite.org
___
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] Disk I/O Error

2011-11-01 Thread Richard Hipp
On Tue, Nov 1, 2011 at 10:40 AM, Korey Calmettes <kcalmet...@icontime.com>wrote:

> When we are able to reproduce the problem again, I will run these
> checks.  It's fairly random however consistent.  I will e-mail the
> results to you later today.
>

If you are able, please recompile using the version of SQLite here:

 http://www.sqlite.org/src/ci/72256634773f?sbs=1

which includes a patch that will retry read() system calls that return
fewer bytes than expected.  Let us know if this clears the problem.  Note
that this patch is on a branch and probably won't go onto the trunk unless
we hear back positive results from you.



>
> Thanks,
>
> Korey
>
> -Original Message-
> From: sqlite-users-boun...@sqlite.org
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp
> Sent: October 31, 2011 2:32 PM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Disk I/O Error
>
> On Mon, Oct 31, 2011 at 5:01 PM, Korey Calmettes
> <kcalmet...@icontime.com>wrote:
>
> > Hello,
> >
> > We are having a random problem with our system that has be puzzled at
> > this point.
> >
> > First a little background.  We have an embedded system running an ARM
> > processor and JFFS file system.  We are running 3.7.7.1.  I e-mailed
> > about a month ago about enabling WAL on our system.  Found out that I
> > needed to set SQLITE_SHM_DIRECTORY to our tmpfs file system when
> > compiling as JFFS doesn't support shared mmap files.
> >
> > This has been working fine, however throughout our testing, we have
> > been hitting a problem.  It seems that some tables are no longer
> > accessible giving a Disk I/O Error.  I logged into the command line
> > interface and replicated the problem.  I ran ".log stdout" and here
> are the results.
> >
> > sqlite> select password from auth;
> > (522) statement aborts at 7: [select password from auth;]
> > Error: disk I/O error
> >
> > However access to other tables will work without any problems.
> >
>
> Error code 522 is SQLITE_IOERR_SHORT_READ.  It is generated here:
>
> http://www.sqlite.org/src/artifact/07acbb3e074e?ln=3012
>
> SQLite was trying to read N bytes and got back M byes where M>0 and M
> Perchance is your database file truncated?  What happens when you run
> "PRAGMA integrity_check" on the database?  What is the page size of your
> database?
>
>
>
> >
> > I searched for how to read the log without success.  I am hopeful that
>
> > someone would be able to tell me what's going on.
> >
> > Korey
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> 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
>



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


Re: [sqlite] Disk I/O Error

2011-11-01 Thread Pavel Ivanov
On Mon, Oct 31, 2011 at 5:44 PM, Richard Hipp  wrote:
> On Mon, Oct 31, 2011 at 5:40 PM, Pavel Ivanov  wrote:
>
>> > Error code 522 is SQLITE_IOERR_SHORT_READ.  It is generated here:
>> >
>> >     http://www.sqlite.org/src/artifact/07acbb3e074e?ln=3012
>> >
>> > SQLite was trying to read N bytes and got back M byes where M>0 and M>
>> Could it be that N bytes cannot be read atomically and operation was
>> interrupted in the middle by some signal? This scenario can explain
>> short read even if database is not truncated or corrupted.
>
> If an interrupt occurs that stops the read before it can complete, then the
> read should be tried again.
> http://www.sqlite.org/src/artifact/07acbb3e074e?ln=2968

http://linux.die.net/man/2/read

"On success, the number of bytes read is returned (zero indicates end
of file), and the file position is advanced by this number. It is not
an error if this number is smaller than the number of bytes requested;
this may happen for example because fewer bytes are actually available
right now (maybe because we were close to end-of-file, or because we
are reading from a pipe, or from a terminal), or because read() was
interrupted by a signal."


So the condition "got <0 && errno == EINTR" will be true only when
signal came before any data were read. If signal comes when some data
already have been read then got will be greater than 0 and errno will
be 0, although got will be less than requested.


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


Re: [sqlite] Disk I/O Error

2011-11-01 Thread Stephan Beal
On Mon, Oct 31, 2011 at 10:44 PM, Richard Hipp  wrote:

> If an interrupt occurs that stops the read before it can complete, then the
> read should be tried again.
> http://www.sqlite.org/src/artifact/07acbb3e074e?ln=2968


This topic came up before a few months ago and someone (don't remember who)
pointed out that platforms exist which can return >0 from read() when
interrupted. My man page says:

POSIX allows a read() that is interrupted after reading some data to return
-1 (with errno set to EINTR) or to return the number of bytes already read.


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Disk I/O Error

2011-11-01 Thread Korey Calmettes
When we are able to reproduce the problem again, I will run these
checks.  It's fairly random however consistent.  I will e-mail the
results to you later today.

Thanks,

Korey 

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp
Sent: October 31, 2011 2:32 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Disk I/O Error

On Mon, Oct 31, 2011 at 5:01 PM, Korey Calmettes
<kcalmet...@icontime.com>wrote:

> Hello,
>
> We are having a random problem with our system that has be puzzled at 
> this point.
>
> First a little background.  We have an embedded system running an ARM 
> processor and JFFS file system.  We are running 3.7.7.1.  I e-mailed 
> about a month ago about enabling WAL on our system.  Found out that I 
> needed to set SQLITE_SHM_DIRECTORY to our tmpfs file system when 
> compiling as JFFS doesn't support shared mmap files.
>
> This has been working fine, however throughout our testing, we have 
> been hitting a problem.  It seems that some tables are no longer 
> accessible giving a Disk I/O Error.  I logged into the command line 
> interface and replicated the problem.  I ran ".log stdout" and here
are the results.
>
> sqlite> select password from auth;
> (522) statement aborts at 7: [select password from auth;]
> Error: disk I/O error
>
> However access to other tables will work without any problems.
>

Error code 522 is SQLITE_IOERR_SHORT_READ.  It is generated here:

 http://www.sqlite.org/src/artifact/07acbb3e074e?ln=3012

SQLite was trying to read N bytes and got back M byes where M>0 and M
> I searched for how to read the log without success.  I am hopeful that

> someone would be able to tell me what's going on.
>
> Korey
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



--
D. Richard Hipp
d...@sqlite.org
___
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] Disk I/O Error

2011-10-31 Thread Richard Hipp
On Mon, Oct 31, 2011 at 5:40 PM, Pavel Ivanov  wrote:

> > Error code 522 is SQLITE_IOERR_SHORT_READ.  It is generated here:
> >
> > http://www.sqlite.org/src/artifact/07acbb3e074e?ln=3012
> >
> > SQLite was trying to read N bytes and got back M byes where M>0 and M
> Could it be that N bytes cannot be read atomically and operation was
> interrupted in the middle by some signal? This scenario can explain
> short read even if database is not truncated or corrupted.
>

If an interrupt occurs that stops the read before it can complete, then the
read should be tried again.
http://www.sqlite.org/src/artifact/07acbb3e074e?ln=2968


>
>
> Pavel
>
>
> On Mon, Oct 31, 2011 at 5:31 PM, Richard Hipp  wrote:
> > On Mon, Oct 31, 2011 at 5:01 PM, Korey Calmettes <
> kcalmet...@icontime.com>wrote:
> >
> >> Hello,
> >>
> >> We are having a random problem with our system that has be puzzled at
> >> this point.
> >>
> >> First a little background.  We have an embedded system running an ARM
> >> processor and JFFS file system.  We are running 3.7.7.1.  I e-mailed
> >> about a month ago about enabling WAL on our system.  Found out that I
> >> needed to set SQLITE_SHM_DIRECTORY to our tmpfs file system when
> >> compiling as JFFS doesn't support shared mmap files.
> >>
> >> This has been working fine, however throughout our testing, we have been
> >> hitting a problem.  It seems that some tables are no longer accessible
> >> giving a Disk I/O Error.  I logged into the command line interface and
> >> replicated the problem.  I ran ".log stdout" and here are the results.
> >>
> >> sqlite> select password from auth;
> >> (522) statement aborts at 7: [select password from auth;]
> >> Error: disk I/O error
> >>
> >> However access to other tables will work without any problems.
> >>
> >
> > Error code 522 is SQLITE_IOERR_SHORT_READ.  It is generated here:
> >
> > http://www.sqlite.org/src/artifact/07acbb3e074e?ln=3012
> >
> > SQLite was trying to read N bytes and got back M byes where M>0 and M >
> > Perchance is your database file truncated?  What happens when you run
> > "PRAGMA integrity_check" on the database?  What is the page size of your
> > database?
> >
> >
> >
> >>
> >> I searched for how to read the log without success.  I am hopeful that
> >> someone would be able to tell me what's going on.
> >>
> >> Korey
> >> ___
> >> sqlite-users mailing list
> >> sqlite-users@sqlite.org
> >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >>
> >
> >
> >
> > --
> > D. Richard Hipp
> > d...@sqlite.org
> > ___
> > 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
>



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


Re: [sqlite] Disk I/O Error

2011-10-31 Thread Pavel Ivanov
> Error code 522 is SQLITE_IOERR_SHORT_READ.  It is generated here:
>
>     http://www.sqlite.org/src/artifact/07acbb3e074e?ln=3012
>
> SQLite was trying to read N bytes and got back M byes where M>0 and M wrote:
> On Mon, Oct 31, 2011 at 5:01 PM, Korey Calmettes 
> wrote:
>
>> Hello,
>>
>> We are having a random problem with our system that has be puzzled at
>> this point.
>>
>> First a little background.  We have an embedded system running an ARM
>> processor and JFFS file system.  We are running 3.7.7.1.  I e-mailed
>> about a month ago about enabling WAL on our system.  Found out that I
>> needed to set SQLITE_SHM_DIRECTORY to our tmpfs file system when
>> compiling as JFFS doesn't support shared mmap files.
>>
>> This has been working fine, however throughout our testing, we have been
>> hitting a problem.  It seems that some tables are no longer accessible
>> giving a Disk I/O Error.  I logged into the command line interface and
>> replicated the problem.  I ran ".log stdout" and here are the results.
>>
>> sqlite> select password from auth;
>> (522) statement aborts at 7: [select password from auth;]
>> Error: disk I/O error
>>
>> However access to other tables will work without any problems.
>>
>
> Error code 522 is SQLITE_IOERR_SHORT_READ.  It is generated here:
>
>     http://www.sqlite.org/src/artifact/07acbb3e074e?ln=3012
>
> SQLite was trying to read N bytes and got back M byes where M>0 and M
> Perchance is your database file truncated?  What happens when you run
> "PRAGMA integrity_check" on the database?  What is the page size of your
> database?
>
>
>
>>
>> I searched for how to read the log without success.  I am hopeful that
>> someone would be able to tell me what's going on.
>>
>> Korey
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> 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] Disk I/O Error

2011-10-31 Thread Richard Hipp
On Mon, Oct 31, 2011 at 5:01 PM, Korey Calmettes wrote:

> Hello,
>
> We are having a random problem with our system that has be puzzled at
> this point.
>
> First a little background.  We have an embedded system running an ARM
> processor and JFFS file system.  We are running 3.7.7.1.  I e-mailed
> about a month ago about enabling WAL on our system.  Found out that I
> needed to set SQLITE_SHM_DIRECTORY to our tmpfs file system when
> compiling as JFFS doesn't support shared mmap files.
>
> This has been working fine, however throughout our testing, we have been
> hitting a problem.  It seems that some tables are no longer accessible
> giving a Disk I/O Error.  I logged into the command line interface and
> replicated the problem.  I ran ".log stdout" and here are the results.
>
> sqlite> select password from auth;
> (522) statement aborts at 7: [select password from auth;]
> Error: disk I/O error
>
> However access to other tables will work without any problems.
>

Error code 522 is SQLITE_IOERR_SHORT_READ.  It is generated here:

 http://www.sqlite.org/src/artifact/07acbb3e074e?ln=3012

SQLite was trying to read N bytes and got back M byes where M>0 and M
> I searched for how to read the log without success.  I am hopeful that
> someone would be able to tell me what's going on.
>
> Korey
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Berthier, Emmanuel
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Dan Kennedy
> Are you using synchronous=NORMAL or synchronous=FULL?

When opening the database, in sqlite3PagerSetSafetyLevel(), I get:
level:3,
noSync:0,
fullSync:1,
sync_flags:2

> What does sqlite3_vfs_find(0)->xDeviceCharacteristics() return?

>From Sqlite source code:

/*
** Return the device characteristics for the file. This is always 0 for unix.
*/
static int unixDeviceCharacteristics(sqlite3_file *NotUsed){
  UNUSED_PARAMETER(NotUsed);
  return 0;
}

It seems that this function is not relevant on Linux/Android. But at shell 
level, we get:
# df -k /data
Filesystem Size   Used   Free   Blksize
/data  472M47M   425M   1024
-
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Dan Kennedy

On 09/20/2011 08:58 PM, Berthier, Emmanuel wrote:

From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Dan Kennedy

Can you post the hex of the first 28 bytes of the journal
file?


000 d5d9 f905 a120 d763  0400 a15c eae6
010  6300  0002  0004  
020        


Journal file should be, as you say, 4640 bytes in size. 3608 bytes
is the right size for a journal file that contains 3 pages, not 4.

Are you using synchronous=NORMAL or synchronous=FULL?

What does sqlite3_vfs_find(0)->xDeviceCharacteristics() return?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Simon Slavin

On 20 Sep 2011, at 3:52pm, Berthier, Emmanuel wrote:

> From: sqlite-users-boun...@sqlite.org 
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin
>> Sorry to say that this subject is one where the longer you spend looking at 
>> it the more annoying it gets.
> 
> You are not annoying me at all! ;-)
> 
>> You either have storage devices which support ACID and transactions, or you 
>> don't.
> 
> Could you give more info about these capabilities?

Only that they don't exist in the hardware you routinely buy.  Try reading



and pretend you were designing a hard disk drive to support it, instead of 
writing database software to support it.

Basically, many of the wonderful tricks modern DBMSes (including SQLite) do to 
support data integrity are made more complicated, or defeated entirely, because 
the underlying hardware lies to the operating system in an attempt to appear 
faster.  When you expensively buy server-type hardware at server prices, for 
example external RAID array cases with disks with Server-type firmware, you get 
stuff designed for data integrity.  When you buy cheap hard disks intended for 
cheap desktops, or Flash chips intended for mobile phones, you get stuff 
designed for speed and cheapness.

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


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Berthier, Emmanuel
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Simon Slavin
> Sorry to say that this subject is one where the longer you spend looking at 
> it the more annoying it gets.

You are not annoying me at all! ;-)

> You either have storage devices which support ACID and transactions, or you 
> don't.

Could you give more info about these capabilities?
-
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Simon Slavin

On 20 Sep 2011, at 3:30pm, Berthier, Emmanuel wrote:

> I've downloaded eMMC spec from www.jedec.org and it's very interesting:

Another thing you need to check for is out-of-order writes.  Sometimes the 
device will accept four 'write' commands, but obey commands 1 and 4 first, then 
2, then 3, because commands 1 and 4 are for the same sector of storage.  
Sometimes it even does 1 and 4 in the same cycle.

Sorry to say that this subject is one where the longer you spend looking at it 
the more annoying it gets. You either have storage devices which support ACID 
and transactions, or you don't.

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


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Berthier, Emmanuel
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Simon Slavin
> > That's the usual scenario with spinning media.  I'm less familiar with the
> > internal workings of flash memory controllers.  But people tell me that they
> > fail in similar ways.
>
> Yes yes and yes.  With normal settings set, SSD storage controllers lie to 
> the OS in the same way:
> once it has accepted the new write commands it
> acknowledges them as written immediately rather than saying "Hold on while I 
> do that.".
>
> Most bulk storage devices apart from the cheapest do have pin settings 
> (or tiny switches, or some hardware equivalent) which defeat this.  
> That makes them act properly and not acknowledge writes until the data really 
> has been written.  
> However, you would not want to use storage set up this way as the boot drive 
> for a computer.  

I've downloaded eMMC spec from www.jedec.org and it's very interesting:

JESD84-A441
§ 7.6.7
In general, an interruption to a write process should not cause corruption in 
existing data at any other
address. However, the risk of power being removed during a write operation is 
different in different
applications. Also, for some technologies used to implement e.MMC, there is a 
tradeoff between
protecting existing data (e.g., data written by the previous completed write 
operations), during a power
failure, and write performance. When the write data reliability parameters 
(WR_DATA_REL_USR,
WR_DATA_REL_1, WR_DATA_REL_2, WR_DATA_REL_3 and WR_DATA_REL_4) in EXT_CSD
(WR_REL_SET) are set to 1 it will indicate to the host that the write mechanism 
in the associated partition
has been implemented to protect existing data in that partition. This means 
that once a device indicates to
the host that a write has successfully completed, the data that was written, 
along with all previous data
written, cannot be corrupted by other operations that are host initiated, 
controller initiated or accidental. A
value of 0 for these bits will indicate that there is some risk to previously 
written data in those partitions if
power is removed.

Reliable Write: Multiple block write with pre-defined block count and Reliable 
Write parameters. This
transaction is similar to the basic pre-defined multiple-block write (defined 
in previous bullet) with the
following exceptions. The old data pointed to by a logical address must remain 
unchanged until the
new data written to same logical address has been successfully programmed. This 
is to ensure that the
target address updated by the reliable write transaction never contains 
undefined data. Data must
remain valid even if a sudden power loss occurs during the programming.

I will check what is implemented in our driver.
-
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Berthier, Emmanuel
> From: sqlite-users-boun...@sqlite.org 
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Dan Kennedy
>
> Can you post the hex of the first 28 bytes of the journal
> file?

000 d5d9 f905 a120 d763  0400 a15c eae6
010  6300  0002  0004  
020        

> If you move the journal file out of the way, does the
> integrity-check succeed?

Most of the time yes, but I get one database that is also corrupted :-(


-
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Simon Slavin

On 20 Sep 2011, at 2:07pm, Richard Hipp wrote:

> That's the usual scenario with spinning media.  I'm less familiar with the
> internal workings of flash memory controllers.  But people tell me that they
> fail in similar ways.

Yes yes and yes.  With normal settings set, SSD storage controllers lie to the 
OS in the same way: once it has accepted the new write commands it acknowledges 
them as written immediately rather than saying "Hold on while I do that.".

Most bulk storage devices apart from the cheapest do have pin settings (or tiny 
switches, or some hardware equivalent) which defeat this.  That makes them act 
properly and not acknowledge writes until the data really has been written.  
However, you would not want to use storage set up this way as the boot drive 
for a computer.  It makes a huge difference in write latency.  I set up a 
desktop computer to work this way as a demo on information security and it took 
three times as long to boot as normal and everyday operations like typing in 
Word slowed down something like fivefold.  Really painful to use.

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


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Dan Kennedy

On 09/20/2011 03:43 PM, Berthier, Emmanuel wrote:

Hi,

I'm using Sqlite 3.6.22 Froyo Branch on Android 2.3.4 distribution on a handset 
with eMMC storage memory.
In case of power-cut (battery removal or kernel panic), we encounter some rare 
but critical errors during database rollback sequence: journal file is 
corrupted:
# sqlite3 contacts2.db
sqlite>  PRAGMA integrity_check;
PRAGMA integrity_check;
Error: disk I/O error

After analyzing the journal header, it appears that:
- the header contains the right signature
- the page number is greater than what the file can contain. (ex: page nb=4 so 
journal size should be = 512+4x1024=4608 B but is currently 3608 B).


Can you post the hex of the first 28 bytes of the journal
file?

If you move the journal file out of the way, does the
integrity-check succeed?

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


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Richard Hipp
On Tue, Sep 20, 2011 at 8:46 AM, Berthier, Emmanuel <
emmanuel.berth...@intel.com> wrote:

>
> I managed the FS mount option and this partition is mount write-back mode
> with barrier=1.
> That's the critical point: referring the documentation, this configuration
> should be safe enough.
> How can I get wrong file size or wrong page nb in the header?
>

I don't know what is going wrong in your particular case.  But problems like
this usually proceed as follows:  The operating system tells the disk
controller "write these sectors and let me know when they are safely on
persistent storage."  The disk controller receives the sectors into its
track cache, and then replies to the OS "all is safely stored" before it
really has written the content to persistent storage.  The operating system
sends some more sectors to be written.  The disk controller writes these
latter sectors first, then a power failure occurs before the initial sectors
are completely written.

That's the usual scenario with spinning media.  I'm less familiar with the
internal workings of flash memory controllers.  But people tell me that they
fail in similar ways.

The bottom line is this:  SQLite uses fsync() as a write barrier.  All
writes that SQLite issues prior to the fsync() must complete prior to any
writes issued after the fsync().  As long as that rule is kept, you won't
get corruption.  Unfortunately, not all combinations of
linux+filesystem+disk/flash-controller keep this rule.

Since version 3.7.0, SQLite has support Write-Ahead Logging (WAL) for
transaction control.  WAL still depends on fsync() as a write barrier.  So
if your OS+hardware does not respect fsync() as a write barrier you can
still get corruption following a power-loss or OS panic.  But, while WAL
does still have some dependence on write barriers, it makes much less use of
write barriers than the older rollback transaction control mechanisms of
3.6.23.  And so your window of vulnerability is much smaller and you are
much less likely to encounter problems.

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


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Berthier, Emmanuel
-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Simon Slavin
> Can I ask where a power failure or a crash is involved in your finding at all 
> ? 
> Or is the corruption found when programs have only ever run as designed with 
> no unexpected termination ?

The journal is present after reboot only if handset is powered off without the 
clean shutdown sequence.

> I assume your app does sqlite3_close() in the expected manner.

My app is the standard Contact app from Android distribution, so Yes, I assume 
it closes de database in normal situation.
-
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Simon Slavin

On 20 Sep 2011, at 1:46pm, Berthier, Emmanuel wrote:

> From: sqlite-users-boun...@sqlite.org 
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Stephan Beal
> 
>> ...barrier=1 and do not disable the write cache so most Linux distributions
>> are vulnerable to this problem. Note that this is an operating system and
>> hardware issue and that there is nothing that SQLite can do to work around
>> it. Other database engines have also run into this same problem."
>> 
>> But notice those last two sentences.
> 
> The sentence starts with:
> " We are told that most Linux distributions do not use barrier=1 and do not 
> disable the write cache so most Linux distributions are vulnerable to this 
> problem."
> 
> I managed the FS mount option and this partition is mount write-back mode 
> with barrier=1.

Can I ask where a power failure or a crash is involved in your finding at all ? 
 Or is the corruption found when programs have only ever run as designed with 
no unexpected termination ?

I assume your app does sqlite3_close() in the expected manner.

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


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Berthier, Emmanuel
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Stephan Beal
> seek() allows one to seek past the end of the file, so the problem is not
> with seek (unless sqlite3's VFS interface castrates it), but probably a
> follow-up read() after the seek. It is perfectly legal, generically
> speaking, to fseek(f,100,SEEK_END) followed by a write() (which would grow
> the file, permissions allowing).

Oops, you're right, I/O error is generated by read() call, not seek() one.

>...barrier=1 and do not disable the write cache so most Linux distributions
> are vulnerable to this problem. Note that this is an operating system and
> hardware issue and that there is nothing that SQLite can do to work around
> it. Other database engines have also run into this same problem."
>
> But notice those last two sentences.

The sentence starts with:
" We are told that most Linux distributions do not use barrier=1 and do not 
disable the write cache so most Linux distributions are vulnerable to this 
problem."

I managed the FS mount option and this partition is mount write-back mode with 
barrier=1.
That's the critical point: referring the documentation, this configuration 
should be safe enough.
How can I get wrong file size or wrong page nb in the header?
-
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Stephan Beal
On Tue, Sep 20, 2011 at 2:30 PM, Berthier, Emmanuel <
emmanuel.berth...@intel.com> wrote:

> This is a real Sqlite error, in http://www.sqlite.org/c3ref/c_abort.html,
> there is:
>#define SQLITE_IOERR   10   /* Some kind of disk I/O error
> occurred */
> This error occurs when a seek()/read() call fails.
>
> That's why I've analyzed the journal file and decoded its header: the page
> nb differ from the real page stored in the journal. So, seek() generates a
> kind of "out of file" error.
>

seek() allows one to seek past the end of the file, so the problem is not
with seek (unless sqlite3's VFS interface castrates it), but probably a
follow-up read() after the seek. It is perfectly legal, generically
speaking, to fseek(f,100,SEEK_END) followed by a write() (which would grow
the file, permissions allowing).


> I think it's a real issue between Sqlite and FS.
> Sqlite has huge constraints against FS behavior:
>
 ...barrier=1 and do not disable the write cache so most Linux distributions
are vulnerable to this problem. Note that this is an operating system and
hardware issue and that there is nothing that SQLite can do to work around
it. Other database engines have also run into this same problem."

But notice those last two sentences.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Berthier, Emmanuel
This is a real Sqlite error, in http://www.sqlite.org/c3ref/c_abort.html, there 
is:
#define SQLITE_IOERR   10   /* Some kind of disk I/O error occurred 
*/
This error occurs when a seek()/read() call fails.

That's why I've analyzed the journal file and decoded its header: the page nb 
differ from the real page stored in the journal. So, seek() generates a kind of 
"out of file" error.

"PRAGMA integrity_check" is just a little sqlite level command that demonstrate 
the issue, but the application is crashing every time it tries to read the 
database.

I think it's a real issue between Sqlite and FS.
Sqlite has huge constraints against FS behavior:
"If a Linux ext3 filesystem is mounted without the "barrier=1" option in the 
/etc/fstab and the disk drive write cache is enabled then filesystem corruption 
can occur following a power loss or OS crash. Whether or not corruption can 
occur depends on the details of the disk control hardware; corruption is more 
likely with inexpensive consumer-grade disks and less of a problem for 
enterprise-class storage devices with advanced features such as non-volatile 
write caches. Various ext3 experts confirm this behavior. We are told that most 
Linux distributions do not use barrier=1 and do not disable the write cache so 
most Linux distributions are vulnerable to this problem. Note that this is an 
operating system and hardware issue and that there is nothing that SQLite can 
do to work around it. Other database engines have also run into this same 
problem."

Emmanuel.

-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Simon Slavin
Sent: Tuesday, September 20, 2011 2:08 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.


On 20 Sep 2011, at 9:43am, Berthier, Emmanuel wrote:

> I'm using Sqlite 3.6.22 Froyo Branch on Android 2.3.4 distribution on a 
> handset with eMMC storage memory.
> In case of power-cut (battery removal or kernel panic), we encounter some 
> rare but critical errors during database rollback sequence: journal file is 
> corrupted:
> # sqlite3 contacts2.db
> sqlite> PRAGMA integrity_check;
> PRAGMA integrity_check;
> Error: disk I/O error

Here are all the SQLite result codes:

http://www.sqlite.org/c3ref/c_abort.html

As you can see they're about formatting and files.  'disk I/O error' isn't a 
SQLite result code, I think it may be a sign that your hardware is faulty.  

One thing that "PRAGMA integrity_check" does is read a lot of the file very 
quickly.  It doesn't read every byte of the file but it does read a lot of the 
file and do some intense processing.  So it's a good way of putting storage, 
memory, databus and CPU under load.  I think there's a chance that this is 
betraying some underlying fault with your hardware.

Perhaps you have some benchtesting software you can run on the same unit.  
Something that does a bunch of processing and writing and reading of files but 
doesn't involve any SQLite ?

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
-
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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


Re: [sqlite] Disk I/O Error on Ext3/write-back/barrier FS.

2011-09-20 Thread Simon Slavin

On 20 Sep 2011, at 9:43am, Berthier, Emmanuel wrote:

> I'm using Sqlite 3.6.22 Froyo Branch on Android 2.3.4 distribution on a 
> handset with eMMC storage memory.
> In case of power-cut (battery removal or kernel panic), we encounter some 
> rare but critical errors during database rollback sequence: journal file is 
> corrupted:
> # sqlite3 contacts2.db
> sqlite> PRAGMA integrity_check;
> PRAGMA integrity_check;
> Error: disk I/O error

Here are all the SQLite result codes:

http://www.sqlite.org/c3ref/c_abort.html

As you can see they're about formatting and files.  'disk I/O error' isn't a 
SQLite result code, I think it may be a sign that your hardware is faulty.  

One thing that "PRAGMA integrity_check" does is read a lot of the file very 
quickly.  It doesn't read every byte of the file but it does read a lot of the 
file and do some intense processing.  So it's a good way of putting storage, 
memory, databus and CPU under load.  I think there's a chance that this is 
betraying some underlying fault with your hardware.

Perhaps you have some benchtesting software you can run on the same unit.  
Something that does a bunch of processing and writing and reading of files but 
doesn't involve any SQLite ?

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


Re: [sqlite] Disk I/O Error

2011-02-08 Thread Nathan Biggs
thanks.

On 2/8/2011 3:24 PM, Teg wrote:
>
> Hello Nathan,
>
> It could be hardware but, my experience with my users is that anything
> weird like this is virus scanner of firewall related. You can suggest
> that they try telling the V scanner to ignore the folder your data
> resides in and see if it makes a difference. That's my normal
> suggestion to my users. Solves the problems most of the time.
>
> C
>
>
>
> Tuesday, February 8, 2011, 1:43:20 PM, you wrote:
>
> NB> That was exactly my thought.  But since it is at a customer's site, I
> NB> have to prove that its their virus scanner that is causing the 
> problems.
>
>
> NB> On 2/8/2011 1:17 PM, Jim Morris wrote:
> >>
> >> Could a backup or virus scanning software be locking the database?
> >>
> >> On 2/8/2011 10:12 AM, Nathan Biggs wrote:
> >> > I haven't tried that, but if we stop the application then restart it,
> >> > everything works again.  That is until we get another Disk I/O error
> >> > which happens the next day.
> >> > I'm wondering if the virus scanner is blocking the database write.
> >> >
> >> >
> >> >
> >> > On 2/8/2011 1:03 PM, Simon Slavin wrote:
> >> >> On 8 Feb 2011, at 5:59pm, Nathan Biggs wrote:
> >> >>
> >> >>> Once a day, not at the same time, we are getting a disk I/O 
> error from
> >> >>> our application using SQLite.
> >> >> If you try to duplicate the database file do you get any kind of 
> error
> >> >> then ?
> >> >>
> >> >> If not, use the command-line tool to run an integrity check:
> >> >>
> >> >> http://www.sqlite.org/pragma.html#pragma_integrity_check
> >> >>
> >> >> 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
> >> >
> >> ___
> >> sqlite-users mailing list
> >> sqlite-users@sqlite.org
> >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >>
> NB> ___
> NB> sqlite-users mailing list
> NB> sqlite-users@sqlite.org
> NB> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> --
> Best regards,
>  Teg mailto:t...@djii.com
>
> ___
> 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] Disk I/O Error

2011-02-08 Thread Teg
Hello Nathan,

It could be hardware but, my experience with my users is that anything
weird like this is virus scanner of firewall related. You can suggest
that they try telling the V scanner to ignore the folder your data
resides in and see if it makes a difference. That's my normal
suggestion to my users. Solves the problems most of the time.

C



Tuesday, February 8, 2011, 1:43:20 PM, you wrote:

NB> That was exactly my thought.  But since it is at a customer's site, I 
NB> have to prove that its their virus scanner that is causing the problems.


NB> On 2/8/2011 1:17 PM, Jim Morris wrote:
>>
>> Could a backup or virus scanning software be locking the database?
>>
>> On 2/8/2011 10:12 AM, Nathan Biggs wrote:
>> > I haven't tried that, but if we stop the application then restart it,
>> > everything works again.  That is until we get another Disk I/O error
>> > which happens the next day.
>> > I'm wondering if the virus scanner is blocking the database write.
>> >
>> >
>> >
>> > On 2/8/2011 1:03 PM, Simon Slavin wrote:
>> >> On 8 Feb 2011, at 5:59pm, Nathan Biggs wrote:
>> >>
>> >>> Once a day, not at the same time, we are getting a disk I/O error from
>> >>> our application using SQLite.
>> >> If you try to duplicate the database file do you get any kind of error
>> >> then ?
>> >>
>> >> If not, use the command-line tool to run an integrity check:
>> >>
>> >> http://www.sqlite.org/pragma.html#pragma_integrity_check
>> >>
>> >> 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
>> >
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
NB> ___
NB> sqlite-users mailing list
NB> sqlite-users@sqlite.org
NB> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



-- 
Best regards,
 Tegmailto:t...@djii.com

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


Re: [sqlite] Disk I/O Error

2011-02-08 Thread Nathan Biggs
That was exactly my thought.  But since it is at a customer's site, I 
have to prove that its their virus scanner that is causing the problems.


On 2/8/2011 1:17 PM, Jim Morris wrote:
>
> Could a backup or virus scanning software be locking the database?
>
> On 2/8/2011 10:12 AM, Nathan Biggs wrote:
> > I haven't tried that, but if we stop the application then restart it,
> > everything works again.  That is until we get another Disk I/O error
> > which happens the next day.
> > I'm wondering if the virus scanner is blocking the database write.
> >
> >
> >
> > On 2/8/2011 1:03 PM, Simon Slavin wrote:
> >> On 8 Feb 2011, at 5:59pm, Nathan Biggs wrote:
> >>
> >>> Once a day, not at the same time, we are getting a disk I/O error from
> >>> our application using SQLite.
> >> If you try to duplicate the database file do you get any kind of error
> >> then ?
> >>
> >> If not, use the command-line tool to run an integrity check:
> >>
> >> http://www.sqlite.org/pragma.html#pragma_integrity_check
> >>
> >> 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
> >
> ___
> 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] Disk I/O Error

2011-02-08 Thread Simon Slavin

On 8 Feb 2011, at 6:12pm, Nathan Biggs wrote:

> I haven't tried that, but if we stop the application then restart it, 
> everything works again.  That is until we get another Disk I/O error 
> which happens the next day.
> I'm wondering if the virus scanner is blocking the database write.

Just as likely to be a hardware failure of some sort:

bad sector on the hard disk
hard disk about to fail
faulty cabling to hard disk
faulty hard disk controller

So just use your OS GUI to copy the database file.  That will read every block 
in the file very fast and possibly trigger a fault.  If that happens, you know 
it's not related to SQLite but an OS or hardware issue.

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


Re: [sqlite] Disk I/O Error

2011-02-08 Thread Jim Morris
Could a backup or virus scanning software be locking the database?

On 2/8/2011 10:12 AM, Nathan Biggs wrote:
> I haven't tried that, but if we stop the application then restart it,
> everything works again.  That is until we get another Disk I/O error
> which happens the next day.
> I'm wondering if the virus scanner is blocking the database write.
>
>
>
> On 2/8/2011 1:03 PM, Simon Slavin wrote:
>> On 8 Feb 2011, at 5:59pm, Nathan Biggs wrote:
>>
>>> Once a day, not at the same time, we are getting a disk I/O error from
>>> our application using SQLite.
>> If you try to duplicate the database file do you get any kind of error
>> then ?
>>
>> If not, use the command-line tool to run an integrity check:
>>
>> http://www.sqlite.org/pragma.html#pragma_integrity_check
>>
>> 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
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Disk I/O Error

2011-02-08 Thread Teg
Hello Nathan,

I'd install "Procmon" set it to filter just on the problem file (and
journal files) and let the software run. When you get an error, you
should see the details listed in procmon".

C

Tuesday, February 8, 2011, 1:12:48 PM, you wrote:

NB> I haven't tried that, but if we stop the application then restart it, 
NB> everything works again.  That is until we get another Disk I/O error 
NB> which happens the next day.
NB> I'm wondering if the virus scanner is blocking the database write.



NB> On 2/8/2011 1:03 PM, Simon Slavin wrote:
>>
>> On 8 Feb 2011, at 5:59pm, Nathan Biggs wrote:
>>
>> > Once a day, not at the same time, we are getting a disk I/O error from
>> > our application using SQLite.
>>
>> If you try to duplicate the database file do you get any kind of error 
>> then ?
>>
>> If not, use the command-line tool to run an integrity check:
>>
>> http://www.sqlite.org/pragma.html#pragma_integrity_check
>>
>> Simon.
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
NB> ___
NB> sqlite-users mailing list
NB> sqlite-users@sqlite.org
NB> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



-- 
Best regards,
 Tegmailto:t...@djii.com

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


Re: [sqlite] Disk I/O Error

2011-02-08 Thread Nathan Biggs
I haven't tried that, but if we stop the application then restart it, 
everything works again.  That is until we get another Disk I/O error 
which happens the next day.
I'm wondering if the virus scanner is blocking the database write.



On 2/8/2011 1:03 PM, Simon Slavin wrote:
>
> On 8 Feb 2011, at 5:59pm, Nathan Biggs wrote:
>
> > Once a day, not at the same time, we are getting a disk I/O error from
> > our application using SQLite.
>
> If you try to duplicate the database file do you get any kind of error 
> then ?
>
> If not, use the command-line tool to run an integrity check:
>
> http://www.sqlite.org/pragma.html#pragma_integrity_check
>
> 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] Disk I/O Error

2011-02-08 Thread Simon Slavin

On 8 Feb 2011, at 5:59pm, Nathan Biggs wrote:

> Once a day, not at the same time, we are getting a disk I/O error from 
> our application using SQLite.

If you try to duplicate the database file do you get any kind of error then ?

If not, use the command-line tool to run an integrity check:

http://www.sqlite.org/pragma.html#pragma_integrity_check

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


Re: [sqlite] Disk I/O error on AIX

2009-08-04 Thread Ken

Roger,

Thats too funny. I guess I forgot posting this last year.

Ken

--- On Mon, 8/3/09, Roger Binns <rog...@rogerbinns.com> wrote:

> From: Roger Binns <rog...@rogerbinns.com>
> Subject: Re: [sqlite] Disk I/O error on AIX
> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
> Date: Monday, August 3, 2009, 7:55 PM
> Ken wrote:
> > I'm getting a Disk I/O error when committing a
> transaction on an AIX system.
> > The file system is JFS.
> > The extended result code is 1290. Which i believe
> means that the extended code is a SQLITE_IOERR_DIR_FSYNC
> error.
> > 
> > Any ideas why this is happening or how to track it
> down?
> 
> This has come up before and you may recognise the poster:
> 
>    http://thread.gmane.org/gmane.comp.db.sqlite.general/39682/
> 
> Roger
> 
> ___
> 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] Disk I/O error on AIX

2009-08-04 Thread Ken

Thanks Dan!

I'll check this in the morning.

Ken

--- On Tue, 8/4/09, Dan Kennedy <danielk1...@gmail.com> wrote:

> From: Dan Kennedy <danielk1...@gmail.com>
> Subject: Re: [sqlite] Disk I/O error on AIX
> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
> Date: Tuesday, August 4, 2009, 12:03 AM
> 
> On Aug 4, 2009, at 5:11 AM, Ken wrote:
> 
> >
> > Hi,
> >
> > I'm getting a Disk I/O error when committing a
> transaction on an AIX  
> > system.
> > The file system is JFS.
> >
> >
> > The extended result code is 1290. Which i believe
> means that the  
> > extended code is a SQLITE_IOERR_DIR_FSYNC error.
> >
> > Any ideas why this is happening or how to track it
> down?
> 
> AIX needs -DSQLITE_DISABLE_DIRSYNC.
> 
> Dan.
> 
> ___
> 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] Disk I/O error on AIX

2009-08-03 Thread Dan Kennedy

On Aug 4, 2009, at 5:11 AM, Ken wrote:

>
> Hi,
>
> I'm getting a Disk I/O error when committing a transaction on an AIX  
> system.
> The file system is JFS.
>
>
> The extended result code is 1290. Which i believe means that the  
> extended code is a SQLITE_IOERR_DIR_FSYNC error.
>
> Any ideas why this is happening or how to track it down?

AIX needs -DSQLITE_DISABLE_DIRSYNC.

Dan.

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


Re: [sqlite] Disk I/O error on AIX

2009-08-03 Thread Roger Binns
Ken wrote:
> I'm getting a Disk I/O error when committing a transaction on an AIX system.
> The file system is JFS.
> The extended result code is 1290. Which i believe means that the extended 
> code is a SQLITE_IOERR_DIR_FSYNC error.
> 
> Any ideas why this is happening or how to track it down?

This has come up before and you may recognise the poster:

   http://thread.gmane.org/gmane.comp.db.sqlite.general/39682/

Roger

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


Re: [sqlite] Disk I/O error on AIX

2009-08-03 Thread Simon Slavin

On 3 Aug 2009, at 11:11pm, Ken wrote:

> I'm getting a Disk I/O error when committing a transaction on an AIX  
> system.
> The file system is JFS.

Check all the obvious things:

Is there free space on drive ?
If you replace that transaction by a very simple INSERT, or by a  
DELETE, do you get the same error ?


> The extended result code is 1290. Which i believe means that the  
> extended code is a SQLITE_IOERR_DIR_FSYNC error.
>
> Any ideas why this is happening or how to track it down?

Get your database all the way up to that final transaction then have  
your program quit.
Start up the sqlite3 command-line tool.

Use the command that checks to see the database is not corrupt.
Enter your final transaction and commit it.
Do you get the same error you got in your own application ?

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


Re: [sqlite] disk I/O error...?

2009-04-11 Thread Alberto Simões
Hello.

On Sat, Apr 11, 2009 at 3:04 PM, Jim Wilcoxson  wrote:
> You'll get this if you have a database with an active journal
> (incomplete transactions) and you don't have write access to the
> database.  In other words, the database needs a rollback from some
> prior operations done under a different userid, but now you don't have
> write access to do the rollback.

Hmms, these databases where being created and were shut down by other
script (kill).
It might happen that they have some kind of lock active.

I can't find any lock/journal file.Thus, it should probably be inside
the database file.

Is there anyway to 'clean' a database status?

Thank you
Alberto

>
> To me, it should be a permission error instead, to make it clear
> what's going on.
>
> Jim
>
> On 4/11/09, Alberto Simões  wrote:
>> Hello
>> I am getting disk I/O error with:
>>
>> [a...@search1 align]$ du -hs T.3.sqlite
>> 122M  T.3.sqlite
>> [a...@search1 align]$ sqlite3 T.3.sqlite
>> SQLite version 3.6.6
>> Enter ".help" for instructions
>> Enter SQL statements terminated with a ";"
>> sqlite> .schema
>> CREATE TABLE trigrams (w1,w2,w3,occs);
>> CREATE INDEX idxT3w1 ON trigrams (w1);
>> sqlite> CREATE INDEX idxT3w2 ON trigrams (w2);
>> SQL error: disk I/O error
>> sqlite> [a...@search1 align]$ df -h .
>> Filesystem            Size  Used Avail Use% Mounted on
>> /dev/sdc1             148G   42G  100G  30% /export3
>> [a...@search1 align]$
>>
>> I tried to get I/O errors with other commands (for instance, yes > _)
>> but couldn't get any error.
>>
>> Any hint on what I can check to discover the problem?
>> Thank you
>> Alberto
>>
>> --
>> Alberto Simões
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
> --
> Software first.  Software lasts!
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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


Re: [sqlite] disk I/O error...?

2009-04-11 Thread Jim Wilcoxson
You'll get this if you have a database with an active journal
(incomplete transactions) and you don't have write access to the
database.  In other words, the database needs a rollback from some
prior operations done under a different userid, but now you don't have
write access to do the rollback.

To me, it should be a permission error instead, to make it clear
what's going on.

Jim

On 4/11/09, Alberto Simões  wrote:
> Hello
> I am getting disk I/O error with:
>
> [a...@search1 align]$ du -hs T.3.sqlite
> 122M  T.3.sqlite
> [a...@search1 align]$ sqlite3 T.3.sqlite
> SQLite version 3.6.6
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite> .schema
> CREATE TABLE trigrams (w1,w2,w3,occs);
> CREATE INDEX idxT3w1 ON trigrams (w1);
> sqlite> CREATE INDEX idxT3w2 ON trigrams (w2);
> SQL error: disk I/O error
> sqlite> [a...@search1 align]$ df -h .
> FilesystemSize  Used Avail Use% Mounted on
> /dev/sdc1 148G   42G  100G  30% /export3
> [a...@search1 align]$
>
> I tried to get I/O errors with other commands (for instance, yes > _)
> but couldn't get any error.
>
> Any hint on what I can check to discover the problem?
> Thank you
> Alberto
>
> --
> Alberto Simões
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>


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


Re: [sqlite] disk I/O error

2007-06-06 Thread John Stanton

Arun Bhalla wrote:

Hello,

This message may be off-topic in that I don't think the following issue
 corresponds to a bug with SQLite, but it's something I've discovered
while using SQLite.  Perhaps someone on the list has had a similar
experience or could make a suggestion.

A Linux 2.6/x86_64 system reports a "disk I/O error" (SQLITE_IOERR)
while generating a specific report from a SQLite database (SQLite
3.3.6).  The database and temporary files are accessed through an NFS
mount.  After running the program again with SQLite tracing enabled
(plus a bit more I added), I see that SQLITE_IOERR is returned by
unixRead() because read() unexpectedly returned 0!

Here's some relevant strace output:

open("/nfs/tmp/sqlite_dBjTG5bZdsqFVPb", O_RDWR|O_CREAT|O_EXCL, 0644) = 8

[...]

lseek(8, 193536, SEEK_SET)= 193536
write(8, "\n\0\0\0\30\0\222\0\0\266\0\332\0\376\1\"\1F\1l\1\222\1"...,
1024) = 1024

[...]

lseek(8, 226304, SEEK_SET)= 226304
write(8, "\n\0\0\0\30\0\240\0\0\240\0\304\0\350\1\f\0010\1T\1x\1"...,
1024) = 1024
lseek(8, 193536, SEEK_SET)= 193536
read(8, "", 1024) = 0
fstat(8, {st_mode=S_IFREG|0644, st_size=227328, ...}) = 0

The read() call shouldn't fail -- the same page was written to at the
beginning of the transaction!  At least by the time fstat() is called,
the file is 227328 bytes long, so a read at an offset of 193536 should
not fail.

I'm suspecting that the NFS server in question is buggy or
misconfigured.  Unfortunately I don't have access to either the NFS
server or the host running the program, so mainly all I can access is
some strace and SQLite tracing output.

Thanks for any suggestions,
Arun

Run it witho8ut NFS.  If it doesn;t fail then go looking fot the NFS 
problem.


- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 






-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] disk I/O error

2007-06-06 Thread Joe Wilson
> A Linux 2.6/x86_64 system reports a "disk I/O error" (SQLITE_IOERR)
> while generating a specific report from a SQLite database (SQLite
> 3.3.6).  The database and temporary files are accessed through an NFS
> mount.  After running the program again with SQLite tracing enabled
> (plus a bit more I added), I see that SQLITE_IOERR is returned by
> unixRead() because read() unexpectedly returned 0!
> 
> Here's some relevant strace output:
> 
> open("/nfs/tmp/sqlite_dBjTG5bZdsqFVPb", O_RDWR|O_CREAT|O_EXCL, 0644) = 8
> 
> [...]
> 
> lseek(8, 193536, SEEK_SET)= 193536
> write(8, "\n\0\0\0\30\0\222\0\0\266\0\332\0\376\1\"\1F\1l\1\222\1"...,
> 1024) = 1024
> 
> [...]
> 
> lseek(8, 226304, SEEK_SET)= 226304
> write(8, "\n\0\0\0\30\0\240\0\0\240\0\304\0\350\1\f\0010\1T\1x\1"...,
> 1024) = 1024
> lseek(8, 193536, SEEK_SET)= 193536
> read(8, "", 1024) = 0
> fstat(8, {st_mode=S_IFREG|0644, st_size=227328, ...}) = 0
> 
> The read() call shouldn't fail -- the same page was written to at the
> beginning of the transaction!  At least by the time fstat() is called,
> the file is 227328 bytes long, so a read at an offset of 193536 should
> not fail.
> 
> I'm suspecting that the NFS server in question is buggy or
> misconfigured.  Unfortunately I don't have access to either the NFS
> server or the host running the program, so mainly all I can access is
> some strace and SQLite tracing output.

I'd guess that your NFS server's writes are not synchronous. 
If this is true, then it may be that the NFS server performing 
the read does not yet have the data in a readable form and 
returns 0. See "safe asynchronous writes" in 
http://nfs.sourceforge.net/

Yikes - you're using /nfs/tmp for your temp_store_directory - 
not good. 

Use either:

 PRAGMA temp_store_directory = '/some/local/disk/directory';

or

 pragma temp_store=memory;

to avoid the brutal NFS round trip delays for your temp files.

But if you *must* perform writes to the NFS database file, 
and for some strange reason must use NFS temp store, you might 
try hacking the unix reads to loop with a usleep delay if it 
encounters a zero return, giving up and failing after 
a number of retries. 

If you could post your findings to the list, that would be great.


   

Get the free Yahoo! toolbar and rest assured with the added security of spyware 
protection.
http://new.toolbar.yahoo.com/toolbar/features/norton/index.php

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] disk I/O error writing files mounted via samba

2006-12-19 Thread Guy Hindell

Guy Hindell wrote:

Guy Hindell wrote:

[EMAIL PROTECTED] wrote:

Guy Hindell <[EMAIL PROTECTED]> wrote:
 
I would like to use sqlite (v3.3.8) on a linux box (fedora core 5) 
to read/write a database file in a directory which is actually on a 
windows share mounted via samba/cifs. I can open the file, and read 
from it, but writing produces "disk I/O error" messages 
(SQLITE_IOERR error code). I can write ordinary files on the share 
(echo "foo" > [share]/file.txt) so it doesn't look like a 
permissions issue. Only one process is ever going to access the 
file so I wouldn't expect locking issues. If I try turning things 
around so that I build/run my sqlite program on windows and access 
a file on a samba share exported from my linux box I can read/write 
without any errors.





Please turn on extended result codes using

  sqlite3_extended_result_codes(db, 1)

Then tell me the detailed error code that results from this
error.  That will help to isolate the problem.
--
D. Richard Hipp  <[EMAIL PROTECTED]>


- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 





  

Hi, sorry for the delay - been away from email for a couple of days.

I have tried adding a call to sqlite3_extended_result_codes() as you 
describe above (called once after the db file is opened on the handle 
returned from sqlite3_open()). Still get simply error code 10 
(SQLITE_IOERR) back from write statements (no upper bits set), but 
now get no error text from sqlite3_get_table() (which I use to front 
all my sqlite3_exec() calls).


What next?

guy

BTW, regarding the other post about file sizes greater than 2GB, no, 
the file is tiny.






- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 





OK, a bit more playing shows that the point at which the SQLITE_IOERR 
is produced is in os_unix.c, line ~1586 -


   lock.l_type = F_UNLCK;
   lock.l_whence = SEEK_SET;
   lock.l_start = PENDING_BYTE;
   lock.l_len = 2L;  assert( PENDING_BYTE+1==RESERVED_BYTE );
   if( fcntl(pFile->h, F_SETLK, )==0 ){
 pLock->locktype = SHARED_LOCK;
   }else{
 rc = SQLITE_IOERR_UNLOCK;  /* This should never happen <--- BUT 
IT DOES :-(

   }

Not sure why I don't see this as an extended result, but it seems like 
the cifs mounted filesystem isn't behaving in the expected manner.


guy




- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 





Ah! Google provides the answer - seems like the nobrl option is required 
when mounting filesystems with cifs if this sort of locking call is 
going to be made...


http://lists.samba.org/archive/linux-cifs-client/2006-November/001583.html




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] disk I/O error writing files mounted via samba

2006-12-19 Thread Guy Hindell

Guy Hindell wrote:

[EMAIL PROTECTED] wrote:

Guy Hindell <[EMAIL PROTECTED]> wrote:
 
I would like to use sqlite (v3.3.8) on a linux box (fedora core 5) 
to read/write a database file in a directory which is actually on a 
windows share mounted via samba/cifs. I can open the file, and read 
from it, but writing produces "disk I/O error" messages 
(SQLITE_IOERR error code). I can write ordinary files on the share 
(echo "foo" > [share]/file.txt) so it doesn't look like a 
permissions issue. Only one process is ever going to access the file 
so I wouldn't expect locking issues. If I try turning things around 
so that I build/run my sqlite program on windows and access a file 
on a samba share exported from my linux box I can read/write without 
any errors.





Please turn on extended result codes using

  sqlite3_extended_result_codes(db, 1)

Then tell me the detailed error code that results from this
error.  That will help to isolate the problem.
--
D. Richard Hipp  <[EMAIL PROTECTED]>


- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 





  

Hi, sorry for the delay - been away from email for a couple of days.

I have tried adding a call to sqlite3_extended_result_codes() as you 
describe above (called once after the db file is opened on the handle 
returned from sqlite3_open()). Still get simply error code 10 
(SQLITE_IOERR) back from write statements (no upper bits set), but now 
get no error text from sqlite3_get_table() (which I use to front all 
my sqlite3_exec() calls).


What next?

guy

BTW, regarding the other post about file sizes greater than 2GB, no, 
the file is tiny.






- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 





OK, a bit more playing shows that the point at which the SQLITE_IOERR is 
produced is in os_unix.c, line ~1586 -


   lock.l_type = F_UNLCK;
   lock.l_whence = SEEK_SET;
   lock.l_start = PENDING_BYTE;
   lock.l_len = 2L;  assert( PENDING_BYTE+1==RESERVED_BYTE );
   if( fcntl(pFile->h, F_SETLK, )==0 ){
 pLock->locktype = SHARED_LOCK;
   }else{
 rc = SQLITE_IOERR_UNLOCK;  /* This should never happen <--- BUT IT 
DOES :-(

   }

Not sure why I don't see this as an extended result, but it seems like 
the cifs mounted filesystem isn't behaving in the expected manner.


guy




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] disk I/O error writing files mounted via samba

2006-12-18 Thread Guy Hindell

[EMAIL PROTECTED] wrote:

Guy Hindell <[EMAIL PROTECTED]> wrote:
  
I would like to use sqlite (v3.3.8) on a linux box (fedora core 5) to 
read/write a database file in a directory which is actually on a windows 
share mounted via samba/cifs. I can open the file, and read from it, but 
writing produces "disk I/O error" messages (SQLITE_IOERR error code). I 
can write ordinary files on the share (echo "foo" > [share]/file.txt) so 
it doesn't look like a permissions issue. Only one process is ever going 
to access the file so I wouldn't expect locking issues. If I try turning 
things around so that I build/run my sqlite program on windows and 
access a file on a samba share exported from my linux box I can 
read/write without any errors.





Please turn on extended result codes using

  sqlite3_extended_result_codes(db, 1)

Then tell me the detailed error code that results from this
error.  That will help to isolate the problem.
--
D. Richard Hipp  <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



  

Hi, sorry for the delay - been away from email for a couple of days.

I have tried adding a call to sqlite3_extended_result_codes() as you 
describe above (called once after the db file is opened on the handle 
returned from sqlite3_open()). Still get simply error code 10 
(SQLITE_IOERR) back from write statements (no upper bits set), but now 
get no error text from sqlite3_get_table() (which I use to front all my 
sqlite3_exec() calls).


What next?

guy

BTW, regarding the other post about file sizes greater than 2GB, no, the 
file is tiny.






-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] disk I/O error writing files mounted via samba

2006-12-14 Thread Nikki Locke
Guy Hindell wrote:
> I would like to use sqlite (v3.3.8) on a linux box (fedora core 5) to 
> read/write a database file in a directory which is actually on a windows 
> share mounted via samba/cifs. I can open the file, and read from it, but 
> writing produces "disk I/O error" messages (SQLITE_IOERR error code). I 
> can write ordinary files on the share (echo "foo" > [share]/file.txt) so 
> it doesn't look like a permissions issue. Only one process is ever going 
> to access the file so I wouldn't expect locking issues. If I try turning 
> things around so that I build/run my sqlite program on windows and 
> access a file on a samba share exported from my linux box I can 
> read/write without any errors. 
>  
> Anyone tried this? I'd love to solve this problem as it will be the 
> final nail in the coffin for MSAccess in my app ;-) 

Is the database bigger than 2Gb? 

If so, have you got large file support in samba (lfs in the mount options)?

-- 
Nikki Locke, Trumphurst Ltd.  PC & Unix consultancy & programming
http://www.trumphurst.com/



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] disk I/O error writing files mounted via samba

2006-12-14 Thread drh
Guy Hindell <[EMAIL PROTECTED]> wrote:
> I would like to use sqlite (v3.3.8) on a linux box (fedora core 5) to 
> read/write a database file in a directory which is actually on a windows 
> share mounted via samba/cifs. I can open the file, and read from it, but 
> writing produces "disk I/O error" messages (SQLITE_IOERR error code). I 
> can write ordinary files on the share (echo "foo" > [share]/file.txt) so 
> it doesn't look like a permissions issue. Only one process is ever going 
> to access the file so I wouldn't expect locking issues. If I try turning 
> things around so that I build/run my sqlite program on windows and 
> access a file on a samba share exported from my linux box I can 
> read/write without any errors.
> 

Please turn on extended result codes using

  sqlite3_extended_result_codes(db, 1)

Then tell me the detailed error code that results from this
error.  That will help to isolate the problem.
--
D. Richard Hipp  <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Disk I/o Error : SQLITE_IOERR while performing Select/Delete on database

2006-05-10 Thread deepali rajale

Thanks for your reply. We use powerpc Linux on the embedded platform
(CPU Model number : MPC885 ).
I have downloaded the source code for sqlite version 3.3.4 and
compiled it for powerpc linux gnu.

Thanks
Deepali

On 5/10/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

"deepali rajale" <[EMAIL PROTECTED]> wrote:
>
> I am getting SQLITE_IOERR error while trying to perform select  or
> delete operation on a record when Database has more than 3000 records.
> The table is likely to grow to 1 records.
>
> Can someone give any pointers to the solution.
>

An SQLITE_IOERR indicates that a disk I/O operation
(a read or a write) failed.  This indicates some kind
of problem with your embedded hardware.  Or perhaps
your custom OS interface layer is not working quite
right.  Or perhaps you are trying to use one of the
OS interface layers for Unix or Windows on an embedded
platform that does not fully support the Unix or Win32
interface.

What operating system are you running on your
embedded platform?

--
D. Richard Hipp   <[EMAIL PROTECTED]>




Re: [sqlite] Disk I/o Error : SQLITE_IOERR while performing Select/Delete on database

2006-05-10 Thread drh
"deepali rajale" <[EMAIL PROTECTED]> wrote:
> 
> I am getting SQLITE_IOERR error while trying to perform select  or
> delete operation on a record when Database has more than 3000 records.
> The table is likely to grow to 1 records.
> 
> Can someone give any pointers to the solution.
> 

An SQLITE_IOERR indicates that a disk I/O operation
(a read or a write) failed.  This indicates some kind
of problem with your embedded hardware.  Or perhaps
your custom OS interface layer is not working quite
right.  Or perhaps you are trying to use one of the
OS interface layers for Unix or Windows on an embedded
platform that does not fully support the Unix or Win32
interface.

What operating system are you running on your
embedded platform?

--
D. Richard Hipp   <[EMAIL PROTECTED]>