- Edited
sean I'm getting 'malformed database schema' when trying to read my calibre-db. This could be related to the version of Sqlite3 which is 3.7.17 on the server. Is there a fix for this?
sean I'm getting 'malformed database schema' when trying to read my calibre-db. This could be related to the version of Sqlite3 which is 3.7.17 on the server. Is there a fix for this?
HelenaGwyn there is a newer version of sqlite available in /usr/sqlite330/bin/
so try running export PATH=/usr/sqlite330/bin/:$PATH
then repeat whatever it is you were attempting to do.
sean Still no luck. Same error. No idea why. It just won't read the database, even an empty one newly created with Calibre.
HelenaGwyn where exactly do you see the error message?
sean When trying to load the database it gives me 'DB Location is not Valid, Please Enter Correct Path' in the interface. If I check $HOME/.calibre-web/calibre-web.log I see the details that lead up to this message. I did some searching and came across this page https://github.com/janeczku/calibre-web/issues/1633 but updating sqlite didn't solve it for me sadly.
HelenaGwyn ok, please try this:
pip3 install pysqlite3-binary
env/bin/cps
to add the following lines just after import sys
:__import__('pysqlite3')
sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
cps
process and restart it.sean Thank you, that solved it, Calibre-Web up and running.
HelenaGwyn Nice, I honestly wasn't sure if that would work!
Note that you'll need to make that last change again if you ever update the calibreweb Python package.
Eventually we'll have an updated OS with newer software so that things like these sqlite3 gymnastics won't be necessary
sean Hi again,
I've been toying with nextcloud, apps, calibreweb, syncing, ... on opalstack and on hetzner and I came to a few conclusions and a new question.
It turns out hetzner doesn't support external storage because of security reasons, so connecting another server to their nextcloud isn't possible.
Connecting a hetzner-nextcloud to an opalstack-instance is possible. But from what I understand it doesn't sync an an external storage locally. It just provides a webinterface to the external storage and temporarily caches it.
If I want to use Calibreweb on opalstack the files have to be somewhere within my user on opalstack.
I saw there is a nextcloudmd-client (https://docs.nextcloud.com/desktop/3.4/advancedusage.html#install-nextcloudcmd) that can be triggered to sync a nextcloud-account. But I assume using rclone with a cronjob might to the same thing?
My setup would be installing calibreweb on opalstack and using rclone to daily sync my ebooklibrary with my nextcloud at hetzner which syncs with calibre on my laptop amongst other things.
Do you consider that the best solution given the current situation? (until opalstack comes with similar storage solutions ).
HelenaGwyn I don't think nextcloudcmd would help with this. That tool syncs from a Nextcloud instance to a client directory, but it doesn't sync files between 2 Nextcloud instances, which I think is what you want to do?
If you use rclone (or any other external sync tool) to sync files directly into the Nextcloud filesystem, ie into ~/apps/nextcloud/data/username/files
then you'll need to tell Nextcloud to sync up its database after the file sync is complete. The commands to do that are:
cd ~/apps/nextcloud
php74 occ files:scan --all
So you'd need to incorporate that into whatever cron job you run for your sync.
sean I want one location to sync all my files with (on hetzner in this case) and serve my ebooklibrary with calibreweb on opalstack. Connecting two nextcloud-instances doesn't work for this use case from what I understand. Calibreweb needs to be pointed to the folder with the database and files. Adding an external storage in nextcloud, doesn't sync the external files, it just shows them in the webinterface. Or I don't know where to look for them.
At the moment there's no need to sync directly with a nextcloud on opalstack, I just want my ebooklibrary served on opalstack.
HelenaGwyn in that case I think you should be able to use any sync tool (rclone, rsync, whatever) to sync the Calibre library directories on each end.
sean Is it ok or allowed to use rclone mount
to have the external library connected to CalibreWeb. The documentation says it needs rclone mount --vfs-cache-mode=full --file-perms=0777 cloud:Calibre_folder local:mountpoint
to be able to work.
HelenaGwyn yes, you should be able to use rclone mount
.
Hi, I would like to serve multiple libraries as subfolders under the same domain: domain.ext/ebooks, domain.ext/courses, ...
How do I implement this? I found this in calibre-web's documentation: https://github.com/janeczku/calibre-web/wiki/FAQ#how-to-handle-multiple-calibre-libraries
Or can I just create two python-apps under the same shelluser and a private nginx with a configuration found at: https://github.com/janeczku/calibre-web/issues/19#issuecomment-220866727.
HelenaGwyn I think you'll need to combine both, ie you'll need to run a separate instance of calibreweb for each library and then wire them all up to a private Nginx instance.
For each additional instance of calibreweb you'll need to create a new "Nginx Proxy Port" app and then start a new instance of the existing cps
script listening on the new port assignment and pointing at a new database, eg:
# replace NNNNN with your port assignment
export CALIBRE_PORT=NNNNN
# replace XXXXX with the library name
( nohup ~/apps/name_of_app/env/bin/cps -i 127.0.0.1 -p $HOME/.calibre-web/XXXXX-app.db -g $HOME/.calibre-web/XXXXX-gdrive.db >> ~/logs/apps/name_of_app/name_of_app.log 2>&1 & )
Then in your Nginx instance config, each Calibreweb instance will get a location block like so:
# replace XXXXX and NNNNN with your library name and port assignment as above.
location /XXXXX {
proxy_pass http://127.0.0.1:NNNNN;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Script-Name /XXXXX;
}
sean Thanks, all give it a try.
I won't be using Google Drive for my storage though but a nextcloud-instance mounted with rclone. So I assume that just means leaving out the -g variable and configuring the database)location during the setup of the instance itself. Is $HOME/.calibreweb/<library_name> the best location to mount my database-folders?
And I had already been trying with two python-apps. I tried deleting the second one (comics_library on Opal9), which still had a mounted folder in it when initiating the deletion. I unmoutend and removed the folder afterwards, but the 'deleting' seems to be stuck. I assume that's something you have resolve?
HelenaGwyn So I assume that just means leaving out the -g variable and configuring the database)location during the setup of the instance itself.
In my testing Calibreweb created a gdrive database whether I told it to or not. If you run into problems without specifying the path then go ahead and include it as I've shown.
HelenaGwyn Is $HOME/.calibreweb/<library_name> the best location to mount my database-folders?
$HOME/.calibre-web
is the default location that Calibreweb sets up, you're free to change it if you like.
HelenaGwyn the 'deleting' seems to be stuck. I assume that's something you have resolve?
Yep, something was stuck on our end. All clear now!
sean I'm new to configuring nginx. I managed to install the private instance with a default app for the root, but adding the locations for the subfolders keeps on giving me 'Not found'.
I'm also not able to stop or kill the uwsgi somehow.
HelenaGwyn Ok, please email support with the details and someone on our team will have a look.