[SOLVED] Calibre can not locate opf file

Problem Description
If i try to read a e-book in webbrowser from FB Calibre Libraries i get an error

Steps to Reproduce

  1. Login to FreedomBox
  2. Go to Calibre application page
  3. Click on your Library
  4. Select uploaded e-book
  5. Click on read this book

Expected Results
open the e-book

Actual results
I get an error with the following message:

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/HxixE6/metadata.opf’



  • FreedomBox version: 20.15
  • Hardware: Freedombox Pioneer Edition
  • How did you install FreedomBox?: bought pre-installed hardware

I expierienced the same. I have uploaded some pdf-files to calibre the I clicked on read and got the same result.

The information for my configuration is the same as for MikaelB.

1 Like

When doing the initial testing for the app, I did reading etc. on Debian testing. Didn’t test the app fully on stable. I created an issue for tracking this: https://salsa.debian.org/freedombox-team/freedombox/-/issues/1975


Usually an e-book’s folder in calibre has a cover.jpg and metadata.opf in addition to the e-book files in various formats.

I found that when an e-book is uploaded to FreedomBox calibre using the web interface, it seems to generate the cover.jpg file but not metadata.opf

I tested on Debian stable.

When I tested the same in a Debian testing container, I still found that the metadata.opf file is not generated. However, this doesn’t break the calibre web reader (version 5.2.0)

Might be worth testing on the buster-backports version too.

The calibre web reader on buster-backports is broken too. :zipper_mouth_face:

This is likely because of pdf2html (or something) from poppler project that Calibre uses to do the conversion.

Same here.
InvalidBook: Could not locate opf file: u’/var/lib/private/calibre-server-freedombox/.cache/calibre/srvb/s/LrWT0S/content.opf’
I wanted to look up the path via ssh, but /var/lib/private doesn’t exist, and for /var/lib/calibre-server-freedombox permission is denied. Whatever that means, just found it remarkable

1 Like

Is there any logfile for calibre-server-freedombox?

I looked at /var/log and by journalctl -xe but didn’t notice any related output.

I just want to add some findings regarding the calibre server.

https://calibre-ebook.com/download_linux states:

The latest release of calibre is 5.5.0. What’s new.

Please do not use your distribution provided calibre package, as those are often buggy/outdated. Instead use the Binary install described below.

Debian10’s package is still on 3.39.1 and - as you mentioned before - broken on several features. Which is maybe understandable in regard to another statement on the same page:

WARNING: calibre is a highly complex piece of software with lots of very finicky dependencies.

Building a newer package for ARM-based devices doesn’t seem to be trivial, as developer warns (https://www.mobileread.com/forums/showpost.php?p=3549486&postcount=2):

You would need to build calibre and all its dependencies by hand, using cross compilation for ARM.

Here is what the debian maintainer reported about Calibre in Debian in general last year.

So it might take some time until we get it to work properly I guess?
1 Like

Calibre 5.5.0 is likely to be available in the next stable release of Debian (Bullseye). It’s in unstable now.


This issue seems to have been solved by the version of Calibre (5.12.0) that came with the upgrade from buster to bullseye. I’m now able to use the web-based e-reader on epubs that failed before.


I’m glad to see this, and was happy to confirm with at least one book on my FB. thanks!

Same here. The upgrade to bullseye solved all my problems.