Error: database disk image is malformed

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

Error: database disk image is malformed

Tal Tabakman-2
Hi.
we are writing an application that in runtime produces a sqlite database.
we are using this set of pragmas:( and also the CEROD extension for
compression purposes).
"PRAGMA cache_size=10000;"
"PRAGMA synchronous = 0;";
"PRAGMA temp_store=MEMORY";
"PRAGMA journal_mode = MEMORY;"
"PRAGMA count_changes=OFF;"
"PRAGMA locking_mode=EXCLUSIVE;"
"PRAGMA page_size = 8192;"
"PRAGMA cache_size=10000;"

from time to time when we are trying to analyze  created DB we get via some
SELECT stmts and the c API (see below)

int execSql(sqlite3_stmt *stmt) throw(SQLException) {
        char *zErrMsg = 0;
        int rc = sqlite3_step(stmt);
        if (rc != SQLITE_DONE && rc != SQLITE_ROW && rc != SQLITE_OK) {
  std::ostringstream extendedErrCode;
  extendedErrCode << " Extended Error code: " <<
 sqlite3_extended_errcode(m_db);
*  throw SQLException(string("Could not execute SQL statement. Error: ")
+sqlite3_errmsg(m_db); + extendedErrCode.str());*
        }
        return rc;
    }


we get the following error:*Error: database disk image is malformed
Extended Error code: 11*
*
*
*what can cause this error ? how can I recover from it ? *
*please assist !*
*Tal*
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Error: database disk image is malformed

Richard Hipp-3
On Thu, Aug 16, 2012 at 1:52 PM, Tal Tabakman <[hidden email]>wrote:

> Hi.
> we are writing an application that in runtime produces a sqlite database.
>
> we get the following error:*Error: database disk image is malformed
> Extended Error code: 11*
> *
> *
> *what can cause this error ? how can I recover from it ? *
>

Have you read the http://www.sqlite.org/howtocorrupt.html document?

Have you tried running your application using valgrind?

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Error: database disk image is malformed

David Barrett-4
On 08/16/2012 11:19 AM, Richard Hipp wrote:

> On Thu, Aug 16, 2012 at 1:52 PM, Tal Tabakman <[hidden email]>wrote:
>
>> Hi.
>> we are writing an application that in runtime produces a sqlite database.
>>
>> we get the following error:*Error: database disk image is malformed
>> Extended Error code: 11*
>> *
>> *
>> *what can cause this error ? how can I recover from it ? *
>>
>
> Have you read the http://www.sqlite.org/howtocorrupt.html document?
>
> Have you tried running your application using valgrind?

Also, you might read this thread:

http://comments.gmane.org/gmane.comp.db.sqlite.general/71856

I'm having this same issue on a very active 30GB sqlite database.  The
main process has no trouble whatsoever, but when I attempt to
simultaneously access the database via the sqlite3 command-line tool, it
occasionally reports a corrupt database.  Often re-running the command
works, and it always works when I shut down the main process.
Similarly, analyzing an idle database shows it's never actually corrupt.

-david
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Error: database disk image is malformed

Simon Slavin-3
In reply to this post by Tal Tabakman-2

On 16 Aug 2012, at 6:52pm, Tal Tabakman <[hidden email]> wrote:

> we get the following error:*Error: database disk image is malformed
> Extended Error code: 11*

Is network or remote access involved in any part of this ?  Or is the database file on the hard disk of the computer running the app ?

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Error: database disk image is malformed

Brandon Pimenta
In reply to this post by Tal Tabakman-2
Have you tried reinstalling SQLite?

On Thu, Aug 16, 2012 at 2:52 PM, Tal Tabakman <[hidden email]>wrote:

> Error: database disk image is malformed
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users