|
|
Thread Tools | Search this Thread |
09-14-2010, 10:30 PM | #1 |
Member
Posts: 14
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? |
09-14-2010, 10:44 PM | #2 |
creator of calibre
Posts: 44,346
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Run a database integrity check from Preferences->Advanced->Miscellaneous
|
Advert | |
|
09-14-2010, 10:45 PM | #3 |
creator of calibre
Posts: 44,346
Karma: 23661992
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
|
09-14-2010, 11:16 PM | #4 |
Member
Posts: 14
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. |
09-15-2010, 12:01 AM | #5 |
creator of calibre
Posts: 44,346
Karma: 23661992
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?
|
Advert | |
|
09-15-2010, 06:22 AM | #6 |
Member
Posts: 14
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.
|
09-15-2010, 11:31 AM | #7 |
creator of calibre
Posts: 44,346
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Did you run the db integrity check?
|
09-15-2010, 06:36 PM | #8 |
Member
Posts: 14
Karma: 50
Join Date: Jul 2010
Device: Android phone
|
As stated in the first post, I can successfully run the db integrity check.
|
09-15-2010, 06:51 PM | #9 |
creator of calibre
Posts: 44,346
Karma: 23661992
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.
|
10-03-2010, 09:55 AM | #10 |
Junior Member
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! |
10-03-2010, 09:58 AM | #11 |
Junior Member
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!
|
10-03-2010, 10:03 AM | #12 |
Junior Member
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' |
10-03-2010, 10:16 AM | #13 |
Grand Sorcerer
Posts: 11,940
Karma: 7219261
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
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? |
10-03-2010, 12:30 PM | #14 | |
Junior Member
Posts: 5
Karma: 10
Join Date: Sep 2010
Device: Kindle
|
Quote:
|
|
10-03-2010, 12:41 PM | #15 |
Grand Sorcerer
Posts: 11,940
Karma: 7219261
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
|
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 |