On Apr 10, 2010, at 10:21 AM, Rutger Hofman wrote:

> [I first posted this on the Trac user list. There, I was referred to  
> the
> sqlite mailing lists.]
>
> I am running 3 trac instances on a FreeBSD server; trac 0.11b, sqlite3
> 3.4.1, pysqlite-2.3.5. More or less simultaneously (at least within a
> few days) all three trac databases got corrupted. You can check for
> yourself at e.g. http://trac.rfidguardian.org:8000/trac-0-11b, it  
> shows
> a python stack trace with at bottom a database disk image is  
> malformed.
>
> When I have a look at one of the sqlite3 databases, the header block  
> is
> obviously corrupted:
>
> 000  53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00 SQLite format 3.
> 010  04 00 01 01 00 40 20 20 00 01 D5 6D 00 00 00 00 .....@  ...m....
> 020  00 00 24 AA 00 00 04 9A 38 32 2E 39 35 2E 31 35 ..$.....82.95.15
> 030  37 2E 32 31 20 2D 20 2D 20 5B 30 36 2F 41 70 72 7.21 - - [06/Apr
> 040  2F 32 30 31 30 20 31 34 3A 33 30 3A 31 30 5D 20 /2010 14:30:10]
> 050  22 47 45 54 20 2F 74 72 61 63 2D 30 2D 31 31 62 "GET /trac-0-11b
> 060  20 48 54 54 50 2F 31 2E 31 22 20 35 30 30 20 2D  HTTP/1.1" 500 -
> 070  0A 74 72 75 6E 6B 2F 73 72 63 2F 75 69 2F 73 74 .trunk/src/ui/st
> 080  64 69 6E 20 48 54 54 50 2F 31 2E 31 22 20 35 30 din HTTP/1.1" 50
> 090  30 20 2D 0A 39 39 34 20 48 54 54 50 2F 31 2E 31 0 -.994 HTTP/1.1
> 0A0  22 20 35 30 30 20 2D 0A 2E 30 22 20 35 30 30 20 " 500 -..0" 500
> 0B0  2D 0A 20 35 30 30 20 2D 0A 54 50 2F 31 2E 30 22 -. 500 -.TP/1.0"
> 0C0  20 35 30 30 20 2D 0A 22 20 35 30 30 20 2D 0A 50  500 -." 500 -.P
> 0D0  2F 31 2E 31 22 20 35 30 30 20 2D 0A 31 2E 30 22 /1.1" 500 -.1.0"
> 0E0  20 35 30 30 20 2D 0A 30 30 39 2D 30 37 2D 32 34  500 -.009-07-24
> 0F0  54 32 30 25 33 41 35 30 25 33 41 35 35 5A 25 32 T20%3A50%3A55Z%2

All of that text in the header that looks like Apache logfile entires  
- none of that should be in the first page of the database file.  Nor  
does that text appear to be in a format that would appear anywhere in  
a valid SQLite database.  So I'm guessing that some other process has  
decided to open the SQLite database and overwrite it with log file  
information.

What does Trac call its database?  something.db?  Lots of programs use  
the ".db" suffix.  Perhaps one of these other programs mistook the  
SQLite database for a file in a different format and tried to  
overwrite it with new information that is in some other (non-SQLite)  
format.  Just a guess.

You are unlikely to be able to recover any useful content from a  
database that has been so thoroughly trashed.



>
> E.g. bytes 0x01c..0x01f should give the database size in 1K pages;  
> that
> should be 14080000 / 1024 = 13750 = 0x000035b6. It is 0x000000. And
> other fields are as obviously broken.
>
> What can be the cause of this simultaneous corruption? Is there a  
> way to
> recover the database?
>
> Alas, we had a misunderstanding w/ our web host on backup policy; he
> turns out to keep multiple versions of the current files, but no  
> rollback...
>
> Thanks,
>
> Rutger Hofman
> VU Amsterdam
> http://www.rfidguardian.org
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

D. Richard Hipp
d...@hwaci.com



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

Reply via email to