‘DB Location is not Valid’ for calibre-web - But Calibre desktop works fine

I’ve been a user of Calibre desktop for years. I have my library located in a Synology NAS Server (\\server\library\Calibre) which I access with my NAS user account.

Decided to give Calibre-Web a try, but trying to follow countless of videos and tutorials, I keep having the same problem. When I try to give /books as the path to my library metadata file, it keeps say it is invalid (spoiler: it is not).

I have mapped /library/Calibre/ to /books successfully, as I can terminal into the Docker image and see it for myself: Here is it me BASHing into the container:

root@calibre-web:/# cd /books                                                    
root@calibre-web:/books# ls metadata*                                            
metadata.db  metadata_db_prefs_backup.json                                       
root@calibre-web:/books# cp metadata.db metadata.writetest                       
root@calibre-web:/books# ls metadata*                                            
metadata.db  metadata_db_prefs_backup.json  metadata.writetest                   
root@calibre-web:/books#

Since I feel you nice people might ask me for the following command, here it is :slight_smile:

myuser@synology:~$ sudo docker exec -it calibre-web ls -la /books/ | grep metadata
---------- 1 1024 users 1558528 Aug 28 16:53  metadata.db
---------- 1 1024 users   18422 Aug 28 16:53  metadata_db_prefs_backup.json
---------- 1 root root  1558528 Aug 28 18:05  metadata.writetest

For the PUID and PGID variables, I used the values of my Synology NAS account, which has read-write access:
PUID=1026
PGID=100

myuser@synology:~$ id
uid=1026(myuser) gid=100(users) groups=100(users),101(administrators)

It is the same account I use to access the Calibre library via SMB, and I never had issues with it.

In case one’s wondering, my /config seems to have been mounted correctly, and it is writing files in the directory. I can see the files outside the container, when browsing my NAS (including the logfile). From SSHing into the Synology NAS:

myuser@synology:~$ sudo docker exec -it calibre-web ls -la /config
total 152
drwxr-xr-x 1 abc  users    106 Aug 28 17:50 .
drwxr-xr-x 1 root root     288 Aug 28 17:22 ..
-rwxr-xr-x 1 abc  users 118784 Aug 28 17:28 app.db
-rwxr-xr-x 1 abc  users   2558 Aug 28 17:50 calibre-web.log
-rwxr-xr-x 1 abc  users      3 Aug 28 17:22 client_secrets.json
-rwxr-xr-x 1 abc  users  24576 Aug 28 17:23 gdrive.db
-rwxr-xr-x 1 abc  users     44 Aug 28 17:23 .key

And why not from within the docker itself:

root@calibre-web:/books# ls -la /config                                          
total 152                                                                        
drwxr-xr-x 1 abc  users    106 Aug 28 17:50 .                                    
drwxr-xr-x 1 root root     288 Aug 28 17:22 ..                                   
-rwxr-xr-x 1 abc  users 118784 Aug 28 17:28 app.db                               
-rwxr-xr-x 1 abc  users   2558 Aug 28 17:50 calibre-web.log                      
-rwxr-xr-x 1 abc  users      3 Aug 28 17:22 client_secrets.json                  
-rwxr-xr-x 1 abc  users  24576 Aug 28 17:23 gdrive.db                            
-rwxr-xr-x 1 abc  users     44 Aug 28 17:23 .key

Other than bashing my head on the wall, I’m out of ideas. What am I doing wrong?

Here are the logs files: pastebin.com/4SiFzv4H

As it often happens, I took my time to post this question, gather all the logs, etc. And then after I post it, I decided to try just one more thing :laughing:

I changed the PGID from 100 (users) to 101 (administrators), and it worked!

Before I mark this as I solution, I wonder if this is the right approach, though.

you were probably hitting some of the synology ACLs that cause numerous people problems, from a pure linux perspective, nothing has permissions


so using what i can only assume is synology root user, fixed it.

to answer your question, no, it’s not the correct fix, but i avoid synology like the plague so i can’t tell you specifically what is. Proper permissions, including fixing ACLs would be what is needed. at a minimum files would be something like 664 and folders 775, with 1026 (this is what you show as the id, rather than 1024) and 100 for puid/pgid respectively. After that, you deal with the syno acl.

that all said, if this works for you and you’re ok with the risk of having an admin user owning the contents, then stay with the it-works-for-you. i would encourage you to figure out how to handle the ACLs though

1 Like

I figured it wasn’t the best solution, although I was puzzled. This is the first contained I ever had problems with. No idea why it showed that I didn’t have permission, since the user I used has permission on those directories.

But then I then had a look at the permission of the Library shared location:

You can see that it has permission to read/write because I’m in the admin group, but not because my user had read/write directly assigned to it. So I gave the user direct read/write permissions.

This change will not take effect until the container is restarted. Once restarted, doing an ls -la would show the right permissions.

myuser@synology:~$ sudo docker exec -it calibre-web ls -la /books | grep metadata
-rwx------ 1 abc  users 1558528 Aug 28 18:33  metadata.db
-rwx------ 1 abc  users   18422 Aug 28 18:34  metadata_db_prefs_backup.json

Before I restarted the contained, I changed the PGID back to 100, now that my user has the right permissions – and it worked!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.