Figuring out the Cause of SQLite Error 11: Corrupt Database

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Figuring out the Cause of SQLite Error 11: Corrupt Database

Esplin, Justin
Howdy,


We are seeing a couple worrisome (and not very informative) messages repeatedly in our logs:

            SQLite error (11): database corruption at line 55472 of [cf538e2783]

SQLite error (11): database corruption at line 55514 of [cf538e2783]

I have been looking around the web for a few days to try and figure out how to diagnose this, but have come up empty-handed. This is occurring on various Windows machines, though they appear to functional normally before, during and after these errors are written to the logs. It was by chance that we stumbled across these errors in the logs.

Is there a way to know what the lines are that the error messages are complaining about? Is there a chance that the corruption is of a nominal variety or that it is able to automatically recover, which is why it appears to continue to function normally?

I also did my best to post a question on SO which you can see here<https://stackoverflow.com/questions/46180021/how-to-debug-the-cause-for-sqliteerror11-database-corruption?noredirect=1#comment79326475_46180021>.

Thanks in advance for any help you may have to offer.



Justin Esplin
Applications Dev II | Xactware

Phone: +1.801.932.8039

[Verisk Insurance Solutions]<http://www.verisk.com/insurance/>

[Forbes 2016 Most Innovative Companies]<http://www.forbes.com/innovative-companies/list/#tab:rank_search:verisk>[America's Best Mid-Size Employers]<https://www.forbes.com/best-midsize-employers/list/#tab:rank_search:verisk>[Great Place to Work]<http://reviews.greatplacetowork.com/verisk-analytics>

verisk.com/xactware<http://verisk.com/xactware> | vCard<http://www.dynasend.com/signatures/vcard/jlesplin-at-verisk.com.vcf> | Map<https://www.google.com/maps/place/1100+W+Traverse+Pkwy,+Lehi,+UT+84043/@40.4350195,-111.8709977,17z/data=!3m1!4b1!4m2!3m1!1s0x87528004da6ecd33:0x621596ddfddd2474?hl=en> | Email<mailto:[hidden email]>

[Blog]<http://www.verisk.com/blog>[LinkedIn]<https://www.linkedin.com/company/verisk-insurance-solutions>[Twitter]<https://twitter.com/veriskinsurance>



________________________________

This email is intended solely for the recipient. It may contain privileged, proprietary or confidential information or material. If you are not the intended recipient, please delete this email and any attachments and notify the sender of the error.

________________________________

Xactware's opt-in mailing list allows you to receive Xactware News that is of interest to you. Visit my.xactware.com today to join or to update your email preferences!
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Figuring out the Cause of SQLite Error 11: Corrupt Database

Richard Hipp-3
On 9/14/17, Esplin, Justin <[hidden email]> wrote:

>
> We are seeing a couple worrisome (and not very informative) messages
> repeatedly in our logs:
>
>             SQLite error (11): database corruption at line 55472 of
> [cf538e2783]
>
> SQLite error (11): database corruption at line 55514 of [cf538e2783]
>
> I have been looking around the web for a few days to try and figure out how
> to diagnose this, but have come up empty-handed. This is occurring on
> various Windows machines, though they appear to functional normally before,
> during and after these errors are written to the logs. It was by chance that
> we stumbled across these errors in the logs.
>
> Is there a way to know what the lines are that the error messages are
> complaining about? Is there a chance that the corruption is of a nominal
> variety or that it is able to automatically recover, which is why it appears
> to continue to function normally?

Both errors are badly formatted b-tree pages in the database file.
These both indicate serious database corruption.  You should be able
to verify the corruption by running "PRAGMA quick_check".

Is the database file located on a network filesystem?
--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Figuring out the Cause of SQLite Error 11: Corrupt Database

Esplin, Justin
I was able to access a computer which encountered these errors, about 10 minutes after they occurred. I ran "PRAGMA integrity_check" and it returned "ok". How/why would this have changed? I verified the user did not re-install our app or otherwise reconfigure the database.

Justin Esplin
Applications Dev II
Verisk Insurance Solutions - Xactware
Phone: +1.801.932.8039
[hidden email]
http://www.verisk.com/insurance/



-----Original Message-----
From: sqlite-users [mailto:[hidden email]] On Behalf Of Richard Hipp
Sent: Friday, September 15, 2017 4:43 AM
To: SQLite mailing list <[hidden email]>
Cc: Sines, Matt <[hidden email]>
Subject: Re: [sqlite] Figuring out the Cause of SQLite Error 11: Corrupt Database

On 9/14/17, Esplin, Justin <[hidden email]> wrote:

>
> We are seeing a couple worrisome (and not very informative) messages
> repeatedly in our logs:
>
>             SQLite error (11): database corruption at line 55472 of
> [cf538e2783]
>
> SQLite error (11): database corruption at line 55514 of [cf538e2783]
>
> I have been looking around the web for a few days to try and figure
> out how to diagnose this, but have come up empty-handed. This is
> occurring on various Windows machines, though they appear to
> functional normally before, during and after these errors are written
> to the logs. It was by chance that we stumbled across these errors in the logs.
>
> Is there a way to know what the lines are that the error messages are
> complaining about? Is there a chance that the corruption is of a
> nominal variety or that it is able to automatically recover, which is
> why it appears to continue to function normally?

Both errors are badly formatted b-tree pages in the database file.
These both indicate serious database corruption.  You should be able to verify the corruption by running "PRAGMA quick_check".

Is the database file located on a network filesystem?
--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
https://urldefense.proofpoint.com/v2/url?u=http-3A__mailinglists.sqlite.org_cgi-2Dbin_mailman_listinfo_sqlite-2Dusers&d=DwIGaQ&c=birp9sjcGzT9DCP3EIAtLA&r=e6PxbQq9NdAJUZWHeJFpfhuVEDXWOo3XEghP1Z1arEs&m=mnCE15jLM9kRb8KAQTx351Gp9e63RWkXHyD_lTNVZnQ&s=xcQp6UKYF6Nj3TZlT_tEqPNPSLmPlX3WUZ0wtKyEvzc&e=

________________________________

This email is intended solely for the recipient. It may contain privileged, proprietary or confidential information or material. If you are not the intended recipient, please delete this email and any attachments and notify the sender of the error.

________________________________

Xactware's opt-in mailing list allows you to receive Xactware News that is of interest to you. Visit my.xactware.com today to join or to update your email preferences!
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Figuring out the Cause of SQLite Error 11: Corrupt Database

Richard Hipp-3
On 9/15/17, Esplin, Justin <[hidden email]> wrote:
> I was able to access a computer which encountered these errors, about 10
> minutes after they occurred. I ran "PRAGMA integrity_check" and it returned
> "ok". How/why would this have changed? I verified the user did not
> re-install our app or otherwise reconfigure the database.

You have not yet revealed to us:

(1) What operating system you are running on, including the specific
version number
(2) What specific version number of SQLite that you are running
(3) What compile-time time options you are using
(4) What filesystem the database is stored on.

All of these things are important.

The only other time we have seen a problem like this, it turned out to
be a bug in the file cache of the OS kernel, not in SQLite.  Just
because SQLite is the software reporting the problem, does not
necessarily mean that SQLite is the cause of the problem.  Details are
important.  Please provide as much context as possible.
--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Figuring out the Cause of SQLite Error 11: Corrupt Database

Esplin, Justin
(1) It is possible that this has occurred on other versions of Windows, but I can only confirm that it has occurred on machines running Windows 10. The most recent cited occurrence was on Windows 10 Enterprise, version 1607, OS Build 14393.1593
(2) We are using version 1.0.98.1.
(3) We aren't compiling SQLite so I don't think we are setting any compile-time options. We are using the following nuget package defined in our packages.config:
        <package id="System.Data.SQLite.Core" version="1.0.98.1" targetFramework="net452" />
(4) NTFS

Some other info that may or may not be useful:
- We are also seeing many occurrences of SQLite Error (5): Database is locked
- I assume they are pulled down as dependencies of the nuget package, but I am also seeing SQLiteInterop.dll v1.0.61.0, and Mono.Data.Sqlite.dll v1.0.61.0 in the bin of our solution.

Thanks,

Justin Esplin
Applications Dev II
Verisk Insurance Solutions - Xactware
Phone: +1.801.932.8039
[hidden email]
http://www.verisk.com/insurance/



-----Original Message-----
From: sqlite-users [mailto:[hidden email]] On Behalf Of Richard Hipp
Sent: Sunday, September 17, 2017 2:45 AM
To: SQLite mailing list <[hidden email]>
Subject: Re: [sqlite] Figuring out the Cause of SQLite Error 11: Corrupt Database

On 9/15/17, Esplin, Justin <[hidden email]> wrote:
> I was able to access a computer which encountered these errors, about
> 10 minutes after they occurred. I ran "PRAGMA integrity_check" and it
> returned "ok". How/why would this have changed? I verified the user
> did not re-install our app or otherwise reconfigure the database.

You have not yet revealed to us:

(1) What operating system you are running on, including the specific version number
(2) What specific version number of SQLite that you are running
(3) What compile-time time options you are using
(4) What filesystem the database is stored on.

All of these things are important.

The only other time we have seen a problem like this, it turned out to be a bug in the file cache of the OS kernel, not in SQLite.  Just because SQLite is the software reporting the problem, does not necessarily mean that SQLite is the cause of the problem.  Details are important.  Please provide as much context as possible.
--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
https://urldefense.proofpoint.com/v2/url?u=http-3A__mailinglists.sqlite.org_cgi-2Dbin_mailman_listinfo_sqlite-2Dusers&d=DwIGaQ&c=birp9sjcGzT9DCP3EIAtLA&r=e6PxbQq9NdAJUZWHeJFpfhuVEDXWOo3XEghP1Z1arEs&m=07hq1KvkKn5WsEO9IVKerCbsYRYSpRRg-YhyIYSzxsA&s=cbIQ6kcghDi91HmDs_KkQOhHP7GmacRSYcgofZ60EFs&e=

________________________________

This email is intended solely for the recipient. It may contain privileged, proprietary or confidential information or material. If you are not the intended recipient, please delete this email and any attachments and notify the sender of the error.

________________________________

Xactware's opt-in mailing list allows you to receive Xactware News that is of interest to you. Visit my.xactware.com today to join or to update your email preferences!
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users