Issue with Docker Setup
EasyNV opened this issue · comments
Hi when I try to run the Docker setup it throw an error that look like this
------
> [11/22] RUN ./venv.sh flask db init && ./venv.sh flask db migrate && ./venv.sh flask db upgrade && ./venv.sh flask snitchdb && ./venv.sh flask crontab add:
#0 1.037 Traceback (most recent call last):
#0 1.037 File "/opt/snitchdns/venv/bin/flask", line 8, in <module>
#0 1.037 sys.exit(main())
#0 1.037 File "/opt/snitchdns/venv/lib/python3.8/site-packages/flask/cli.py", line 967, in main
#0 1.037 cli.main(args=sys.argv[1:], prog_name="python -m flask" if as_module else None)
#0 1.037 File "/opt/snitchdns/venv/lib/python3.8/site-packages/flask/cli.py", line 586, in main
#0 1.037 return super(FlaskGroup, self).main(*args, **kwargs)
#0 1.037 File "/opt/snitchdns/venv/lib/python3.8/site-packages/click/core.py", line 782, in main
#0 1.037 rv = self.invoke(ctx)
#0 1.037 File "/opt/snitchdns/venv/lib/python3.8/site-packages/click/core.py", line 1254, in invoke
#0 1.037 cmd_name, cmd, args = self.resolve_command(ctx, args)
#0 1.037 File "/opt/snitchdns/venv/lib/python3.8/site-packages/click/core.py", line 1297, in resolve_command
#0 1.037 cmd = self.get_command(ctx, cmd_name)
#0 1.037 File "/opt/snitchdns/venv/lib/python3.8/site-packages/flask/cli.py", line 542, in get_command
#0 1.037 rv = info.load_app().cli.get_command(ctx, name)
#0 1.037 File "/opt/snitchdns/venv/lib/python3.8/site-packages/flask/cli.py", line 388, in load_app
#0 1.037 app = locate_app(self, import_name, name)
#0 1.037 File "/opt/snitchdns/venv/lib/python3.8/site-packages/flask/cli.py", line 240, in locate_app
#0 1.037 __import__(module_name)
#0 1.037 File "/opt/snitchdns/app/__init__.py", line 12, in <module>
#0 1.037 db = SQLAlchemy()
#0 1.037 File "/opt/snitchdns/venv/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 758, in __init__
#0 1.037 _include_sqlalchemy(self, query_class)
#0 1.037 File "/opt/snitchdns/venv/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 112, in _include_sqlalchemy
#0 1.037 for key in module.__all__:
#0 1.037 AttributeError: module 'sqlalchemy' has no attribute '__all__'
------
And when I tried to upgrade the Flask-SQLAlchemy version to >= 3.0.2 it break like this
=> [10/22] RUN ln -s /opt/snitchdns/data/config/env/snitch.conf /opt/snitchdns/.env 0.4s
=> ERROR [11/22] RUN ./venv.sh flask db init && ./venv.sh flask db migrate && ./venv.sh flask db upgrade && ./venv.sh flask snitchdb && ./venv.sh flask crontab add 1.0s
------
> [11/22] RUN ./venv.sh flask db init && ./venv.sh flask db migrate && ./venv.sh flask db upgrade && ./venv.sh flask snitchdb && ./venv.sh flask crontab add:
#0 0.913 Usage: flask [OPTIONS] COMMAND [ARGS]...
#0 0.913 Try 'flask --help' for help.
Is there any step that I'm missing? Thank you in advance
Attribute .__all__
has been removed in SQLAlchemy 2.0, you can pin SQLAlchemy to version lower then 2.0 in requirements.txt
SQLAlchemy<2.0
Flask<2.0.0
Flask-SQLAlchemy==2.5.1
Flask-Migrate
Flask-WTF
Flask-Login
Flask-Bcrypt
Flask-Mail
packaging
psutil
gunicorn
Twisted
ldap3
Flask-Crontab
pywebpush
psycopg2
PyMySQL
pyotp
tabulate
python-dotenv
progressbar2
pyrad
markupsafe==2.0.1
@BananZZa Thanks a lot! It's running now :)