OPDS 500 internal server error

Bug #1621642 reported by Earl Daniels on 2016-09-08
122
This bug affects 15 people
Affects Status Importance Assigned to Milestone
calibre
Undecided
Unassigned

Bug Description

calibre 2.67 throws a 500 error when browsing via OPDS.

Main menu displays and some submenus (such as a list of authors), but when trying to display a list of books, it errors.

I'm on Ubuntu 14.04, had it working fine a calibre version or two ago.

Confirmed the bug from FBreader OPDS "Network Library" conection and via localhost with a web browser.

{created one 500 error, not noted in debug log}

calibre Debug log
calibre 2.67 embedded-python: True is64bit: True
Linux-3.13.0-95-generic-x86_64-with-debian-jessie-sid Linux ('64bit', 'ELF')
('Linux', '3.13.0-95-generic', '#142-Ubuntu SMP Fri Aug 12 17:00:09 UTC 2016')
Python 2.7.9
Linux: ('debian', 'jessie/sid', '')
Successfully initialized third party plugins: EpubMerge (2, 0, 14)
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 90.0253164557 x 90.1013513514
Starting up...
EpubMerge: DEBUG: 2016-09-08 17:24:34,761: calibre_plugins.epubmerge.epubmerge_plugin(152): macmenuhack file_path:/home/earl/.config/calibre/plugins/fanficfare_macmenuhack.txt
Started up in 13.48 seconds with 228 books

{from FBreader, server log results}

192.168.1.103 - - [08/Sep/2016:17:24:52] "GET /opds HTTP/1.1" 200 3371 "" "FBReader/2.7.2 (Android 6.0.1, kltespr, SM-G900P)"
192.168.1.103 - - [08/Sep/2016:17:24:56] "GET /opds/navcatalog/4e617574686f7273 HTTP/1.1" 200 7781 "" "FBReader/2.7.2 (Android 6.0.1, kltespr, SM-G900P)"
192.168.1.103 - - [08/Sep/2016:17:24:57] "GET /opds/categorygroup/617574686f7273/41 HTTP/1.1" 200 4612 "" "FBReader/2.7.2 (Android 6.0.1, kltespr, SM-G900P)"
192.168.1.103 - - [08/Sep/2016:17:25:00] "GET /opds/category/617574686f7273/4933353a617574686f7273 HTTP/1.1" 500 805 "" "FBReader/2.7.2 (Android 6.0.1, kltespr, SM-G900P)"

{browser error msg}

500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request.

Powered by CherryPy 3.2.2

{thank you for a great program - let me know if you need any additional info to help resolve this - not urgent, as I mostly use the online FBreader library}

I need the server logs, which you get from Preferences->Sharing over the
net.

 status incomplete

Changed in calibre:
status: New → Incomplete
Earl Daniels (k-mt-s) wrote :
Download full text (171.8 KiB)

{Here's the error and access logs going back to Sep 2, when I'm fairly certain it was working. Note that there was an update to FBReader, but the error is also seen in Chrome. Also, I was on a non-standard port 8181 but changed back to 8080 - no effect}

[02/Sep/2016:22:22:56] ENGINE Bus STARTING
[02/Sep/2016:22:22:56] ENGINE Started monitor thread '_TimeoutMonitor'.
[02/Sep/2016:22:22:57] ENGINE Serving on 0.0.0.0:8181
[02/Sep/2016:22:22:59] ENGINE Bus STARTED
[02/Sep/2016:22:38:09] ENGINE Bus STOPPING
[02/Sep/2016:22:38:10] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8181)) shut down
[02/Sep/2016:22:38:10] ENGINE Stopped thread '_TimeoutMonitor'.
[02/Sep/2016:22:38:10] ENGINE Bus STOPPED
[02/Sep/2016:22:38:10] ENGINE Bus EXITING
[02/Sep/2016:22:38:10] ENGINE Bus EXITED
[02/Sep/2016:22:38:10] ENGINE Waiting for child threads to terminate...
[02/Sep/2016:22:38:10] ENGINE Waiting for thread MainThread.
[02/Sep/2016:22:42:41] ENGINE Bus STARTING
[02/Sep/2016:22:42:41] ENGINE Started monitor thread '_TimeoutMonitor'.
[02/Sep/2016:22:42:41] ENGINE Serving on 0.0.0.0:8181
[02/Sep/2016:22:42:43] ENGINE Bus STARTED
[02/Sep/2016:22:51:13] ENGINE Bus STOPPING
[02/Sep/2016:22:51:14] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8181)) shut down
[02/Sep/2016:22:51:14] ENGINE Stopped thread '_TimeoutMonitor'.
[02/Sep/2016:22:51:14] ENGINE Bus STOPPED
[02/Sep/2016:22:51:14] ENGINE Bus EXITING
[02/Sep/2016:22:51:14] ENGINE Bus EXITED
[02/Sep/2016:22:51:14] ENGINE Waiting for child threads to terminate...
[02/Sep/2016:22:51:14] ENGINE Waiting for thread MainThread.
[02/Sep/2016:22:51:19] ENGINE Bus STARTING
[02/Sep/2016:22:51:19] ENGINE Started monitor thread '_TimeoutMonitor'.
[02/Sep/2016:22:51:19] ENGINE Serving on 0.0.0.0:8181
[02/Sep/2016:22:51:21] ENGINE Bus STARTED
[02/Sep/2016:23:01:49] ENGINE Bus STOPPING
[02/Sep/2016:23:01:49] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8181)) shut down
[02/Sep/2016:23:01:49] ENGINE Stopped thread '_TimeoutMonitor'.
[02/Sep/2016:23:01:49] ENGINE Bus STOPPED
[02/Sep/2016:23:01:49] ENGINE Bus EXITING
[02/Sep/2016:23:01:49] ENGINE Bus EXITED
[02/Sep/2016:23:01:49] ENGINE Waiting for child threads to terminate...
[02/Sep/2016:23:01:49] ENGINE Waiting for thread MainThread.
[05/Sep/2016:10:52:28] ENGINE Bus STARTING
[05/Sep/2016:10:52:28] ENGINE Started monitor thread '_TimeoutMonitor'.
[05/Sep/2016:10:52:28] ENGINE Serving on 0.0.0.0:8181
[05/Sep/2016:10:52:30] ENGINE Bus STARTED
[05/Sep/2016:21:04:15] ENGINE Bus STOPPING
[05/Sep/2016:21:04:16] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8181)) shut down
[05/Sep/2016:21:04:16] ENGINE Stopped thread '_TimeoutMonitor'.
[05/Sep/2016:21:04:16] ENGINE Bus STOPPED
[05/Sep/2016:21:04:16] ENGINE Bus EXITING
[05/Sep/2016:21:04:16] ENGINE Bus EXITED
[05/Sep/2016:21:04:16] ENGINE Waiting for child threads to terminate...
[05/Sep/2016:21:04:16] ENGINE Waiting for thread MainThread.
[08/Sep/2016:13:19:43] ENGINE Bus STARTING
[08/Sep/2016:13:19:43] ENGINE Started monitor thread '_TimeoutMonitor'.
[08/Sep/2016:13:19:44] ENGINE Serving on 0.0.0.0:8181
[08/Sep/2016:13:19:45] ENGINE Bus STARTE...

Charles Haley (cbhaley) wrote :

Kovid: this happens if the library has no custom columns.

I pushed a fix if you want it.

Fixed in branch master. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

Changed in calibre:
status: Incomplete → Fix Released
Zygimantus (zygimantus) wrote :

Is it fixed? I am using 2.70.0 and I am getting this error:

[16/Oct/2016:11:40:22] HTTP
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 670, in respond
    response.body = self.handler()
  File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 220, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 60, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/lib/calibre/calibre/library/server/utils.py", line 55, in do
    ans = func(*args, **kwargs)
  File "/usr/lib/calibre/calibre/library/server/utils.py", line 110, in authenticate
    self.secret)
  File "/usr/lib/python2.7/site-packages/cherrypy/lib/auth_digest.py", line 363, in digest_auth
    ha1 = get_ha1(realm, auth.username)
  File "/usr/lib/python2.7/site-packages/cherrypy/lib/auth_digest.py", line 58, in get_ha1
    return md5_hex('%s:%s:%s' % (username, realm, password))
  File "/usr/lib/python2.7/site-packages/cherrypy/lib/auth_digest.py", line 31, in <lambda>
    md5_hex = lambda s: md5(ntob(s)).hexdigest()
  File "/usr/lib/python2.7/site-packages/cherrypy/_cpcompat.py", line 54, in ntob
    assert_native(n)
  File "/usr/lib/python2.7/site-packages/cherrypy/_cpcompat.py", line 89, in assert_native
    raise TypeError("n must be a native str (got %s)" % type(n).__name__)
TypeError: n must be a native str (got unicode)

Kovid Goyal (kovid) wrote :

No you are not. You are using the distro version of calibre. Uninstall it, and install the official calibre binary and you will be fine.

Zygimantus (zygimantus) wrote :

Well indeed, this solved the issue. Thank you.

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

Other bug subscribers