|
|||||||
|
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community today, you will have fewer ads, access to post topics, communicate privately with other members, respond to polls, upload content and access many other special features. If you have any problems with the registration process or your account login, please contact us. Hint: Don't have time to visit us daily? Subscribe to our main RSS feed to receive our frontpage posts at your convenience. |
| Calibre Calibre is an open-source library manager to view, convert and catalog e-books. Cross-platform (Linux, Windows and OS X) |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Member
![]()
Posts: 13
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 |
|
|
|
|
|
#2 |
|
Creator of calibre, Ph.D.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 10,082
Karma: 41079
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
|
In a terminal run the following command:
calibredb list and post the output
__________________
Get calibre |
|
|
|
|
|
#3 |
|
Member
![]()
Posts: 13
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 |
|
|
|
|
|
#4 |
|
Creator of calibre, Ph.D.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 10,082
Karma: 41079
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
|
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
__________________
Get calibre |
|
|
|
|
|
#5 |
|
Member
![]()
Posts: 13
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? |
|
|
|
|
|
#6 |
|
Member
![]()
Posts: 13
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 02:52 PM. |
|
|
|
|
|
#7 |
|
Creator of calibre, Ph.D.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 10,082
Karma: 41079
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
|
Use the full path to sqlite3,
"C:\Program Files\whatever\sqlite3.exe" metadata.db .dump > dump.sql
__________________
Get calibre |
|
|
|
|
|
#8 |
|
Member
![]()
Posts: 13
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 |
|
|
|
|
|
#9 |
|
Member
![]()
Posts: 13
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 |
|
Creator of calibre, Ph.D.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 10,082
Karma: 41079
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
|
Just delete any lines that refer to sqlite_sequence and hopefully that will allow it to work
__________________
Get calibre |
|
|
|
|
|
#11 |
|
Member
![]()
Posts: 13
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 |
|
|
|
|
|
#12 |
|
Creator of calibre, Ph.D.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 10,082
Karma: 41079
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
|
Hmm can you attach your metadata.db to this thread. I'll take a look at it.
__________________
Get calibre |
|
|
|
|
|
#13 |
|
Member
![]()
Posts: 13
Karma: 10
Join Date: Oct 2009
Device: iPhone with Stanza
|
I have attached the db file - you'll need to rename it.
|
|
|
|
|
|
#14 |
|
Member
![]()
Posts: 13
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.
|
|
|
|
|
|
#15 |
|
Creator of calibre, Ph.D.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
Posts: 10,082
Karma: 41079
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
|
Try the attached
__________________
Get calibre |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Calibre errors on one PC, not another | Katelyn | Calibre | 12 | 07-13-2009 10:09 PM |
| Errors and Errors... | uncultured | Kindle Troubleshooting | 7 | 03-11-2009 06:11 PM |
| Conversion errors (encoding?) | Dave Berk | Calibre | 3 | 11-25-2008 03:23 PM |
| HTTP 400 Errors | Alexander Turcic | Feedback | 1 | 01-24-2003 08:09 AM |