Changed location of an nfs mount, now calibre db is not found?

Hi folks,
I have searched, and found similar issues, but nothing that helps me with this exact issue.

I run my docker containers on an Ubuntu box with a handful of nfs shares mounted

It was working, all was okay, but I wanted to move to a more usable directory structure for readarr etc. so stopped the container (using docker stop containerid )

moved all of the files to a new location on the NAS (using the synology “move” in DSM) - the files are in the new location, Calibre can open them fine.

I changed my /etc/fstab entry to change the nfs mount to the new structure, and restarted the container using docker compose up.

my docker-compose.yml:

services:
  calibre-web:
    image: lscr.io/linuxserver/calibre-web:latest
    container_name: calibre-web
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - DOCKER_MODS=linuxserver/mods:universal-calibre
      - OAUTHLIB_RELAX_TOKEN_SCOPE=1
    volumes:
      - ./config:/config
      - /mnt/allmedia/Library/books/Kindle2025:/books
    ports:
      - 8083:8083
    restart: unless-stopped

now I get the “no valid calibre database” message…

What I don’t understand - on the host linux, I can navigate to

/mnt/allmedia/Library/books/Kindle2025

and see the books and calibre database there. valid sqlite DB.

rwxrwxrwx 1 1027 users 1527808 Apr 27 20:10 metadata.db

container runs,

[+] Running 1/1
 ✔ Container calibre-web  Recreated                                                                                                                          0.3s
Attaching to calibre-web
calibre-web  | [mod-init] Running Docker Modification Logic
calibre-web  | [mod-init] Adding linuxserver/mods:universal-calibre to container
calibre-web  | [mod-init] Downloading linuxserver/mods:universal-calibre from lscr.io
calibre-web  | [mod-init] Installing linuxserver/mods:universal-calibre
calibre-web  | [mod-init] linuxserver/mods:universal-calibre applied to container
calibre-web  | [migrations] started
calibre-web  | [migrations] no migrations found
calibre-web  | ───────────────────────────────────────
calibre-web  |
calibre-web  |       ██╗     ███████╗██╗ ██████╗
calibre-web  |       ██║     ██╔════╝██║██╔═══██╗
calibre-web  |       ██║     ███████╗██║██║   ██║
calibre-web  |       ██║     ╚════██║██║██║   ██║
calibre-web  |       ███████╗███████║██║╚██████╔╝
calibre-web  |       ╚══════╝╚══════╝╚═╝ ╚═════╝
calibre-web  |
calibre-web  |    Brought to you by linuxserver.io
calibre-web  | ───────────────────────────────────────
calibre-web  |
calibre-web  | To support LSIO projects visit:
calibre-web  | https://www.linuxserver.io/donate/
calibre-web  |
calibre-web  | ───────────────────────────────────────
calibre-web  | GID/UID
calibre-web  | ───────────────────────────────────────
calibre-web  |
calibre-web  | User UID:    1000
calibre-web  | User GID:    1000
calibre-web  | ───────────────────────────────────────
calibre-web  | **** Adding calibre dependencies to package install list ****
calibre-web  | [pkg-install-init] **** Installing all mod packages ****

<chopping the non-error build stuff for post length>

calibre-web  | 0 upgraded, 48 newly installed, 0 to remove and 1 not upgraded.
calibre-web  | Need to get 42.4 MB of archives.
calibre-web  | After this operation, 184 MB of additional disk space will be used.

<chopping the non-error build stuff for post length>

calibre-web  | Fetched 42.4 MB in 6s (6,584 kB/s)
calibre-web  | Selecting previously unselected package libelf1t64:amd64.
(Reading database ... 10141 files and directories currently installed.)


<chopping the non-error build stuff for post length>

calibre-web  | Setting up libxcb-dri3-0:amd64 (1.15-1ubuntu2) ...
calibre-web  | Setting up libwayland-server0:amd64 (1.22.0-2.1build1) ...
calibre-web  | Setting up libx11-xcb1:amd64 (2:1.8.7-1build1) ...
calibre-web  | Setting up libpciaccess0:amd64 (0.17-3build1) ...
calibre-web  | Setting up libxdamage1:amd64 (1:1.1.6-1build1) ...
calibre-web  | Setting up libxcb-xfixes0:amd64 (1.15-1ubuntu2) ...
calibre-web  | Setting up libxrender1:amd64 (1:0.9.10-1.1build1) ...
calibre-web  | Setting up libglvnd0:amd64 (1.7.0-1build1) ...
calibre-web  | Setting up libxtst6:amd64 (2:1.2.3-1.1build1) ...
calibre-web  | Setting up libxcb-glx0:amd64 (1.15-1ubuntu2) ...
calibre-web  | Setting up libedit2:amd64 (3.1-20230828-1build1) ...
calibre-web  | Setting up libsensors-config (1:3.6.0-9build1) ...
calibre-web  | Setting up xkb-data (2.41-2ubuntu1.1) ...
calibre-web  | Setting up libxcb-shm0:amd64 (1.15-1ubuntu2) ...
calibre-web  | Setting up libopengl0:amd64 (1.7.0-1build1) ...
calibre-web  | Setting up libelf1t64:amd64 (0.190-1.1ubuntu0.1) ...
calibre-web  | Setting up libxxf86vm1:amd64 (1:1.1.4-1build4) ...
calibre-web  | Setting up libxcb-present0:amd64 (1.15-1ubuntu2) ...
calibre-web  | Setting up libnspr4:amd64 (2:4.35-1.1build1) ...
calibre-web  | Setting up libxfixes3:amd64 (1:6.0.0-2build1) ...
calibre-web  | Setting up libxcb-sync1:amd64 (1.15-1ubuntu2) ...
calibre-web  | Setting up xz-utils (5.6.1+really5.4.5-1ubuntu0.2) ...
calibre-web  | update-alternatives: using /usr/bin/xz to provide /usr/bin/lzma (lzma) in auto mode
calibre-web  | update-alternatives: warning: skip creation of /usr/share/man/man1/lzma.1.gz because associated file /usr/share/man/man1/xz.1.gz (of link group lzma) doesn't exist
calibre-web  | update-alternatives: warning: skip creation of /usr/share/man/man1/unlzma.1.gz because associated file /usr/share/man/man1/unxz.1.gz (of link group lzma) doesn't exist
calibre-web  | update-alternatives: warning: skip creation of /usr/share/man/man1/lzcat.1.gz because associated file /usr/share/man/man1/xzcat.1.gz (of link group lzma) doesn't exist
calibre-web  | update-alternatives: warning: skip creation of /usr/share/man/man1/lzmore.1.gz because associated file /usr/share/man/man1/xzmore.1.gz (of link group lzma) doesn't exist
calibre-web  | update-alternatives: warning: skip creation of /usr/share/man/man1/lzless.1.gz because associated file /usr/share/man/man1/xzless.1.gz (of link group lzma) doesn't exist
calibre-web  | update-alternatives: warning: skip creation of /usr/share/man/man1/lzdiff.1.gz because associated file /usr/share/man/man1/xzdiff.1.gz (of link group lzma) doesn't exist
calibre-web  | update-alternatives: warning: skip creation of /usr/share/man/man1/lzcmp.1.gz because associated file /usr/share/man/man1/xzcmp.1.gz (of link group lzma) doesn't exist
calibre-web  | update-alternatives: warning: skip creation of /usr/share/man/man1/lzgrep.1.gz because associated file /usr/share/man/man1/xzgrep.1.gz (of link group lzma) doesn't exist
calibre-web  | update-alternatives: warning: skip creation of /usr/share/man/man1/lzegrep.1.gz because associated file /usr/share/man/man1/xzegrep.1.gz (of link group lzma) doesn't exist
calibre-web  | update-alternatives: warning: skip creation of /usr/share/man/man1/lzfgrep.1.gz because associated file /usr/share/man/man1/xzfgrep.1.gz (of link group lzma) doesn't exist
calibre-web  | Setting up libxrandr2:amd64 (2:1.5.2-2build1) ...
calibre-web  | Setting up libsensors5:amd64 (1:3.6.0-9build1) ...
calibre-web  | Setting up libglapi-mesa:amd64 (24.2.8-1ubuntu1~24.04.1) ...
calibre-web  | Setting up libvulkan1:amd64 (1.3.275.0-1build1) ...
calibre-web  | Setting up libxcb-dri2-0:amd64 (1.15-1ubuntu2) ...
calibre-web  | Setting up libxshmfence1:amd64 (1.3-1build5) ...
calibre-web  | Setting up libxcb-randr0:amd64 (1.15-1ubuntu2) ...
calibre-web  | Setting up libxkbfile1:amd64 (1:1.1.0-1build4) ...
calibre-web  | Setting up libdrm-common (2.4.122-1~ubuntu0.24.04.1) ...
calibre-web  | Setting up libxcomposite1:amd64 (1:0.4.5-1build3) ...
calibre-web  | Setting up libxkbcommon0:amd64 (1.6.0-1build1) ...
calibre-web  | Setting up libwayland-client0:amd64 (1.22.0-2.1build1) ...
calibre-web  | Setting up libllvm19:amd64 (1:19.1.1-1ubuntu1~24.04.2) ...
calibre-web  | Setting up libnss3:amd64 (2:3.98-1build1) ...
calibre-web  | Setting up libdrm2:amd64 (2.4.122-1~ubuntu0.24.04.1) ...
calibre-web  | Setting up libdrm-amdgpu1:amd64 (2.4.122-1~ubuntu0.24.04.1) ...
calibre-web  | Setting up libdrm-radeon1:amd64 (2.4.122-1~ubuntu0.24.04.1) ...
calibre-web  | Setting up libdrm-intel1:amd64 (2.4.122-1~ubuntu0.24.04.1) ...
calibre-web  | Setting up mesa-libgallium:amd64 (24.2.8-1ubuntu1~24.04.1) ...
calibre-web  | Setting up libgbm1:amd64 (24.2.8-1ubuntu1~24.04.1) ...
calibre-web  | Setting up libgl1-mesa-dri:amd64 (24.2.8-1ubuntu1~24.04.1) ...
calibre-web  | Setting up libegl-mesa0:amd64 (24.2.8-1ubuntu1~24.04.1) ...
calibre-web  | Setting up libegl1:amd64 (1.7.0-1build1) ...
calibre-web  | Setting up libglx-mesa0:amd64 (24.2.8-1ubuntu1~24.04.1) ...
calibre-web  | Setting up libglx0:amd64 (1.7.0-1build1) ...
calibre-web  | Setting up libgl1:amd64 (1.7.0-1build1) ...
calibre-web  | Processing triggers for libc-bin (2.39-0ubuntu8.4) ...
calibre-web  | Installing Calibre version v8.3.0
calibre-web  | Creating symlinks...
calibre-web  |  Symlinking /app/calibre/ebook-device to /usr/bin/ebook-device
calibre-web  |  Symlinking /app/calibre/ebook-meta to /usr/bin/ebook-meta
calibre-web  |  Symlinking /app/calibre/ebook-convert to /usr/bin/ebook-convert
calibre-web  |  Symlinking /app/calibre/ebook-polish to /usr/bin/ebook-polish
calibre-web  |  Symlinking /app/calibre/markdown-calibre to /usr/bin/markdown-calibre
calibre-web  |  Symlinking /app/calibre/web2disk to /usr/bin/web2disk
calibre-web  |  Symlinking /app/calibre/calibre-server to /usr/bin/calibre-server
calibre-web  |  Symlinking /app/calibre/lrf2lrs to /usr/bin/lrf2lrs
calibre-web  |  Symlinking /app/calibre/lrs2lrf to /usr/bin/lrs2lrf
calibre-web  |  Symlinking /app/calibre/calibre-debug to /usr/bin/calibre-debug
calibre-web  |  Symlinking /app/calibre/calibredb to /usr/bin/calibredb
calibre-web  |  Symlinking /app/calibre/calibre-parallel to /usr/bin/calibre-parallel
calibre-web  |  Symlinking /app/calibre/calibre-customize to /usr/bin/calibre-customize
calibre-web  |  Symlinking /app/calibre/fetch-ebook-metadata to /usr/bin/fetch-ebook-metadata
calibre-web  |  Symlinking /app/calibre/calibre-smtp to /usr/bin/calibre-smtp
calibre-web  |  Symlinking /app/calibre/calibre to /usr/bin/calibre
calibre-web  |  Symlinking /app/calibre/lrfviewer to /usr/bin/lrfviewer
calibre-web  |  Symlinking /app/calibre/ebook-viewer to /usr/bin/ebook-viewer
calibre-web  |  Symlinking /app/calibre/ebook-edit to /usr/bin/ebook-edit
calibre-web  | Setting up command-line completion...
calibre-web  | Installing zsh completion to: /usr/share/zsh/vendor-completions/_calibre
calibre-web  | Failed to find directory to install bash completions, using default.
calibre-web  | Installing bash completion to: /usr/share/bash-completion/completions/
calibre-web  |
calibre-web  | ____________________ WARNING ____________________
calibre-web  | Setting up completion failed with error:
calibre-web  | __________________________________________________
calibre-web  |
calibre-web  |
calibre-web  | Failed to import PyQt module: PyQt6.QtWebEngineCore with error: libasound.so.2: cannot open shared object file: No such file or directory
calibre-web  | xdg-desktop-menu: No writable system menu directory found.
calibre-web  |  Traceback (most recent call last):
calibre-web  |    File "calibre/linux.py", line 838, in setup_completion
calibre-web  |    File "calibre/linux.py", line 588, in write_completion
calibre-web  |    File "bypy-importer.py", line 279, in exec_module
calibre-web  |    File "calibre/gui2/tweak_book/main.py", line 12, in <module>
calibre-web  |    File "bypy-importer.py", line 279, in exec_module
calibre-web  |    File "calibre/ebooks/oeb/polish/check/css.py", line 12, in <module>
calibre-web  |  ImportError: cannot import name 'QWebEnginePage' from 'qt.webengine' (/app/calibre/lib/calibre-extensions/python-lib.bypy.frozen/qt/webengine.pyc)
calibre-web  |
calibre-web  | Setting up desktop integration...
calibre-web  |
calibre-web  | ____________________ WARNING ____________________
calibre-web  | Setting up desktop integration failed with error:
calibre-web  | __________________________________________________
calibre-web  |
calibre-web  |
calibre-web  |  Traceback (most recent call last):
calibre-web  |    File "calibre/linux.py", line 859, in setup_desktop_integration
calibre-web  |    File "calibre/linux.py", line 881, in do_setup_desktop_integration
calibre-web  |    File "calibre/linux.py", line 961, in install_xdg_junk
calibre-web  |    File "subprocess.py", line 413, in check_call
calibre-web  |  subprocess.CalledProcessError: Command 'xdg-desktop-menu install --noupdate ./calibre-gui.desktop' returned non-zero exit status 3.
calibre-web  |
calibre-web  | Creating un-installer: /usr/bin/calibre-uninstall
calibre-web  |
calibre-web  |
calibre-web  | There were 2 warnings
calibre-web  |
calibre-web  | * Setting up completion failed with error:
calibre-web  |
calibre-web  | * Setting up desktop integration failed with error:
calibre-web  |
calibre-web  | **** The 2 warnings above about setting up completion and desktop integration are expected and harmless. You can safely ignore them. ****
calibre-web  | [custom-init] No custom files found, skipping...
calibre-web  | Connection to localhost (::1) 8083 port [tcp/*] succeeded!
calibre-web  | [ls.io-init] done.

When I access the web UI, I get the error;

DB Location is not Valid, Please Enter Correct Path

but when I shell into the container, /books is mounted;

drwxrwxrwx 401 1027 users 20480 Apr 27 20:10 books/

And more perplexing - the database is there.

from the container bash shell, I can head the calibre database;

head metadata.db 
11Ytablebooks_ratings_linkbooks_ratings_linkCREATE TABLE books_ratings_link ( id INTEGER PRIMARY KEY,
                                          book INTEGER NOT NULL,
                                          rating INTEGER NOT NULL,
                                          UNIQUE(book, rating)
                                        )CW1indexsqlite_autoindex_books_ratings_link_1books_ratings_link[
                                                                                                         77Utablebooks_publishers_linkbooks_publishers_link
                             CREATE TABLE books_publishers_link ( id INTEGER PRIMARY KEY,
                                          book INTEGER NOT NULL,
                                          publisher INTEGER NOT NULL,
                                          UNIQUE(book)
                                        )I
J       //Ctablebooks_plugin_databooks_plugin_dataqlite_autoindex_books_publishers_link_1books_publishers_link
CREATE TABLE books_plugin_data(id INTEGER PRIMARY KEY,

Which looks pretty valid to me…

So, what is going on? how come I can see the database from the container shell, but not from the calibreweb app?

any help is gratefully received!

This is PUID and PGID, isn’t it…?

1000 is not 1027

It’s not…
but I get almost exactly the same behaviour running the container with PUID=1027 and PGID=100…

on the underlying linux, I see a UID/GID of

inside the container, thats abc/users - which maps to 1027/100.

and again, I can open the file and compare in both the host OS and container. the file is visible…

the permissions are 777 - that’s the thing that’s getting me here - i would have thought that chmod everything to 777 would be a bit OTT but also make it work…

I just came to chime in, there is no database in existence that supports running on a file-based remote mount, which is what both smb and nfs are. Could it work? sure, it’ll eventually get corrupted if it does. Databases support block based remote storage just fine, so if you must use remote storage, look into that.

that said, while 777 makes 0 sense as you’ve basically renamed every file to end in .exe (to put it in windows terms) the file is world readable, so the incorrect puid/pgid should not make a difference. I would lean towards this being something else.

I will close my comment with, we do not provide support for leveraging remote mounts, even if a database was not involved, the setup involved too many moving parts for us to try to assist users on this.

I got to the bottom of this, which I will add here because people who post “fixed it” but don’t tell people how they did are a scourge on the earth :smiley:

from Linux and the container, the permissions appear to be 777 - however, enabling SSH on the NAS and looking there shows that the permissions on some of the node and leaf folders in the synology environment are chmodded to 000.

Frankly, it’s a complete dog’s breakfast and seems to have no rhyme nor reason to it - some folders are 777, some are 000, some are 755… and the synology apps seem to handle this “on the fly”.

So, to get it working, setting 766 to each folder between the NFS mount and the “books” folder made this work instantly, no change needed on the docker side.

I fully agree with driz’s comments on 777. that’s playing with fire. FWIW, that was not something I chose - NFS mounting just seems to do that (and incidentally, the docker containers seem to set 777 on imported volumes without being asked as well)

TL&DR to any future person reading, this is a Synology problem, not a docker or LSIO issue.

on driz’s other points, that’s absolutely fair comment.

I am NFS mounting between my general purpose Docker box, and the synology where all of my media stuff was previously stored as a learn and play exercise - this config was the “suck it and see” to see if I wanted to invest the time, effort and kit into buildling the *arr ecosystem out properly.

I think we have learned enough from this exercise to do that and buy some nice big disks for the docker box.

In the n+1 version of this setup, the media and docker containers will be local to each other.

Don’t do what I did and then run it in “production” kids… :wink:

ahh i apologize, i missed this was synology. they use non-standard ACLs HEAVILY.
glad you got it sorted but i hope you are backing up your database for when it inevitably corrupts due to the unsupported use!