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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-23-2011, 10:12 AM   #1
AhShoo5n
Junior Member
AhShoo5n began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Aug 2011
Device: Kindle 3
invalid library ... UnicodeDecodeError: 'utf8' codec can't ...

Hi all,

I am a complete newbie. Please correct me if I'm posting in the wrong place or committing some failure of etiquette (I have tried to look around, but there's a lot to take in).

I've just spent (possibly wasted) the last few days, importing the bulk of my ebook collection into Calibre. Now Calibre appears to consider the library that I created is 'invalid' (see error message and traceback below ... BTW, why not make the error dialog box text selectable?).

This appears to be a character encoding problem, but I'm not aware of any changes to my UTF8-based system.

OTOH I may have accidentally failed to close Calibre before a reboot. Could this have caused a single byte error?

Any ideas on diagnosis and recovery would be much appreciated. I'm not sure that I can face re-importing all the data files and reconstructing all the metadata.

P.S. I'm running on:

Linux 2.6.35-30-generic #56-Ubuntu SMP Mon Jul 11 20:01:08 UTC 2011 x86_64 GNU/Linux

===========
Error Message
===========
invalid library already exists at /foo/bar/baz, delete it before trying to move the existing library.

Error 'utf8' codec can't decode bytes in position 58-59: invalid continuation byte.

Traceback (most recent call last):
File "site-packages/calibre/gui2/wizard/__init__.py", line 567, in move_library
File "site-packages/calibre/library/database2.py", line 216, in __init__
File "site-packages/calibre/library/database2.py", line 494, in initialize_dynamic
File "site-packages/calibre/library/caches.py", line 937, in refresh
File "site-packages/calibre/library/sqlite.py", line 311, in run
File "site-packages/calibre/library/sqlite.py", line 293, in __init__
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 58-59: invalid continuation byte
==
AhShoo5n is offline   Reply With Quote
Old 08-23-2011, 10:20 AM   #2
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
It looks as if you might have a corrupt calibre metadata.db database in your calibre library folder. The good news is that if you have then Calibre can rebuild a good one from data stored with the current ebooks files in its library structure.

However before recommending that you go down that route it is probably worth waiting for a comment from Kovid to confirm what is likely to be wrong.
itimpi is offline   Reply With Quote
Advert
Old 08-23-2011, 10:54 AM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That error message is a red herring. Its is happening when you are trying to move the library, which tells me the error has to do with some non UTF-8 encoded path on your system. Move your library using file system tools instead and point calibre to the new location.
kovidgoyal is offline   Reply With Quote
Old 08-23-2011, 11:29 AM   #4
AhShoo5n
Junior Member
AhShoo5n began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Aug 2011
Device: Kindle 3
Thumbs up

Quote:
Originally Posted by kovidgoyal View Post
That error message is a red herring. Its is happening when you are trying to move the library, which tells me the error has to do with some non UTF-8 encoded path on your system. Move your library using file system tools instead and point calibre to the new location.
Thank you so much for the quick response.

I'll try what you recommend, but I have not moved the library. It is still in the place it was originally created.

When you say "Move your library using file system tools instead" ... instead of what? I mostly use bash (and very rarely nautilus) to move files. I'm not aware that any other tool, including Calibre, has moved the library or the metadata db.

OTOH, the filesystem itself is encrypted and has been re-mounted, so I imagine it is possible that the disk utility slipped a non-UTF8 character in somewhere, e.g. in the disk label used for auto-mounting.
AhShoo5n is offline   Reply With Quote
Old 08-23-2011, 11:32 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
According to that error message, the error is happening during a move_library triggered from the welcome wizard.
kovidgoyal is offline   Reply With Quote
Advert
Old 08-23-2011, 11:49 AM   #6
AhShoo5n
Junior Member
AhShoo5n began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Aug 2011
Device: Kindle 3
Ah, that explains it ... thanks.

I used the wizard, because the original error message prompted me to suggest a different path/name ... and I still haven't found a place (via the GUI or by grepping the config files) where the path to the library is set/defined.

Does such a thing exist? If so, what's it called?

Please excuse my ignorance of python tracebacks ... I've always found them quite confusing ... another thing I need to learn properly ;-)
AhShoo5n is offline   Reply With Quote
Old 08-23-2011, 11:52 AM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
click the calibre icon on the toolbar to change library paths/libraries.
kovidgoyal is offline   Reply With Quote
Old 08-23-2011, 12:04 PM   #8
AhShoo5n
Junior Member
AhShoo5n began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Aug 2011
Device: Kindle 3
Oops! I'm guessing that the 'calibre icon' is the drawing of some books on a shelf?

Last edited by AhShoo5n; 08-23-2011 at 12:07 PM.
AhShoo5n is offline   Reply With Quote
Old 08-23-2011, 12:05 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
its the icon which has the number of books under it.
kovidgoyal is offline   Reply With Quote
Old 08-23-2011, 12:10 PM   #10
AhShoo5n
Junior Member
AhShoo5n began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Aug 2011
Device: Kindle 3
Quote:
Originally Posted by kovidgoyal View Post
its the icon which has the number of books under it.
Ha! I guessed ... see my edit above.

BTW in professional usability one of the first things you learn is that few icons are instantly recognised and understood ... words are much clearer, ... but only if they are the right words :-)

Sorry, again, for wasting your time.
AhShoo5n is offline   Reply With Quote
Old 08-23-2011, 12:17 PM   #11
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
And in professional usability, do they teach you how to simultaneously display the number of books and "recognizable words" without using up too much space in a toolbar? If they do, I'd love to hear about it.

I absolutely love how "usability experts" automatically assume that only they could ever have thought about usability.
kovidgoyal is offline   Reply With Quote
Old 08-23-2011, 12:39 PM   #12
AhShoo5n
Junior Member
AhShoo5n began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Aug 2011
Device: Kindle 3
Please accept my apologies, no criticism was intended, at all.
AhShoo5n is offline   Reply With Quote
Old 08-23-2011, 12:53 PM   #13
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No worries. I agree that not having a label for that icon makes it harder to find, but that is the best and least disruptive place I could find in the interface to display the number of books. The only other possibility is dedicating some space in the status bar for it, but that reduces the usable width of the status bar, which can be important on narrow/small screens.
kovidgoyal is offline   Reply With Quote
Reply

Tags
error, invalid library, traceback, utf8

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre - Invalid Library Error junkyardwillie Calibre 2 09-18-2010 12:02 AM
Invalid Library Error Debby Calibre 0 02-26-2010 11:32 PM
UnicodeDecodeError in startup.py yet Calibre 3 02-05-2010 11:29 AM
UnicodeDecodeError in startup.py yet Calibre 0 02-04-2010 05:57 AM
'utf8' codec can't decode bytes error (HTML to EPUB conversion) gsz Calibre 10 10-26-2009 06:29 PM


All times are GMT -4. The time now is 10:32 PM.


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