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

Freshly build Docker Image won't start #19

Open
aidik opened this issue Aug 8, 2022 · 7 comments
Open

Freshly build Docker Image won't start #19

aidik opened this issue Aug 8, 2022 · 7 comments

Comments

@aidik
Copy link

aidik commented Aug 8, 2022

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

@juriansluiman
Copy link
Owner

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.

@obbardc
Copy link

obbardc commented Aug 10, 2022

@juriansluiman perhaps it could be interesting to integrate dependabot to make these tedious bits more automated in future ?

@obbardc
Copy link

obbardc commented Aug 21, 2022

Fixed in #25

@5t33
Copy link

5t33 commented Sep 3, 2022

I was able to fix this by updating Flask-Login to 0.6.2 in requirements.txt

@henriquelino
Copy link

I have the same issue, updated flask login but it still happens.

@shsethi
Copy link

shsethi commented Sep 15, 2022

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

@Nindouja
Copy link

@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

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

No branches or pull requests

7 participants