10-04-2009, 12:16 PM | #1 |
Member
Posts: 16
Karma: 10
Join Date: Oct 2009
Device: iPhone with Stanza
|
metadata.db errors
Hi, I have been using Calibre for a few weeks and have been adding my books and all has been fine until today.
I got notification of an update to 6.16 (or thereabouts) which I did. Since then I got database errors so I thought I would close the app and reopen it, now it won't read the database. Comes up with Bad Database Location. I have confirmed the location and chose the location again with Calibre and it just shuts down. Can I do anything to recover the database I have put in around 400 books which has taken me a good few weeks work. Thanks |
10-04-2009, 01:06 PM | #2 |
creator of calibre
Posts: 43,852
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
In a terminal run the following command:
calibredb list and post the output |
Advert | |
|
10-04-2009, 01:09 PM | #3 |
Member
Posts: 16
Karma: 10
Join Date: Oct 2009
Device: iPhone with Stanza
|
calibredb list
Traceback (most recent call last):
File "cli.py", line 620, in <module> File "cli.py", line 617, in main File "cli.py", line 233, in command_list File "cli.py", line 125, in get_db File "calibre\library\database2.pyo", line 442, in __init__ File "calibre\library\database2.pyo", line 312, in refresh File "calibre\library\sqlite.pyo", line 170, in run calibre.library.sqlite.DatabaseException: database disk image is malformed RemoteTraceback (most recent call last): File "calibre\library\sqlite.pyo", line 141, in run File "calibre\library\sqlite.pyo", line 100, in get DatabaseError: database disk image is malformed |
10-04-2009, 01:15 PM | #4 |
creator of calibre
Posts: 43,852
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Ah looks like your database file has gotten corrupted somehow. There are ways you can try to restore it. Install the sqlite command line tool from
http://www.sqlite.org/sqlite-3_6_18.zip then run the command sqlite3 metadata.db > dump.sql (metadata.db is the sqlite calibre database it will be in the calibre library folder) This command (if it succeeds) will create a file called dump.sql Run ren metadata.db metadata.db.orig && sqlite3 metadata.db < dump.sql |
10-04-2009, 01:27 PM | #5 |
Member
Posts: 16
Karma: 10
Join Date: Oct 2009
Device: iPhone with Stanza
|
Hi,
I have sqlite installed. But it comes up with C:\>sqlite3 metadata.db >dump.sql 'sqlite3' is not recognized as an internal or external command, operable program or batch file. Do I need to run it from the sql lite 3 shell? |
Advert | |
|
10-04-2009, 01:39 PM | #6 |
Member
Posts: 16
Karma: 10
Join Date: Oct 2009
Device: iPhone with Stanza
|
I ran it from the C:\Program Files\SQLite ODBC Driver folder and it just sat there at the comand prompt - no msg or anything - a dump.sql file has been created - but its
"SQLite version 3.6.14.2 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> " And thats it. Last edited by christinerutter; 10-04-2009 at 01:52 PM. |
10-04-2009, 02:27 PM | #7 |
creator of calibre
Posts: 43,852
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use the full path to sqlite3,
"C:\Program Files\whatever\sqlite3.exe" metadata.db .dump > dump.sql |
10-04-2009, 05:31 PM | #8 |
Member
Posts: 16
Karma: 10
Join Date: Oct 2009
Device: iPhone with Stanza
|
Thanks for coming back to me. The first bit now worked, but I get this when I do the next bit.
N:\Library>ren metadata.db metadata.db.old && "c:\program files\sqlite odbc driv er\sqlite3.exe" metadata.db < dump.sql SQL error near line 88: no such table: sqlite_sequence SQL error near line 89: no such table: sqlite_sequence SQL error near line 2887: no such function: concat I know its slightly different from yours with a .old as opposed to a .orig, but what else am I doing wrong? Thanks |
10-04-2009, 06:23 PM | #9 |
Member
Posts: 16
Karma: 10
Join Date: Oct 2009
Device: iPhone with Stanza
|
These are lines 88 & 89
DELETE FROM sqlite_sequence; INSERT INTO "sqlite_sequence" VALUES('books',267); I found a few entries which relate to concat, but with no obvious way to get to line 2887, I wasn't going to count it. |
10-05-2009, 01:32 PM | #10 |
creator of calibre
Posts: 43,852
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Just delete any lines that refer to sqlite_sequence and hopefully that will allow it to work
|
10-05-2009, 03:38 PM | #11 |
Member
Posts: 16
Karma: 10
Join Date: Oct 2009
Device: iPhone with Stanza
|
I have deleted the 2 lines and tried to run it again and got this
N:\Library>ren metadata.db metadata.db.2nd && "c:\program files\sqlite odbc driv er\sqlite3.exe" metadata.db < dump.sql SQL error near line 1: near "BEGIN": syntax error SQL error near line 2885: no such function: concat SQL error near line 2905: cannot commit - no transaction is active |
10-05-2009, 03:56 PM | #12 |
creator of calibre
Posts: 43,852
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Hmm can you attach your metadata.db to this thread. I'll take a look at it.
|
10-05-2009, 04:46 PM | #13 |
Member
Posts: 16
Karma: 10
Join Date: Oct 2009
Device: iPhone with Stanza
|
I have attached the db file - you'll need to rename it.
|
10-05-2009, 04:48 PM | #14 |
Member
Posts: 16
Karma: 10
Join Date: Oct 2009
Device: iPhone with Stanza
|
This is the dump.sql file - its original bar the 2 lines which are above.
|
10-05-2009, 07:03 PM | #15 |
creator of calibre
Posts: 43,852
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Try the attached
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ePub Errors | mrbillb | ePub | 1 | 08-11-2010 08:24 PM |
Validation Errors | luthar28 | ePub | 13 | 08-10-2010 12:24 PM |
download errors | saxophone | Amazon Kindle | 2 | 03-14-2010 10:05 AM |
Calibre errors on one PC, not another | Katelyn | Calibre | 12 | 07-13-2009 09:09 PM |
Errors and Errors... | uncultured | Amazon Kindle | 7 | 03-11-2009 05:11 PM |