Calibre not able to write on mounted (cifs) volume
-
@girish said in New: Not able to write on mounted volume:
@odie said in New: Not able to write on mounted volume:
Sep 11 08:39:41[2023-09-11 06:39:41,825] ERROR {cps.config_sql:384} (sqlite3.OperationalError) unable to open database: /media/CalibreLibNFS/metadata.db
I think this error is different from the previous one. Does the above file exist / have right permissions ?
It is the same file on the remote share (it's just an NFS mount). It has the same permissions. It has these permissions:
-rw-rw-rw-
Incidentally, the problem description suggestion you make in post #2 is perhaps accurate. I notice that the files are uploaded to the mounted folder when adding via calibre-web interface. However, I cannot change/edit metadata (when mounting as CIFS). Like I said in post #4, when the folder is mounted as an NFS share, I get the Error 500.
Also, like I said in my initial post - when the calibre app is restarted (via the cloudron dashboard), the database location is not stored persistent. This happens with both NFS and CIFS mounted volumes.
-
@odie OK, I understand the situation a bit better now. There are 2 problems:
- Moving the library does not work. The package keeps resetting the library location. I am working on fix this.
- Database cannot be moved. Do you mean calibre's own database here (app.db) or do you mean the library database? If it's the latter, I am working on fixing that above. If it's the former, can you clarify why you want to move this? It's just a very small sqlite database.
-
@girish said in Calibre not able to write on mounted (cifs) volume:
@odie Can you please check with the latest package? The library can now be moved wherever you want (of course, not to a cifs volume).
Hello @girish,
I checked with the new image, and database location is now changed persistently. It remembers the location across restarts and across the upgrade.I have a two questions which I would love to get your advice on (related to the fact that cifs volumes don’t handle the permissions). I really would like to keep the database on my cifs storage, so that the client computers with calibre desktop can still use the database.
-
Where on my linux server would you recommend me setting up a clean database (path)? My Cloudron runs on a single purpose pc (only Cloudron installed). Where could this folder be placed?
-
How can I setup an automatic synchronization between this location and my CIFS storage, ignoring permissions but keeping a two way sync going? It doesn’t have to be real time, but it needs to be automatic.
Thanks!
-
-
@odie said in Calibre not able to write on mounted (cifs) volume:
I really would like to keep the database on my cifs storage, so that the client computers with calibre desktop can still use the database.
Is this because you are on Windows ?
The upstream project does not support having a library in CIFS. I think you will have ask upstream for a workaround and then we can try to see how we can set things up on Cloudron side.
I also don't know how things will work out if you just rsync a calibre library between computers (given that this won't be atomic?). I don't have that much experience with calibre database internals.
-
@girish said in Calibre not able to write on mounted (cifs) volume:
@odie said in Calibre not able to write on mounted (cifs) volume:
I really would like to keep the database on my cifs storage, so that the client computers with calibre desktop can still use the database.
Is this because you are on Windows ?
The upstream project does not support having a library in CIFS. I think you will have ask upstream for a workaround and then we can try to see how we can set things up on Cloudron side.
I also don't know how things will work out if you just rsync a calibre library between computers (given that this won't be atomic?). I don't have that much experience with calibre database internals.
I have a couple of devices running Windows and Mac, that all use the Calibre Desktop (I work from different places, so it's easier that way). They all have a local Calibre Libray, which is then synced to this network share that I also access from the Cloudron Calibre Web app. This strategy enables me to keep all Calibre Libraries in sync - I can make changes on one computer, and these sync to different computers via the cifs share. I was hoping that this strategy would also work on Calibre Web as well. It would be useful to be able to do quick edits (e.g. metadata edits), or the occasional upload also on web.
-
@girish said in Calibre not able to write on mounted (cifs) volume:
@odie how do you sync between the computers? rsync with a cron job?
I probably should have used rsync, but I've always found it easier with point&click.... On my Macs, I use FreeFileSync (https://freefilesync.org/) and on Windows, I use SyncBackFree (https://www.2brightsparks.com/). It is sufficient for me to syn every 4 hours, so I use scheduled syncs.
-
@odie so, just to take a step back. If we ignore all this CIFS stuff ...
On Cloudron the library is at
/app/data/library
by default. This maps to the host path at/home/yellowtent/appsdata/<appid>/data/library
(might want to double check this path). Is that path not enough to sync via ssh? -
@girish said in Calibre not able to write on mounted (cifs) volume:
@odie so, just to take a step back. If we ignore all this CIFS stuff ...
On Cloudron the library is at
/app/data/library
by default. This maps to the host path at/home/yellowtent/appsdata/<appid>/data/library
(might want to double check this path). Is that path not enough to sync via ssh?Thanks. I've been moderately successful with this.
I can sync using rsync and the -rz (and rzv, rzP) flags.
The syntax I use is:
rsync -rz /CIFSshare/ /home/yellowtent/appsdata/<appid>/data/library
This way, I manage to sync from the CIFS mount to the /home/yellowtent/appsdata/<appid>/data/library folder. Calibre-web now runs with a writeable database.
Two minor problems with this:
- using the -r option, everything syncs on every subsequent execution of the command (ie all files are copied from the CIFSshare)
- using the -a option instead of -r, the database would be writeable on first sync. But using the -a option resulted in a locked db on second, third etc. run.
The bigger problem is this:
When I use rsync, changes I make on the Cloudron/calibre-web app are not synced back to the NAS folder. So basically, this leaves me to lose edits made via Calibre-web on Cloudron every time I update the library from one of the clients (since local changes on Cloudron calibre-web are not synced to the CIFS share). Relying on a manual sync after every library update on Calibre-web is next to impossible (I often read on my mobile devices, and I like to edit metadata while reading).So basically, it almost appears safer to keep the library on a read-only CIFSshare...
-