• General
  • Connecting Nextcloud, Calibre-Web and External Storage

sean I'm just getting "Hello World!" right now. In the log-file it says

usage: cps.py [-h] [-p path] [-g path] [-c path] [-k path] [-v]
[-i ip-address] [-s user:pass] [-f] [-l] [-d] [-r]
cps.py: error: unrecognized arguments: 127.0.0.1

I tried adding -i or another IP, then it started, but I don't know how to actually reach it.

And when creating a nextcloud application, it failed and the log showed:

Started at 1970-01-01 00:00:00
UUID validation and server lookup OK.
Admin email lookup OK.
DB user creation failed.

  • sean replied to this.

    HelenaGwyn You'll have to stop the uwsgi server before you run cps, and it looks like there was a typo in the final step (-l instead of -i). I've corrected the instructions.

    Sorry about that, I'm making this up as I go! 🤣

    Regarding Nextcloud, it's likely that you used a common app name (like "nextcloud", "cloud", etc) that was already in use on your shared server, so when the installer attempted to create a matching database for the application the install failed. To work around that, delete the failed app and then create a new one with a unique name that's less likely to conflict with the name of a pre-existing DB.

      sean Sorry, still not working for me. Without starting I get a 502 although the cps-process is running.
      I'm not that much familiar with Python, so I might be overlooking something.

      Nextcloud is working, thanks!

      • sean replied to this.

        HelenaGwyn I think your app got auto-configured to use the wrong port. To fix this, delete your ~/.calibre-web directory on the server then repeat the commands in step 2 above. If that doesn't solve it then please email support so that we can take a closer look.

          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 replied to 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.

              • sean replied to this.

                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.

                • sean replied to this.

                  HelenaGwyn ok, please try this:

                  1. Activate your app's environment.
                  2. Install pysqlite3-binary: pip3 install pysqlite3-binary
                  3. Edit env/bin/cps to add the following lines just after import sys:

                    __import__('pysqlite3')
                    sys.modules['sqlite3'] = sys.modules.pop('pysqlite3')
                  1. Deactivate the environment and then re-activate it.
                  2. Stop the running cps process and restart it.

                    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 🙂

                      16 days later

                      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 🙂).

                      • sean replied to this.

                        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.

                          • sean replied to this.

                            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.

                              9 months later

                              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.

                              • sean replied to this.
                                2 months later

                                sean

                                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.

                                • sean replied to this.
                                  Mastodon