sqlite3.OperationalError: disk I/O error

2,792 views
Skip to first unread message

David Hughes

unread,
Feb 15, 2011, 7:23:59 AM2/15/11
to python-sqlite
What is likely to be behind such errors? A user has reported receiving
them. They are occurring when making queries, so only reading, and the
SELECT statements, which are also being reported in the error messages,
look OK. I don't have many details yet but it doesn't seem to be
happening on all the queries in the session, only with one , or
possibly two, specific tables.
--
Regards,
David Hughes
Forestfield Software

Roger Binns

unread,
Feb 15, 2011, 12:30:29 PM2/15/11
to python...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/15/2011 04:23 AM, David Hughes wrote:
> What is likely to be behind such errors?

Those errors only come from the SQLite core.

> don't have many details yet but it doesn't seem to be happening on all the
> queries in the session, only with one , or possibly two, specific tables.

Chances are that SQLite was unable to read some of the data from disk making
up the indexes or tables needed for the failing query. As in the disk
reported an error which the operating system then reported to SQLite.

Note that modern disks are not infallible. For example regular consumer 2TB
drives say they will return a read error about once every 12TB of reads.

You can usually interrogate the drive itself to find out out what it thinks.
Ensure SMART is turned on in the bios, and then get the appropriate SMART
tools for your operating system. Amongst the information they will show you
is how many sectors are dead, how many are pending relocation, power on
hours etc.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1auDAACgkQmOOfHg372QSrzwCeJ1Ik1joAKrWfyzpONQVCVCY/
SyYAnjDpkN6iDhKwha9dGiLMYkcMhWOA
=0hiM
-----END PGP SIGNATURE-----

David Hughes

unread,
Feb 16, 2011, 11:59:54 AM2/16/11
to python...@googlegroups.com
On 15/02/2011 17:30, Roger Binns wrote:

> Those errors only come from the SQLite core

> Chances are that SQLite was unable to read some of the data from disk making
> up the indexes or tables needed for the failing query. As in the disk
> reported an error which the operating system then reported to SQLite.
>
> Note that modern disks are not infallible. For example regular consumer 2TB
> drives say they will return a read error about once every 12TB of reads.
>
> You can usually interrogate the drive itself to find out out what it thinks.
> Ensure SMART is turned on in the bios, and then get the appropriate SMART
> tools for your operating system. Amongst the information they will show you
> is how many sectors are dead, how many are pending relocation, power on
> hours etc.

Thanks for that useful information. I have since discovered that the
database is on a USB flash drive so I am arranging to have it replaced.

Reply all
Reply to author
Forward
0 new messages