Problem Description
A user cannot read a calibre book using the web client.
Steps to Reproduce
- Log in to Freedombox (user has admin + calibre + all other permission)
- Click on Apps, Calibre, Launch Web Client
- Select a Library, select a Book
- Hit the Read button at the top of the page
Expected Results
I expect a web epub reader to be launched allowing the user to read the book.
Actual results
Failed to prepare book for reading
Could not open Starfish. There was an error processing the book, click “Show details” for more information
Traceback (most recent call last):
File “/usr/lib/calibre/calibre/utils/ipc/simple_worker.py”, line 289, in main
res = {‘result’:func(*args, **kwargs)}
File “/usr/lib/calibre/calibre/srv/render_book.py”, line 524, in render
Container(pathtoebook, output_dir, book_hash=book_hash)
File “/usr/lib/calibre/calibre/srv/render_book.py”, line 178, in init
ContainerBase.init(self, tdir, opfpath, log)
File “/usr/lib/calibre/calibre/ebooks/oeb/polish/container.py”, line 288, in init
raise InvalidBook(‘Could not locate opf file: %r’%opfpath)
InvalidBook: Could not locate opf file: u’/var/lib/private/calibre-server-freedombox/.cache/calibre/srvb/s/4DOAnr/content.opf’
Screenshot
Information
- FreedomBox version: You are running Debian GNU/Linux 10 (buster) and FreedomBox version 21.4. FreedomBox is up to date.
- Hardware: 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux
- How did you install FreedomBox?: Debian Stable netinst + DEBIAN_FRONTEND=noninteractive apt-get -y install freedombox
Root Cause Analysis
A calibre group does not exist, and users with calibre permission are not assigned group 64238. Calibre installation creates directories under /var/lib/private/calibre-server-freedombox using group 64238. Filesystem operations are prevented for lack of permissions for the user.
- /var/lib/private/calibre-server-freedombox/.cache/calibre/srvb/s/4DOAnr/content.opf does not exit.
- user cannot enter the containing directory.
- user is not a member of folder’s group 64238
- group 64238 is not defined in the OS
- calibre group is not defined in OS