OPDS content server returns 500 error but web view does not

Bug #1727055 reported by Ólafur Tryggvason
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Invalid
Undecided
Unassigned

Bug Description

Calibre Release: 3.10 [64bit]
Windows (OS is Windows 10 Enterprise)

I am running the content server without a user/password setup.
About 50% of directories/Views on the OPDS return a 500 server error but the same view seen from the web shows without a problem.

For instance 5 star rated books. Show fine at http://192.168.1.10:8080/#library_id...&sort=tags.asc

But return an error when browsing through FBReader (or same URL in browser, taken from the access.log)

Since so many authors/series/tags/etc. show this (but not all) it seems to be connected to some metadata rather than an overall problem with the content server. I.e. Some views with 4 books will show this error and
another with 15 books will not.

Always the same error:
calibre server listening on 0.0.0.0:8080
OPDS feeds advertised via BonJour at: 192.168.1.10 port: 8080
Unhandled exception in state: State: _job_done Client: 127.0.0.1:55462 Request: GET /opds/category/726174696e67/49313a726174696e67?library_id=Calibre_Library HTTP/1.1
Traceback (most recent call last):
File "site-packages\calibre\srv\loop.py", line 565, in tick
File "site-packages\calibre\srv\loop.py", line 303, in _job_done
File "site-packages\calibre\srv\pool.py", line 35, in run
File "site-packages\calibre\srv\http_response.py", line 441, in run_request_handler
File "site-packages\calibre\srv\routes.py", line 306, in dispatch
File "site-packages\calibre\srv\opds.py", line 575, in opds_category
File "site-packages\calibre\srv\opds.py", line 405, in get_acquisition_feed
File "site-packages\calibre\srv\opds.py", line 335, in __init__
File "site-packages\calibre\srv\opds.py", line 219, in ACQUISITION_ENTRY
TypeError: cannot concatenate 'str' and 'NoneType' objects

I took a look at this line at Github.
ans = E.entry(TITLE(mi.title), E.author(E.name(authors_to_string(mi.authors))), ID('urn:uuid:' + mi.uuid), UPDATED(mi.last_modified),
                  E.published(mi.timestamp.isoformat()))

Chose a view (this case an author) and viewed all the books.
None of these where missing: Title, Author (of course not, since looking at author), last modified, published,

Only one didn't have a valid ISBN (Firstborn by Brandon Sanderson) it only has an ASIN number.

Tried searching "pubdate:false and author:"Brandon Sanderson"
"title:false", last_modified:false and etc..

I finally found 2 books with uuid:false and author:"Brandon Sanderson"
Problem is that I cannot see the UUID (tried viewing the books in debug mode) or tell Calibre to reassign a new UUID for these books.

Turns out that about 13% of my ebooks are missing a uuid. Which explains the random location of the errors.

I am using the Goodreads plugin for a metadata source, since they have the only working series categorization.

Regards

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1727055

uuids are automatically generated when book records are created. The
only way you could possibly have missing uuids is if some third party
software is messing with the calibre database. You can try using the
restore database tool which will rebuild the db from the OPF backup
files (Click calibre icon in the toolbar->Library maintenance->restore
database)

 status invalid

Changed in calibre:
status: New → Invalid
Revision history for this message
Ólafur Tryggvason (rufal) wrote :

Thanks,
Restore Database did fix it and was pretty quick about it.

But shouldn't it be considered a bug that any plugin (no matter it's purpose) can override or remove something as intrinsic as a file's UUID?

I will continue to use these two plugins (Goodreads metadata and Duplicates finder) and I will check regularly for "uuid:false" to see if I can catch which action does this.

Best regards

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.