Calibre stopped working after upgrade

Asked by William Pabon on 2020-10-08

Recently I upgraded my system to Ubuntu 20.04.1 (from 18.04) and after that, Calibre (E-book library management app) stopped working. I tried removing and re-installing it to no avail: the program installs but it doesn't run. I launched it from terminal and this is what I get:

williepabon@williepabon-Macmini:~$ sudo -i
[sudo] password for williepabon:
root@williepabon-Macmini:~# calibre
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Traceback (most recent call last):
  File "/usr/bin/calibre", line 20, in <module>
  File "/usr/lib/calibre/calibre/", line 73, in calibre
  File "/usr/lib/calibre/calibre/gui2/", line 543, in main
    listener = create_listener()
  File "/usr/lib/calibre/calibre/gui2/", line 514, in create_listener
    return Listener(address=gui_socket_address())
  File "/usr/lib/calibre/calibre/utils/ipc/", line 110, in __init__
AttributeError: 'NoneType' object has no attribute 'cancel'

If anybody understands the stuff above and can help me to find a solution, will be greatly appreciated. Thanks.

Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Solved by:
Manfred Hampl
Last query:
Last reply:
William Pabon (williepabon) said : #2


Thanks for answering. The link above says that there is a patch to solve the problem. How do I implement it? Please, advice.

Why are you running Calibre as root?

Best Manfred Hampl (m-hampl) said : #4

Try the following:

Open a terminal window (e.g. by simultaneously pressing ctrl-alt-t)
issue the command

sudo gedit /usr/lib/calibre/calibre/utils/ipc/

This will ask for your password as confirmation for an administrative action and will then open an editor with a python script loaded.

Scroll down to line 110

            # named sockets, prevent it from doing so.
            # Prevent child processes from inheriting this socket

            # named sockets, prevent it from doing so.
            if self._listener._unlink is not None:
            # Prevent child processes from inheriting this socket

(by indenting the line "self.listener..." and adding an "if ..." before).
Correct indentation is crucial!

When you have done this, save the file and close the editor.

In case that you botch everything up, you can restore the previous status with the command
sudo apt install --reinstall calibre
and then you can try again.

William Pabon (williepabon) said : #5

Thanks Manfred Hampl, that solved my question.