"flask db migrate" error in a Docker container #548
Unanswered
yuanyanhui
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The issue was solved by updating Flask-Migrate to the latest version. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a falsk app with a postgresql database (DATABASE_URL=postgresql://dbuser:dbuser@db:5432/appdb).
If I run
sudo docker-compose -f docker-compose.yml exec web flask db migrate
, I get the following errorFile "/usr/local/lib/python3.11/site-packages/psycopg2/__init__.py", line 122, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "db" (172.24.0.2), port 5432 failed: FATAL: password authentication failed for user "dbuser"
.I can connect to the db conainter and create tables by
sudo docker-compose -f docker-compose.yml exec web python manage.py create_db
. The app works fine with database queries.Beta Was this translation helpful? Give feedback.
All reactions