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 09-14-2010, 10:30 PM   #1
tilleydog
Member
tilleydog is on a distinguished road
 
Posts: 13
Karma: 50
Join Date: Jul 2010
Device: Android phone
AttributeError: 'NoneType' object has no attribute 'replace' when trying to add books

I am getting the following error when I try to add a book or multiple books. Calibre vers 7.18.

WARNING: Failed to read metadata: Failed to read metadata from the following:

Lives of Twelve Caesars, The By Sueton - Unknown.pdf
Traceback (most recent call last):
File "site-packages\calibre\gui2\add.py", line 108, in run
File "site-packages\calibre\gui2\add.py", line 170, in add
File "site-packages\calibre\library\database2.py", line 1753, in create_book_entry
File "site-packages\calibre\library\caches.py", line 518, in books_added
File "site-packages\calibre\library\database2.py", line 600, in has_cover
File "site-packages\calibre\library\database2.py", line 357, in path
AttributeError: 'NoneType' object has no attribute 'replace'

Then when I exit out of Calibre it will not restart saying the database is corrupted. I then open the database in sqllite browser go to the end of the books table and the book is there but without many of the fields populated. I remove that row and calibre will start up just fine. I have run the check database integrity and it comes back successful.

Anyone have any suggestions?
tilleydog is offline   Reply With Quote
Old 09-14-2010, 10:44 PM   #2
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: 26,135
Karma: 5381911
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Run a database integrity check from Preferences->Advanced->Miscellaneous
kovidgoyal is online now   Reply With Quote
Old 09-14-2010, 10:45 PM   #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: 26,135
Karma: 5381911
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
And have you been running calibre from source/putting source files into the calibre installation directory? If so uninstall delete c:\Program Files\calibre2 and c;|Program Files\calibre and re-install
kovidgoyal is online now   Reply With Quote
Old 09-14-2010, 11:16 PM   #4
tilleydog
Member
tilleydog is on a distinguished road
 
Posts: 13
Karma: 50
Join Date: Jul 2010
Device: Android phone
Uninstalled and reinstalled, same issue when adding.

The last entry in the books table has the following fields populated correctly .
id, title, series_index, author_sort. All other fields are empty. Once I remove that last entry, Calibre will start again.

It looks to me like the metadata db won't allow entries into one of the fields.
tilleydog is offline   Reply With Quote
Old 09-15-2010, 12:01 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: 26,135
Karma: 5381911
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Wait are you saying that you cannot start calibre or that you cannot add books? or both?
kovidgoyal is online now   Reply With Quote
Old 09-15-2010, 06:22 AM   #6
tilleydog
Member
tilleydog is on a distinguished road
 
Posts: 13
Karma: 50
Join Date: Jul 2010
Device: Android phone
I can't add books. When I do I get the error listed above. Then when I stop calibre and restart calibre complains the database is corrupt and wants to start new metadb. I then go in using sqllite browser and remove the partial entry from the metadb and can then start calibre using my original metadb.
tilleydog is offline   Reply With Quote
Old 09-15-2010, 11:31 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: 26,135
Karma: 5381911
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Did you run the db integrity check?
kovidgoyal is online now   Reply With Quote
Old 09-15-2010, 06:36 PM   #8
tilleydog
Member
tilleydog is on a distinguished road
 
Posts: 13
Karma: 50
Join Date: Jul 2010
Device: Android phone
As stated in the first post, I can successfully run the db integrity check.
tilleydog is offline   Reply With Quote
Old 09-15-2010, 06:51 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: 26,135
Karma: 5381911
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
OK, I'll add a workaround for your problem in the next release, though why it is happening is a mystery to me.
kovidgoyal is online now   Reply With Quote
Old 10-03-2010, 09:55 AM   #10
nemez
Junior Member
nemez began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Kindle
The same happens with me, too. But only after I installed the 0.7.21 version. The message I get when I try to add a book is the following:

WARNING: Failed to read metadata: Failed to read metadata from the following:

Burke, James Lee - In The Electric Mist With Confederate Dead.htm
Traceback (most recent call last):
File "site-packages\calibre\gui2\add.py", line 108, in run
File "site-packages\calibre\gui2\add.py", line 167, in add
File "site-packages\calibre\library\database2.py", line 2045, in create_book_entry
File "site-packages\calibre\library\database2.py", line 434, in set_path
File "site-packages\calibre\library\database2.py", line 379, in path
AttributeError: 'NoneType' object has no attribute 'replace'

It actually creates an entry for the book, but it is empty but the title and I can't do anything else with it, but delete it. It is probably the same corrupted book record that tilleydog has reported.

Btw.: when I add a new format to a book that's already in Calibre, it works properly!

Also, I don't know if it might have anything to do with this, but I have used the 'Back up metadata of all books' new feature, but it is probably still continiously running in the background, because I have more than 13,000 books in the database!
nemez is offline   Reply With Quote
Old 10-03-2010, 09:58 AM   #11
nemez
Junior Member
nemez began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Kindle
Oh, yes - one more thing: I have tried the database integrity check, too, but it only displays a progressbar with 0% and stays there forever!
nemez is offline   Reply With Quote
Old 10-03-2010, 10:03 AM   #12
nemez
Junior Member
nemez began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Kindle
I have tried one more thing: I have created an empty library and I could add the book to that successfully without any problem. Then, I try to copy the book from the new library to the old one with the 'Copy to library' feature and got this:

ERROR: Failed: Could not copy books: 'NoneType' object has no attribute 'replace'

Traceback (most recent call last):
File "site-packages\calibre\gui2\actions\copy_to_library.py", line 32, in run
File "site-packages\calibre\gui2\actions\copy_to_library.py", line 70, in doit
File "site-packages\calibre\library\database2.py", line 2127, in import_book
File "site-packages\calibre\library\database2.py", line 434, in set_path
File "site-packages\calibre\library\database2.py", line 379, in path
AttributeError: 'NoneType' object has no attribute 'replace'
nemez is offline   Reply With Quote
Old 10-03-2010, 10:16 AM   #13
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,653
Karma: 1137414
Join Date: Jan 2010
Location: France
Device: Many android devices
You must let the check integrity finish. If it seriously does not finish (give it 24 hours if need be), then your library is seriously broken.

How many books do you have in this library?
chaley is offline   Reply With Quote
Old 10-03-2010, 12:30 PM   #14
nemez
Junior Member
nemez began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Kindle
Quote:
How many books do you have in this library?
I have 13,000 books and I gave it 8 hours to finish (or even just to move above 0%!)
nemez is offline   Reply With Quote
Old 10-03-2010, 12:41 PM   #15
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,653
Karma: 1137414
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by nemez View Post
I have 13,000 books and I gave it 8 hours to finish (or even just to move above 0%!)
Give it longer. Or give up on the library. Your choice.
chaley is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AttributeError: 'NoneType' object has no attribute 'lower manada Calibre 2 08-10-2010 10:54 PM
Line' object has no attribute 'children mazzeltjes Calibre 0 02-12-2010 09:30 AM
'list' object has no attribute 'add_book' etc. mazzeltjes Calibre 1 12-26-2008 01:12 PM
'list' object has no attribute 'add_book' drmathprog Calibre 2 11-13-2008 04:52 PM
'BookList' object has no attribute 'add_books' Error message nomedia Calibre 4 09-29-2008 01:50 AM


All times are GMT -4. The time now is 11:55 PM.


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