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 06-16-2017, 08:22 AM   #1
Jean-Christophe
Junior Member
Jean-Christophe began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jun 2017
Device: Sony PRS-T2
Question Calibre server 2.55 and the password handling

I have been lately experiencing a kind of mess up when operating the Calibre 2.55 content server from a xUbuntu computer. The problem seems to have arisen when I upgraded my operation system fom xubuntu 14.04LTS to xUbuntu 16.04.LTS.


I privately share my library to several users on a theme based approach using multiple command line invocations :

calibre-server --daemonize --username 'name-of-user1' -- restriction 'first restriction' --password 'user—1-passwd' --port '1025'
calibre-server --daemonize --username 'name-of-user2' -- restriction 'second restriction' --password 'user—2-passwd' --port '1026'

Folowing the OS upgrade, after login on, all my guests received an "Error 500" warning mentioning cherrypy .

Looking at /home/my-username/.config/calibre/server_error_log I found those following batches of lines :

Code:
[13/Jun/2017:21:04:43] ENGINE Bus STARTING
[13/Jun/2017:21:04:43] ENGINE Started monitor thread '_TimeoutMonitor'.
[13/Jun/2017:21:04:44] ENGINE Serving on http://0.0.0.0:1025
[13/Jun/2017:21:04:46] ENGINE Bus STARTED
[13/Jun/2017:21:07:43] ENGINE Bus STARTING
[13/Jun/2017:21:07:43] ENGINE Started monitor thread '_TimeoutMonitor'.
[13/Jun/2017:21:07:43] ENGINE Serving on http://0.0.0.0:1025
[13/Jun/2017:21:07:46] ENGINE Bus STARTED
[13/Jun/2017:21:08:17] HTTP Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/cherrypy/_cprequest.py", line 670, in respond
    response.body = self.handler()
  File "/usr/lib/python2.7/dist-packages/cherrypy/lib/encoding.py", line 217, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/cherrypy/_cpdispatch.py", line 61, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/lib/calibre/calibre/library/server/utils.py", line 54, in do
    ans = func(*args, **kwargs)
  File "/usr/lib/calibre/calibre/library/server/utils.py", line 108, in authenticate
    self.secret)
  File "/usr/lib/python2.7/dist-packages/cherrypy/lib/auth_digest.py", line 364, in digest_auth
    ha1 = get_ha1(realm, auth.username)
  File "/usr/lib/python2.7/dist-packages/cherrypy/lib/auth_digest.py", line 57, in get_ha1
    return md5_hex('%s:%s:%s' % (username, realm, password))
  File "/usr/lib/python2.7/dist-packages/cherrypy/lib/auth_digest.py", line 30, in <lambda>
    md5_hex = lambda s: md5(ntob(s)).hexdigest()
  File "/usr/lib/python2.7/dist-packages/cherrypy/_cpcompat.py", line 68, in ntob
    assert_native(n)
  File "/usr/lib/python2.7/dist-packages/cherrypy/_cpcompat.py", line 111, 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)
The workaround I found was to disable the password request so my guest readers could enjoy the library again, but there is some concern about unsolicited visitors… I can fortunately veil the logs to ban suspicious incomers using iptables, but I hope for a code improvement to be incorporated in a next release.
Jean-Christophe is offline   Reply With Quote
Advert
Old 06-16-2017, 08:26 AM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 47,763
Karma: 36281079
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Calibre 3 has just been released. 2.55 is an oldish version.Update, try again and then if you have a problem, post about it.
JSWolf is online now   Reply With Quote
Old 06-16-2017, 09:15 AM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 20,470
Karma: 20259386
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Astak Pocket Pro, K4NT,Galaxy Tab 2
Moderator Notice
Moved out of development. Please read and heed the stickies at the top of the forums.
theducks is offline   Reply With Quote
Old 06-16-2017, 11:08 AM   #4
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 1,163
Karma: 3620842
Join Date: Jun 2010
Device: Windows 10 tablet,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by Jean-Christophe View Post
I have been lately experiencing a kind of mess up when operating the Calibre 2.55 content server from a xUbuntu computer. The problem seems to have arisen when I upgraded my operation system fom xubuntu 14.04LTS to xUbuntu 16.04.LTS.


I privately share my library to several users on a theme based approach using multiple command line invocations :

calibre-server --daemonize --username 'name-of-user1' -- restriction 'first restriction' --password 'user—1-passwd' --port '1025'
calibre-server --daemonize --username 'name-of-user2' -- restriction 'second restriction' --password 'user—2-passwd' --port '1026'

Folowing the OS upgrade, after login on, all my guests received an "Error 500" warning mentioning cherrypy .

Looking at /home/my-username/.config/calibre/server_error_log I found those following batches of lines :

Code:
[13/Jun/2017:21:04:43] ENGINE Bus STARTING
[13/Jun/2017:21:04:43] ENGINE Started monitor thread '_TimeoutMonitor'.
[13/Jun/2017:21:04:44] ENGINE Serving on http://0.0.0.0:1025
[13/Jun/2017:21:04:46] ENGINE Bus STARTED
[13/Jun/2017:21:07:43] ENGINE Bus STARTING
[13/Jun/2017:21:07:43] ENGINE Started monitor thread '_TimeoutMonitor'.
[13/Jun/2017:21:07:43] ENGINE Serving on http://0.0.0.0:1025
[13/Jun/2017:21:07:46] ENGINE Bus STARTED
[13/Jun/2017:21:08:17] HTTP Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/cherrypy/_cprequest.py", line 670, in respond
    response.body = self.handler()
  File "/usr/lib/python2.7/dist-packages/cherrypy/lib/encoding.py", line 217, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/cherrypy/_cpdispatch.py", line 61, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/lib/calibre/calibre/library/server/utils.py", line 54, in do
    ans = func(*args, **kwargs)
  File "/usr/lib/calibre/calibre/library/server/utils.py", line 108, in authenticate
    self.secret)
  File "/usr/lib/python2.7/dist-packages/cherrypy/lib/auth_digest.py", line 364, in digest_auth
    ha1 = get_ha1(realm, auth.username)
  File "/usr/lib/python2.7/dist-packages/cherrypy/lib/auth_digest.py", line 57, in get_ha1
    return md5_hex('%s:%s:%s' % (username, realm, password))
  File "/usr/lib/python2.7/dist-packages/cherrypy/lib/auth_digest.py", line 30, in <lambda>
    md5_hex = lambda s: md5(ntob(s)).hexdigest()
  File "/usr/lib/python2.7/dist-packages/cherrypy/_cpcompat.py", line 68, in ntob
    assert_native(n)
  File "/usr/lib/python2.7/dist-packages/cherrypy/_cpcompat.py", line 111, 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)
The workaround I found was to disable the password request so my guest readers could enjoy the library again, but there is some concern about unsolicited visitors… I can fortunately veil the logs to ban suspicious incomers using iptables, but I hope for a code improvement to be incorporated in a next release.
The version you are using is the distro version. You want to uninstall the distro version and install the supported version. What Ubuntu did was to replaced the patched private version of cherrypy server with the the upstream version of cherrypy server which has a bug that has never been fixed--but was fixed in calibre's private version of cherrypy.

Quote:
Please do not use your distribution provided calibre package, as those are often buggy/outdated. Instead use the Binary install described below.
http://calibre-ebook.com/download_linux

Please be advised that calibre version 3 does not use cherrypy server.

bernie
gbm 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
Calibre server and password on an iPad richorlin Library Management 0 01-23-2015 09:44 PM
Calibre content server - Kindle - Password ekanters Calibre 3 02-18-2012 03:25 PM
Linux calibre-server: How to set username/password? qupfer Calibre 0 12-08-2011 04:54 PM
Login/Password for Calibre Server myudkowsky Calibre 15 11-21-2010 10:07 PM
Can't access password protected calibre server ganymede Calibre 3 11-15-2010 06:24 AM


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


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