groceri.es
groceri.es copied to clipboard
Freshly build Docker Image won't start
While running a newly build Docker Image it will fail instantly with following error:
Checking for script in /app/prestart.sh
Running script /app/prestart.sh
Run flask migration upgrades (show current version first)
Usage: flask db current [OPTIONS]
Try 'flask db current --help' for help.
Error: While importing 'app', an ImportError was raised:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 256, in locate_app
__import__(module_name)
File "/app/app.py", line 6, in <module>
from flask_login import LoginManager
File "/usr/local/lib/python3.8/site-packages/flask_login/__init__.py", line 16, in <module>
from .login_manager import LoginManager
File "/usr/local/lib/python3.8/site-packages/flask_login/login_manager.py", line 24, in <module>
from .utils import (login_url as make_login_url, _create_identifier,
File "/usr/local/lib/python3.8/site-packages/flask_login/utils.py", line 13, in <module>
from werkzeug.security import safe_str_cmp
ImportError: cannot import name 'safe_str_cmp' from 'werkzeug.security' (/usr/local/lib/python3.8/site-packages/werkzeug/security.py)
It might be related to https://stackoverflow.com/questions/71652965/importerror-cannot-import-name-safe-str-cmp-from-werkzeug-security
This is indeed a Werkzeug 2.1.0 problem, as this package is included in the docker image I can't revert this back as suggested by the StackOverflow answers. I can however just update Flask-Login to be compatible with Werkzeug 2.1.0, let me test this so I can update all dependencies.
@juriansluiman perhaps it could be interesting to integrate dependabot to make these tedious bits more automated in future ?
Fixed in #25
I was able to fix this by updating Flask-Login to 0.6.2 in requirements.txt
I have the same issue, updated flask login but it still happens.
Worked for me with these versions in requirements.txt
Flask-Migrate==3.1.0
Flask-Login==0.6.2
Flask-Babel==2.0.0
Flask-WTF==1.0.1
python-slugify==6.1.2
pycountry==22.3.5
PyMySQL==1.0.2
sqlalchemy==1.3.24
@juriansluiman can we please merge @obbardc PR (#25) or mine based on @shsethi proposal (#37) if you don't want dependabot. I'm using a mirror of this repo for publishing a docker image in a registry but it's a pain to automate if I have a divergent version. Thanks