COPS server. Again. Sorry

Hello,

A few months ago I followed this guide while installing COPS server on a Pi2 running DietPi OS v6.3. I didn’t have much of a clue what I was doing and was pleasantly surprised that it worked out OK.

I’m now trying to install COPS on to a Cubox-i running the latest DietPi. The Cubox’s DietPi delivered via the bash script which converted Armbian to DietPi v7.9.

As before, I’ll be putting the Calibre library on usb storage. With Syncthing copying the library from my PC to the Cubox. Syncthing is working fine. As is the ProFTP file server and all of DietPi’s settings and configurations. However, the same can’t be said for COPS. I followed the step-by-step instructions like last time but either I’ve made some stupid mistake (highly likely) or some changes to DietPi and Debian Bullseye have made the instructions unworkable.

Does anyone have an idea what’s gone wrong and how I could get my e-book library back?

I should mention that Ubooquity or Komga aren’t an option because they don’t play well with my e-reader’s web browser.

well you could have started sharing some error messages you are facing. :wink:

On the other hand side, probably COPS is not working on Bullseye anymore. I see COPS has not been updated for 2.5 years. Probably it did not work probably with Bullseye libraries and/or actual PHP version? I see you already opened same question with COPS Github https://github.com/seblucas/cops/issues/509

Sorry about the lack of info. It’s just that nothing happens. Not even an error report. And to be honest, aside from some report during the initial terminal work, I wouldn’t know where to look for error messages.

If COPS isn’t going to work do you have any idea how to install Calibre-web? I’ve tried following their instructions but each time I see a huge number of red errors during the install process. I also tried installing via Docker, but that didn’t work either.

If you can get Calibre-web working then it might be worth considering as an addition to DietPi? Ubooquity is discontinued and web access is too demanding for most e-readers. The alternative of Komga is great for comics but not for e-books. It sorts books by title. It doesn’t have an option to sort and present by author name; which can make it near impossible to find what you’re looking for in large e-book collection.

what system your are running

Required Information

  • DietPi version | cat /boot/dietpi/.version
  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
  • Kernel version | uname -a
  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)

G_DIETPI_VERSION_CORE=7
G_DIETPI_VERSION_SUB=9
G_DIETPI_VERSION_RC=3
G_GITBRANCH=‘master’
G_GITOWNER=‘MichaIng’
G_LIVE_PATCH_STATUS[0]=‘applied’
G_LIVE_PATCH_STATUS[1]=‘not applicable’
G_LIVE_PATCH_STATUS[2]=‘not applicable’
G_LIVE_PATCH_STATUS[3]=‘not applicable’

bullseye

Linux DietPi 5.10.60-imx6 #21.08.1 SMP Wed Aug 25 19:08:13 UTC 2021 armv7l GNU/Linux

Generic Device (armv7l) or Cubox-i I2U-300D

I don’t have such a device like you. Therefore I used a RPi3B+ running ARMv7 Bullseye and installation of calibreweb was running quite well as I could use pre-compiled wheels from piwheels.org

root@DietPi3:~# pip3 install calibreweb
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple/
Collecting calibreweb
  Downloading https://www.piwheels.org/simple/calibreweb/calibreweb-0.6.14-py3-none-any.whl (6.7 MB)
     |████████████████████████████████| 6.7 MB 51 kB/s
Collecting iso-639<0.5.0,>=0.4.5
  Downloading https://www.piwheels.org/simple/iso-639/iso_639-0.4.5-py3-none-any.whl (171 kB)
     |████████████████████████████████| 171 kB 1.1 MB/s
Collecting PyPDF3<1.0.4,>=1.0.0
  Downloading https://www.piwheels.org/simple/pypdf3/PyPDF3-1.0.3-py3-none-any.whl (62 kB)
     |████████████████████████████████| 62 kB 483 kB/s
Collecting flask-wtf<0.16.0,>=0.14.2
  Downloading https://www.piwheels.org/simple/flask-wtf/Flask_WTF-0.15.1-py2.py3-none-any.whl (13 kB)
Collecting Babel<3.0,>=1.3
  Downloading https://www.piwheels.org/simple/babel/Babel-2.9.1-py2.py3-none-any.whl (8.8 MB)
     |████████████████████████████████| 8.8 MB 1.9 MB/s
Collecting Wand<0.7.0,>=0.4.4
  Downloading https://www.piwheels.org/simple/wand/Wand-0.6.7-py3-none-any.whl (140 kB)
     |████████████████████████████████| 140 kB 1.1 MB/s
Collecting Flask-Login<0.5.1,>=0.3.2
  Downloading https://www.piwheels.org/simple/flask-login/Flask_Login-0.5.0-py2.py3-none-any.whl (16 kB)
Collecting requests<2.25.0,>=2.11.1
  Downloading https://www.piwheels.org/simple/requests/requests-2.24.0-py2.py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 50 kB/s
Collecting unidecode<1.3.0,>=0.04.19
  Downloading https://www.piwheels.org/simple/unidecode/Unidecode-1.2.0-py2.py3-none-any.whl (241 kB)
     |████████████████████████████████| 241 kB 2.3 MB/s
Collecting lxml<4.7.0,>=3.8.0
  Downloading https://www.piwheels.org/simple/lxml/lxml-4.6.5-cp39-cp39-linux_armv7l.whl (6.6 MB)
     |████████████████████████████████| 6.6 MB 121 kB/s
Collecting tornado<6.2,>=4.1
  Downloading https://www.piwheels.org/simple/tornado/tornado-6.1-cp39-cp39-linux_armv7l.whl (421 kB)
     |████████████████████████████████| 421 kB 863 kB/s
Collecting Flask<2.1.0,>=1.0.2
  Downloading https://www.piwheels.org/simple/flask/Flask-2.0.2-py3-none-any.whl (95 kB)
     |████████████████████████████████| 95 kB 132 kB/s
Collecting Flask-Principal<0.5.1,>=0.3.2
  Downloading https://www.piwheels.org/simple/flask-principal/Flask_Principal-0.4.0-py3-none-any.whl (6.7 kB)
Collecting Flask-Babel<2.1.0,>=0.11.1
  Downloading https://www.piwheels.org/simple/flask-babel/Flask_Babel-2.0.0-py3-none-any.whl (9.3 kB)
Collecting SQLAlchemy<1.5.0,>=1.3.0
  Downloading https://www.piwheels.org/simple/sqlalchemy/SQLAlchemy-1.4.29-cp39-cp39-linux_armv7l.whl (1.6 MB)
     |████████████████████████████████| 1.6 MB 871 kB/s
Collecting backports-abc>=0.4
  Downloading https://www.piwheels.org/simple/backports-abc/backports_abc-0.5-py2.py3-none-any.whl (5.2 kB)
Collecting pytz>=2016.10
  Downloading https://www.piwheels.org/simple/pytz/pytz-2021.3-py3-none-any.whl (511 kB)
     |████████████████████████████████| 511 kB 831 kB/s
Collecting click>=7.1.2
  Downloading https://www.piwheels.org/simple/click/click-8.0.3-py3-none-any.whl (97 kB)
     |████████████████████████████████| 97 kB 727 kB/s
Collecting Werkzeug>=2.0
  Downloading https://www.piwheels.org/simple/werkzeug/Werkzeug-2.0.2-py3-none-any.whl (288 kB)
     |████████████████████████████████| 288 kB 13 kB/s
Collecting itsdangerous>=2.0
  Downloading https://www.piwheels.org/simple/itsdangerous/itsdangerous-2.0.1-py3-none-any.whl (18 kB)
Collecting Jinja2>=3.0
  Downloading https://www.piwheels.org/simple/jinja2/Jinja2-3.0.3-py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 1.1 MB/s
Collecting blinker
  Downloading https://www.piwheels.org/simple/blinker/blinker-1.4-py3-none-any.whl (14 kB)
Collecting WTForms
  Downloading https://www.piwheels.org/simple/wtforms/WTForms-3.0.1-py3-none-any.whl (136 kB)
     |████████████████████████████████| 136 kB 1.8 MB/s
Collecting tqdm
  Downloading https://www.piwheels.org/simple/tqdm/tqdm-4.62.3-py2.py3-none-any.whl (76 kB)
     |████████████████████████████████| 76 kB 401 kB/s
Collecting chardet<4,>=3.0.2
  Downloading https://www.piwheels.org/simple/chardet/chardet-3.0.4-py2.py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 1.5 MB/s
Collecting idna<3,>=2.5
  Downloading https://www.piwheels.org/simple/idna/idna-2.10-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 1.7 MB/s
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Downloading https://www.piwheels.org/simple/urllib3/urllib3-1.25.11-py2.py3-none-any.whl (127 kB)
     |████████████████████████████████| 127 kB 1.3 MB/s
Collecting certifi>=2017.4.17
  Downloading https://www.piwheels.org/simple/certifi/certifi-2021.10.8-py2.py3-none-any.whl (151 kB)
     |████████████████████████████████| 151 kB 3.4 MB/s
Collecting MarkupSafe>=2.0
  Downloading https://www.piwheels.org/simple/markupsafe/MarkupSafe-2.0.1-cp39-cp39-linux_armv7l.whl (25 kB)
Installing collected packages: MarkupSafe, Werkzeug, pytz, Jinja2, itsdangerous, click, WTForms, urllib3, tqdm, idna, Flask, chardet, certifi, blinker, Babel, Wand, unidecode, tornado, SQLAlchemy, requests, PyPDF3, lxml, iso-639, flask-wtf, Flask-Principal, Flask-Login, Flask-Babel, backports-abc, calibreweb
Successfully installed Babel-2.9.1 Flask-2.0.2 Flask-Babel-2.0.0 Flask-Login-0.5.0 Flask-Principal-0.4.0 Jinja2-3.0.3 MarkupSafe-2.0.1 PyPDF3-1.0.3 SQLAlchemy-1.4.29 WTForms-3.0.1 Wand-0.6.7 Werkzeug-2.0.2 backports-abc-0.5 blinker-1.4 calibreweb-0.6.14 certifi-2021.10.8 chardet-3.0.4 click-8.0.3 flask-wtf-0.15.1 idna-2.10 iso-639-0.4.5 itsdangerous-2.0.1 lxml-4.6.5 pytz-2021.3 requests-2.24.0 tornado-6.1 tqdm-4.62.3 unidecode-1.2.0 urllib3-1.25.11
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@DietPi3:~#

After starting, the web site was available ootb


How did you installed Python3? Did you used dietpi-software?


Was testing installation on Rpi4 64bit without issues as well

root@DietPi4:~# pip3 install calibreweb
Collecting calibreweb
  Downloading calibreweb-0.6.14-py3-none-any.whl (6.7 MB)
     |████████████████████████████████| 6.7 MB 236 kB/s
Collecting iso-639<0.5.0,>=0.4.5
  Downloading iso-639-0.4.5.tar.gz (167 kB)
     |████████████████████████████████| 167 kB 2.6 MB/s
  Preparing metadata (setup.py) ... done
Collecting Flask-Principal<0.5.1,>=0.3.2
  Downloading Flask-Principal-0.4.0.tar.gz (5.5 kB)
  Preparing metadata (setup.py) ... done
Collecting flask-wtf<0.16.0,>=0.14.2
  Downloading Flask_WTF-0.15.1-py2.py3-none-any.whl (13 kB)
Collecting Babel<3.0,>=1.3
  Downloading Babel-2.9.1-py2.py3-none-any.whl (8.8 MB)
     |████████████████████████████████| 8.8 MB 132 kB/s
Collecting pytz>=2016.10
  Downloading pytz-2021.3-py2.py3-none-any.whl (503 kB)
     |████████████████████████████████| 503 kB 2.8 MB/s
Collecting tornado<6.2,>=4.1
  Downloading tornado-6.1-cp39-cp39-manylinux2014_aarch64.whl (427 kB)
     |████████████████████████████████| 427 kB 3.1 MB/s
Collecting lxml<4.7.0,>=3.8.0
  Downloading lxml-4.6.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl (6.6 MB)
     |████████████████████████████████| 6.6 MB 3.0 MB/s
Collecting SQLAlchemy<1.5.0,>=1.3.0
  Downloading SQLAlchemy-1.4.29-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.6 MB)
     |████████████████████████████████| 1.6 MB 3.1 MB/s
Collecting PyPDF3<1.0.4,>=1.0.0
  Downloading PyPDF3-1.0.3.tar.gz (227 kB)
     |████████████████████████████████| 227 kB 3.6 MB/s
  Preparing metadata (setup.py) ... done
Collecting unidecode<1.3.0,>=0.04.19
  Downloading Unidecode-1.2.0-py2.py3-none-any.whl (241 kB)
     |████████████████████████████████| 241 kB 3.0 MB/s
Collecting Wand<0.7.0,>=0.4.4
  Downloading Wand-0.6.7-py2.py3-none-any.whl (139 kB)
     |████████████████████████████████| 139 kB 3.1 MB/s
Collecting backports-abc>=0.4
  Downloading backports_abc-0.5-py2.py3-none-any.whl (5.2 kB)
Collecting Flask<2.1.0,>=1.0.2
  Downloading Flask-2.0.2-py3-none-any.whl (95 kB)
     |████████████████████████████████| 95 kB 862 kB/s
Collecting Flask-Login<0.5.1,>=0.3.2
  Downloading Flask_Login-0.5.0-py2.py3-none-any.whl (16 kB)
Collecting requests<2.25.0,>=2.11.1
  Downloading requests-2.24.0-py2.py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 1.7 kB/s
Collecting Flask-Babel<2.1.0,>=0.11.1
  Downloading Flask_Babel-2.0.0-py3-none-any.whl (9.3 kB)
Collecting itsdangerous>=2.0
  Downloading itsdangerous-2.0.1-py3-none-any.whl (18 kB)
Collecting Werkzeug>=2.0
  Downloading Werkzeug-2.0.2-py3-none-any.whl (288 kB)
     |████████████████████████████████| 288 kB 3.1 MB/s
Collecting Jinja2>=3.0
  Downloading Jinja2-3.0.3-py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 3.0 MB/s
Collecting click>=7.1.2
  Downloading click-8.0.3-py3-none-any.whl (97 kB)
     |████████████████████████████████| 97 kB 174 kB/s
Collecting blinker
  Downloading blinker-1.4.tar.gz (111 kB)
     |████████████████████████████████| 111 kB 3.1 MB/s
  Preparing metadata (setup.py) ... done
Collecting WTForms
  Downloading WTForms-3.0.1-py3-none-any.whl (136 kB)
     |████████████████████████████████| 136 kB 3.1 MB/s
Collecting tqdm
  Downloading tqdm-4.62.3-py2.py3-none-any.whl (76 kB)
     |████████████████████████████████| 76 kB 300 kB/s
Collecting idna<3,>=2.5
  Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 258 kB/s
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Downloading urllib3-1.25.11-py2.py3-none-any.whl (127 kB)
     |████████████████████████████████| 127 kB 3.1 MB/s
Collecting certifi>=2017.4.17
  Downloading certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
     |████████████████████████████████| 149 kB 3.2 MB/s
Collecting chardet<4,>=3.0.2
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 3.0 MB/s
Collecting greenlet!=0.4.17
  Downloading greenlet-1.1.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (154 kB)
     |████████████████████████████████| 154 kB 3.2 MB/s
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (26 kB)
Building wheels for collected packages: Flask-Principal, iso-639, PyPDF3, blinker
  Building wheel for Flask-Principal (setup.py) ... done
  Created wheel for Flask-Principal: filename=Flask_Principal-0.4.0-py3-none-any.whl size=5575 sha256=8222e6b5199864833d2a571879b8cd669eeef8f08a74f6c49611718c26051db8
  Stored in directory: /root/.cache/pip/wheels/1c/f5/71/a395458968141d421053db412da8b24f6010d3fbad27d35f2e
  Building wheel for iso-639 (setup.py) ... done
  Created wheel for iso-639: filename=iso_639-0.4.5-py3-none-any.whl size=169061 sha256=8322dc08df7f55f712a8cf00d39407ff2336b03aa59aae93620cc520233377ab
  Stored in directory: /root/.cache/pip/wheels/43/3f/de/07f35ac2a2cd11ff30224e3fc6fbf458d7fc95effb1f673431
  Building wheel for PyPDF3 (setup.py) ... done
  Created wheel for PyPDF3: filename=PyPDF3-1.0.3-py3-none-any.whl size=62670 sha256=e5b90d2cf66e02f557940821f04ce3a85cf60dd3cc669f748c106a0b3dd5cffb
  Stored in directory: /root/.cache/pip/wheels/f3/8f/5f/8ca0101accb929b96d5242ad98ac99365dddb627aa14b67f16
  Building wheel for blinker (setup.py) ... done
  Created wheel for blinker: filename=blinker-1.4-py3-none-any.whl size=13478 sha256=3f5a0aa61c48c1c2e728e64ae393ad6983e2c3d4dc8b731ad4519f11cf548c53
  Stored in directory: /root/.cache/pip/wheels/50/93/f8/4f0a42a03a06626d675f13907b6982ad5ecff383530af5a900
Successfully built Flask-Principal iso-639 PyPDF3 blinker
Installing collected packages: MarkupSafe, Werkzeug, pytz, Jinja2, itsdangerous, click, WTForms, urllib3, tqdm, idna, greenlet, Flask, chardet, certifi, blinker, Babel, Wand, unidecode, tornado, SQLAlchemy, requests, PyPDF3, lxml, iso-639, flask-wtf, Flask-Principal, Flask-Login, Flask-Babel, backports-abc, calibreweb
Successfully installed Babel-2.9.1 Flask-2.0.2 Flask-Babel-2.0.0 Flask-Login-0.5.0 Flask-Principal-0.4.0 Jinja2-3.0.3 MarkupSafe-2.0.1 PyPDF3-1.0.3 SQLAlchemy-1.4.29 WTForms-3.0.1 Wand-0.6.7 Werkzeug-2.0.2 backports-abc-0.5 blinker-1.4 calibreweb-0.6.14 certifi-2021.10.8 chardet-3.0.4 click-8.0.3 flask-wtf-0.15.1 greenlet-1.1.2 idna-2.10 iso-639-0.4.5 itsdangerous-2.0.1 lxml-4.6.5 pytz-2021.3 requests-2.24.0 tornado-6.1 tqdm-4.62.3 unidecode-1.2.0 urllib3-1.25.11
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@DietPi4:~#

Success! Very happy. It’s a late Christmas present. Thank you so much for your help.

In the end it was really simple. I don’t know what I’d been doing wrong but I have a talent for overcomplicating the obvious.

From the little time I’ve spent with Calibre-web it does look like an ideal candidate for DietPi.

Just one thing is still puzzling me. How do I autostart the application? I had a look at these start-service instructions but I can’t find the calibre-web starter file for a pip installation.

A note for anyone considering using this with a Kobo e-reader’s web browser. I needed to change the calibre-web guest settings to allow anonymous browsing. I also found it worked better when I changed DietPi’s web server to Nginx.

CPS executable should be located at /usr/local/bin/cps

root@DietPi4:~# which cps
/usr/local/bin/cps
root@DietPi4:~#

Sorry to be a continuing bother but what am I doing wrong? The cps command works but the following doesn’t.

I added a cps.service file (below) to /etc/systemd/system. Then sudo systemctl enable cps.service. Lastly, sudo systemctl start cps.service

[Unit]
Description=Calibre-Web

[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/cps

[Install]
WantedBy=multi-user.target

can you share the log

systemctl restart cps
systemctl status cps
journalctl -u cps

Well that’s unexpected. I entered the first line and all of a sudden it’s working now: reboot after reboot.

● cps.service - Calibre-Web
     Loaded: loaded (/etc/systemd/system/cps.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2021-12-30 17:29:49 GMT; 12s ago
   Main PID: 1629 (cps)
      Tasks: 2 (limit: 2340)
     Memory: 33.2M
        CPU: 11.345s
     CGroup: /system.slice/cps.service
             └─1629 /usr/bin/python3 /usr/local/bin/cps

-- Journal begins at Thu 2021-12-30 17:17:01 GMT, ends at Thu 2021-12-30 17:30:24 GMT. --
Dec 30 17:17:03 DietPi systemd[1]: Started Calibre-Web.
Dec 30 17:29:48 DietPi systemd[1]: Stopping Calibre-Web...
Dec 30 17:29:49 DietPi systemd[1]: cps.service: Succeeded.
Dec 30 17:29:49 DietPi systemd[1]: Stopped Calibre-Web.
Dec 30 17:29:49 DietPi systemd[1]: cps.service: Consumed 29.807s CPU time.
Dec 30 17:29:49 DietPi systemd[1]: Started Calibre-Web.

who knows. good it is working now.

Yes it is good. And thank you for your help. The sbc would otherwise be redundant. It was previously used for Volumio but unfortunately the device is no longer supported. Without your help it’d be destined for landfill or another paperweight. Either way it’d be a terrible waste.