Calibre Web Automated Figuring Things Out for Kobo and Other Issues.
October 20, 2025
I was using the very awesome Calibre Web earlier. It is great software but I hadn’t bothered setting up Calibre itself on the server and I was rsyncing the database from my desktop every time I added or removed a book. This is great for getting the library started but once you’re adding and removing formats of a book or a single book it gets a little weird and you may find yourself having to do some serious clean up using dangerous rsync commands.
Calibre Web Automated
As I was looking for solutions to a problem I’d encountered with Calibre Web I found Calibre Web Automated. This is great software as well and it does in a single docker service what you might end up with 2 or more containers to do. It includes the fully working Calibre engine as well as conversion tools etc. It does enable quite a bit of automation and easy one off or more book uploads.
Getting Kobo Sync Working
Recently I acquired a kobo elipsa 2E and I thought I’d be fine as I’d enabled the kobo bits and even added the header fix for kobo (and then even got it working).
I’m running all my stuff behind Traefik (reverse proxy) and the fix I thought I’d got working wasn’t working as I’d missed a bit in my labels. Turns out the middleware needs to call the sync headers (see bold below) in order for this to work.
labels:
- traefik.enable=true
- traefik.docker.network=web
- traefik.http.middlewares.kobo-sync-headers.headers.customrequestheaders.X-Scheme=https
# Http (Only redirect to HTTPS)
- traefik.http.routers.calibre-web-auto.entrypoints=web
- traefik.http.routers.calibre-web-auto.rule=Host(`books.mydomain.com`)
- traefik.http.middlewares.calibre-web-auto-https-redirect.redirectscheme.scheme=https
- traefik.http.routers.calibre-web-auto.middlewares=calibre-web-auto-https-redirect
# Https and headers
- traefik.http.routers.calibre-web-auto-secure.entrypoints=web-secure
- traefik.http.routers.calibre-web-auto-secure.rule=Host(`books.mydomain.com`)
- traefik.http.routers.calibre-web-auto-secure.tls=true
- traefik.http.routers.calibre-web-auto-secure.tls.certresolver=myresolver
- traefik.http.routers.calibre-web-auto-secure.middlewares=secureHeaders@file,kobo-sync-headers
# Service
- traefik.http.services.calibre-web-auto.loadbalancer.server.port=8080
- traefik.http.services.calibre-web-auto.loadbalancer.server.scheme=http
Part II Getting An Inconsistent Kobo Sync Issue Solved
So it turns out the above is useful but not the whole solution. I discovered that some items still wouldn’t sync and so I looked more deeply. The problem appeared to be random and selective.
There’s one setting (in CWA it’s in “Edit Basic Configuration”) “Embed Metadata to Ebook File on Download/Conversion/e-mail (needs Calibre/Kepubify binaries)” which should be turned off. Apparently this can lead to corruption of the metadata and Kobo doesn’t like that. Note that Kepubify is part of the docker image for CWA.
The trick after that is to delete existing Kepub files and try the sync again. In my case it worked.
Fixing Conversion Issue (EPUB -> PDF)
Recently I tried to convert an EPUB to PDF and the thing failed. The initial error was this
“Calibre failed with error: ImportError: cannot import name ‘QWebEnginePage’ from ‘qt.webengine’ (/app/calibre/lib/calibre-extensions/python-lib.bypy.frozen/qt/webengine.pyc)”
This seems to be a failure of the configuration of the base image. Something about libnss being installed as part of the kernel of the underlying system on which the container is made. This is fixable with environment calls in the docker compose but you have to watch out if you’re running multi user as I am . The environment variables I added (which worked) were
environment:
- DOCKER_MODS=linuxserver/mods:universal-calibre|linuxserver/mods:universal-package-install
- INSTALL_PACKAGES=libasound2|libegl1|libopengl0|libxkbcommon0|libnss3|libgbm1
- QT_QPA_PLATFORM=offscreen
- LIBGL_ALWAYS_SOFTWARE=1
- QTWEBENGINE_CHROMIUM_FLAGS=--disable-gpu --headless --disable-dev-shm-usage #--single-process
Note that –single-process is commented out. If this is NOT commented out the following error shows up
“Calibre failed with error: Single mode supports only single profile.”
These variables came from a bunch of homework looking for a solution to the problem online.
Note as always your mileage may vary, this worked on a Debian bookworm docker host with Calibre-Web Automated version 3.1.4.