Re: [sqlite] Error: database disk image is malformed

2015-01-05 Thread Neo Anderson
> Are you using the same sqlite3 binary for both operations?
>
> If a database has a table definition that an older version of SQLite does not 
> understand, it will sometimes give this error. If you’re using a newer 
> version of SQLite to dump/load the files, there will be no error.
>

Yes, I am using the latest sqlite3 binary (version 3.8.7.4) for both 
operations.  
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Error: database disk image is malformed

2015-01-05 Thread Jay Kreibich


On Jan 4, 2015, at 3:31 AM, Neo Anderson  wrote:

> I have a customer database which appears corrupt. When I run sqlite3 mydb and 
> PRAGMA integrity_check I got (literally, no other lines):
> 
> Error: database disk image is malformed
> 
> However, I can .dump and .read to create a new database. The new database 
> works fine and the most surprising result is the old and new database files 
> are exactly of the same size. But running cmp old.db new.db gave me:
> 
> differ: char 27, line 1
> 
> My question is why .dump works but sqlite3 thinks the file is corrupt. 
> Attached please find old.db and new.db in a zip package. Hope this can help 
> improve sqlite. 


Are you using the same sqlite3 binary for both operations?

If a database has a table definition that an older version of SQLite does not 
understand, it will sometimes give this error.  If you’re using a newer version 
of SQLite to dump/load the files, there will be no error.

 -j

--  
Jay A. Kreibich < J A Y @ K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it, but showing 
it to the wrong people has the tendency to make them feel uncomfortable." -- 
Angela Johnson





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


Re: [sqlite] Error: database disk image is malformed

2015-01-05 Thread Eduardo Morras
On Sun, 4 Jan 2015 17:31:14 +0800
Neo Anderson  wrote:

> I have a customer database which appears corrupt. When I run sqlite3
> mydb and PRAGMA integrity_check I got (literally, no other lines):
> 
> Error: database disk image is malformed
> 
> However, I can .dump and .read to create a new database. The new
> database works fine and the most surprising result is the old and new
> database files are exactly of the same size. But running cmp old.db
> new.db gave me:
> 
> differ: char 27, line 1
> 
> My question is why .dump works but sqlite3 thinks the file is
> corrupt. Attached please find old.db and new.db in a zip package.
> Hope this can help improve sqlite.
> 

Char 27 is on Sqlite3 header. It tracks the file change counter. When you .dump 
the counter is increased in your old.db by 1, that's the difference. Both files 
has the same corruption.

The mail list has attachment set to off, so they're deleted before remailed.

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


Re: [sqlite] Error: database disk image is malformed

2012-08-17 Thread Richard Hipp
On Fri, Aug 17, 2012 at 8:08 AM, Tal Tabakman wrote:

>
> 7. file system is NFS.
>

Consider using the "unix-dotfile" VFS instead of the standard "unix" VFS.
(Add the string "unix-dotfile" as the 4th argument to sqlite3_open_v2().)

The unix-dotfile VFS will use dot-file locking instead of posix advisory
locking.  The unix-dotfile VFS will usually work better on NFS.

The down side of unix-dotfile is that will cut concurrency, but it sounds
like you are not using concurrency anyhow.  Also, if a process crashes, it
might leave a stale dot-file lock that you'll need to clear manually.


-- 
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] Error: database disk image is malformed

2012-08-16 Thread Simon Slavin

On 16 Aug 2012, at 10:14pm, Tal Tabakman  wrote:

> Answering your question below,
> 
> yes , I believe  that the costumer is using network

You can read section 6.0 of



to learn some of the problems involved.  If you need any further help from us 
then I'm sorry but we have more questions:

Which network file protocol is being used.  NFS ?  SMB ?

What OS are all the computers involved running ?

Are all accesses across a network or is one app accessing the file as a local 
file and the other accessing it across the network ?

The number of possible causes of this error message is much bigger when a 
network is involved, and some of the problems are not the way you might think 
they are.  For example, having one computer access the file locally and the 
other across a network gives /worse/ results then if they are both accessing 
across a network.
Would it be possible to do some testing when the database is on a local drive ? 
 It might be that all problems instantly vanish if you did this, which would 
give you a clear sign of the cause of the problem.

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


Re: [sqlite] Error: database disk image is malformed

2012-08-16 Thread Brandon Pimenta
Have you tried reinstalling SQLite?

On Thu, Aug 16, 2012 at 2:52 PM, Tal Tabakman wrote:

> Error: database disk image is malformed
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Error: database disk image is malformed

2012-08-16 Thread Simon Slavin

On 16 Aug 2012, at 6:52pm, Tal Tabakman  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
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Error: database disk image is malformed

2012-08-16 Thread David Barrett

On 08/16/2012 11:19 AM, Richard Hipp wrote:

On Thu, Aug 16, 2012 at 1:52 PM, Tal Tabakman 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
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Error: database disk image is malformed

2012-08-16 Thread Richard Hipp
On Thu, Aug 16, 2012 at 1:52 PM, Tal Tabakman 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
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users