MobileRead Forums
Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Welcome to the MobileRead Forums.

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.

Notices

Calibre Calibre is an open-source library manager to view, convert and catalog e-books. Cross-platform (Linux, Windows and OS X)

Reply
 
Thread Tools Search this Thread Display Modes
Old 10-04-2009, 01:16 PM   #1
christinerutter
Member
christinerutter began at the beginning.
 
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
christinerutter is offline   Reply With Quote
Old 10-04-2009, 02:06 PM   #2
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.
 
kovidgoyal's Avatar
 
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
kovidgoyal is offline   Reply With Quote
Old 10-04-2009, 02:09 PM   #3
christinerutter
Member
christinerutter began at the beginning.
 
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
christinerutter is offline   Reply With Quote
Old 10-04-2009, 02:15 PM   #4
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.
 
kovidgoyal's Avatar
 
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
kovidgoyal is offline   Reply With Quote
Old 10-04-2009, 02:27 PM   #5
christinerutter
Member
christinerutter began at the beginning.
 
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?
christinerutter is offline   Reply With Quote
Old 10-04-2009, 02:39 PM   #6
christinerutter
Member
christinerutter began at the beginning.
 
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.
christinerutter is offline   Reply With Quote
Old 10-04-2009, 03:27 PM   #7
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.
 
kovidgoyal's Avatar
 
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
kovidgoyal is offline   Reply With Quote
Old 10-04-2009, 06:31 PM   #8
christinerutter
Member
christinerutter began at the beginning.
 
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
christinerutter is offline   Reply With Quote
Old 10-04-2009, 07:23 PM   #9
christinerutter
Member
christinerutter began at the beginning.
 
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.
christinerutter is offline   Reply With Quote
Old 10-05-2009, 02:32 PM   #10
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.
 
kovidgoyal's Avatar
 
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
kovidgoyal is offline   Reply With Quote
Old 10-05-2009, 04:38 PM   #11
christinerutter
Member
christinerutter began at the beginning.
 
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
christinerutter is offline   Reply With Quote
Old 10-05-2009, 04:56 PM   #12
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.
 
kovidgoyal's Avatar
 
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
kovidgoyal is offline   Reply With Quote
Old 10-05-2009, 05:46 PM   #13
christinerutter
Member
christinerutter began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Oct 2009
Device: iPhone with Stanza
I have attached the db file - you'll need to rename it.
Attached Files
File Type: txt metadata.txt (880.0 KB, 19 views)
christinerutter is offline   Reply With Quote
Old 10-05-2009, 05:48 PM   #14
christinerutter
Member
christinerutter began at the beginning.
 
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.
Attached Files
File Type: zip dump.zip (114.8 KB, 13 views)
christinerutter is offline   Reply With Quote
Old 10-05-2009, 08:03 PM   #15
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.kovidgoyal is an enigma wrapped up in a mystery.
 
kovidgoyal's Avatar
 
Posts: 10,082
Karma: 41079
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
Try the attached
Attached Files
File Type: zip metadata.zip (162.2 KB, 14 views)
__________________
Get calibre
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Forum Jump

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


All times are GMT -4. The time now is 12:50 PM.


MobileRead.com is a privately owned, operated and funded community.