Bug 1471389 - calibredb unable to connect to the new Calibre 3 content server
calibredb unable to connect to the new Calibre 3 content server
Product: Fedora
Classification: Fedora
Component: calibre (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Kevin Fenzi
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2017-07-15 10:14 EDT by Johannes Römer
Modified: 2018-05-29 07:41 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2018-05-29 07:41:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Johannes Römer 2017-07-15 10:14:11 EDT
Since version 3.0 Calibre includes a new Content server [1]. Trying to interface with this server using the command line tool calibredb leads to the following error:

$ calibredb search XXX --username XXX --password XXX --with-library "http://localhost:8080/#calibre-library"
Traceback (most recent call last):
  File "/usr/bin/calibredb", line 20, in <module>
  File "/usr/lib64/calibre/calibre/db/cli/main.py", line 250, in main
    return run_cmd(cmd, opts, args[1:], DBCtx(opts))
  File "/usr/lib64/calibre/calibre/db/cli/main.py", line 54, in run_cmd
    ret = m.main(opts, args, dbctx)
  File "/usr/lib64/calibre/calibre/db/cli/cmd_search.py", line 45, in main
    ids = dbctx.run('search', q)
  File "/usr/lib64/calibre/calibre/db/cli/main.py", line 188, in run
    return self.remote_run(name, m, *args)
  File "/usr/lib64/calibre/calibre/db/cli/main.py", line 208, in remote_run
    res = self.br.open_novisit(rq)
  File "/usr/lib/python2.7/site-packages/mechanize/_mechanize.py", line 199, in open_novisit
    return self._mech_open(url, data, visit=False, timeout=timeout)
  File "/usr/lib/python2.7/site-packages/mechanize/_mechanize.py", line 230, in _mech_open
    response = UserAgentBase.open(self, request, data)
  File "/usr/lib/python2.7/site-packages/mechanize/_opener.py", line 193, in open
    response = urlopen(self, req, data)
  File "/usr/lib/python2.7/site-packages/mechanize/_urllib2_fork.py", line 344, in _open
    '_open', req)
  File "/usr/lib/python2.7/site-packages/mechanize/_urllib2_fork.py", line 332, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/site-packages/mechanize/_urllib2_fork.py", line 1142, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.7/site-packages/mechanize/_urllib2_fork.py", line 1115, in do_open
    h.request(req.get_method(), req.get_selector(), req.data, headers)
  File "/usr/lib64/python2.7/httplib.py", line 1042, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib64/python2.7/httplib.py", line 1082, in _send_request
  File "/usr/lib64/python2.7/httplib.py", line 1038, in endheaders
  File "/usr/lib64/python2.7/httplib.py", line 880, in _send_output
    msg += message_body
UnicodeDecodeError: 'utf8' codec can't decode byte 0x91 in position 0: invalid start byte

According to Kovid Goyal this is caused by an outdated version of python-mechanize [2]. Fedora still ships version 0.2.5 (which was released in 2011). As of today, the latest version is 0.3.5 [3].

Bug 1432447 already tracks new releases of python-mechanize, but nobody seems to care.

[1] https://calibre-ebook.com/new-in/twelve
[2] https://www.mobileread.com/forums/showpost.php?p=3520402&postcount=151
[3] https://github.com/python-mechanize/mechanize
Comment 1 Kevin Fenzi 2017-07-21 18:39:30 EDT
I have built new python-mechanize in rawhide, but it needs python-webencodings for tests, so I want to get that package added and used before pushing it to stable releses. Additionally I had to update python-html5lib and it also needs python-webencodings for tests. 

So, hopefully soon I will push all these to 26. 

I can confirm that rawhide is working with the calibredb now and the new mechanize.
Comment 2 Johannes Römer 2017-07-22 18:05:36 EDT
Yes, indeed, calibredb works as expected after installing the new mechanize and html5lib packages. Thank you very much!
Comment 3 Fedora End Of Life 2018-05-03 03:54:50 EDT
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Comment 4 Fedora End Of Life 2018-05-29 07:41:06 EDT
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
is no longer maintained, which means that it will not receive any
further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.