Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] calibreweb fails to start due to mismatched Werkzeug/Flask versions. #1074

Open
Irishsmurf opened this issue Sep 11, 2023 · 1 comment
Labels

Comments

@Irishsmurf
Copy link
Contributor

Irishsmurf commented Sep 11, 2023

What happened?

Steps to reproduce:

  1. Install package '
    • box install calibreweb
  2. Start the service
    • sudo systemctl start calibreweb
  3. Error:
    • sudo systemctl status calibreweb
sudo systemctl status calibrewebcalibreweb.service - calibreweb
     Loaded: loaded (/etc/systemd/system/calibreweb.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2023-09-11 12:14:16 IST; 1s ago
    Process: 2828508 ExecStart=/opt/.venv/calibreweb/bin/python3 /opt/calibreweb/cps.py -i 127.0.0.1 (code=exited, status=1/FAILURE)
   Main PID: 2828508 (code=exited, status=1/FAILURE)

Sep 11 12:14:16 helsinki python3[2828508]:     from flask import Flask
Sep 11 12:14:16 helsinki python3[2828508]:   File "/opt/.venv/calibreweb/lib/python3.8/site-packages/flask/__init__.py", line 4, in <module>
Sep 11 12:14:16 helsinki python3[2828508]:     from . import json as json
Sep 11 12:14:16 helsinki python3[2828508]:   File "/opt/.venv/calibreweb/lib/python3.8/site-packages/flask/json/__init__.py", line 8, in <module>
Sep 11 12:14:16 helsinki python3[2828508]:     from ..globals import current_app
Sep 11 12:14:16 helsinki python3[2828508]:   File "/opt/.venv/calibreweb/lib/python3.8/site-packages/flask/globals.py", line 56, in <module>
Sep 11 12:14:16 helsinki python3[2828508]:     app_ctx: "AppContext" = LocalProxy(  # type: ignore[assignment]
Sep 11 12:14:16 helsinki python3[2828508]: TypeError: __init__() got an unexpected keyword argument 'unbound_message'
Sep 11 12:14:16 helsinki systemd[1]: calibreweb.service: Main process exited, code=exited, status=1/FAILURE
Sep 11 12:14:16 helsinki systemd[1]: calibreweb.service: Failed with result 'exit-code'.

Expected results:

  • CalibreWeb is able to start.

After some investigation, this is due to Werkzeug being installed with version werkzeug-2.0.3 and Flask being version 2.2.5.

Bumping Werkzeug to version 2.2.2 fixes this:

Version 2.2.0 is incompatible with Flask 2.2.5:

source /opt/.venv/calibreweb/bin/activate
(...)

❯ pip install werkzeug==2.2.0
Collecting werkzeug==2.2.0
  Using cached Werkzeug-2.2.0-py3-none-any.whl (232 kB)
Requirement already satisfied: MarkupSafe>=2.1.1 in /opt/.venv/calibreweb/lib/python3.8/site-packages (from werkzeug==2.2.0) (2.1.3)
ERROR: flask 2.2.5 has requirement Werkzeug>=2.2.2, but you'll have werkzeug 2.2.0 which is incompatible.

Version 2.2.2 works:

pip install werkzeug==2.2.2
Collecting werkzeug==2.2.2
  Downloading Werkzeug-2.2.2-py3-none-any.whl (232 kB)
     |████████████████████████████████| 232 kB 31.8 MB/s
Requirement already satisfied: MarkupSafe>=2.1.1 in /opt/.venv/calibreweb/lib/python3.8/site-packages (from werkzeug==2.2.2) (2.1.3)
ERROR: flask-babel 3.0.1 has requirement pytz<2023.0,>=2022.7, but you'll have pytz 2023.3.post1 which is incompatible.
Installing collected packages: werkzeug
  Attempting uninstall: werkzeug
    Found existing installation: Werkzeug 2.2.0
    Uninstalling Werkzeug-2.2.0:
      Successfully uninstalled Werkzeug-2.2.0
Successfully installed werkzeug-2.2.2sudo systemctl restart calibrewebsudo systemctl status calibrewebcalibreweb.service - calibreweb
     Loaded: loaded (/etc/systemd/system/calibreweb.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2023-09-11 12:21:27 IST; 2s ago
   Main PID: 2829580 (python3)
      Tasks: 4 (limit: 76818)
     Memory: 105.9M
     CGroup: /system.slice/calibreweb.service
             └─2829580 /opt/.venv/calibreweb/bin/python3 /opt/calibreweb/cps.py -i 127.0.0.1

Sep 11 12:21:27 helsinki systemd[1]: Started calibreweb.

Swizzin commit

9dc0c50

What OS are you using?

Debian 10 (Buster)

What architecture is your OS?

amd64

Relevant logs and output

❯ sudo systemctl status calibreweb
● calibreweb.service - calibreweb
     Loaded: loaded (/etc/systemd/system/calibreweb.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2023-09-11 12:14:16 IST; 1s ago
    Process: 2828508 ExecStart=/opt/.venv/calibreweb/bin/python3 /opt/calibreweb/cps.py -i 127.0.0.1 (code=exited, status=1/FAILURE)
   Main PID: 2828508 (code=exited, status=1/FAILURE)

Sep 11 12:14:16 helsinki python3[2828508]:     from flask import Flask
Sep 11 12:14:16 helsinki python3[2828508]:   File "/opt/.venv/calibreweb/lib/python3.8/site-packages/flask/__init__.py", line 4, in <module>
Sep 11 12:14:16 helsinki python3[2828508]:     from . import json as json
Sep 11 12:14:16 helsinki python3[2828508]:   File "/opt/.venv/calibreweb/lib/python3.8/site-packages/flask/json/__init__.py", line 8, in <module>
Sep 11 12:14:16 helsinki python3[2828508]:     from ..globals import current_app
Sep 11 12:14:16 helsinki python3[2828508]:   File "/opt/.venv/calibreweb/lib/python3.8/site-packages/flask/globals.py", line 56, in <module>
Sep 11 12:14:16 helsinki python3[2828508]:     app_ctx: "AppContext" = LocalProxy(  # type: ignore[assignment]
Sep 11 12:14:16 helsinki python3[2828508]: TypeError: __init__() got an unexpected keyword argument 'unbound_message'
Sep 11 12:14:16 helsinki systemd[1]: calibreweb.service: Main process exited, code=exited, status=1/FAILURE
Sep 11 12:14:16 helsinki systemd[1]: calibreweb.service: Failed with result 'exit-code'.
@Irishsmurf Irishsmurf added the bug label Sep 11, 2023
@Irishsmurf
Copy link
Contributor Author

Although I think we pull requirements.txt from the upstream GitHub repo of calibreweb, so I guess we have to fix this there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant