Authentication failed for ftgres when trying to generate first alembic migration file on postgres #7705
Unanswered
jalvespinto
asked this question in
Usage Questions
Replies: 1 comment 3 replies
-
|
you likely need to configure TCP /password authentication for your PostgreSQL database. See https://www.postgresql.org/docs/current/auth-pg-hba-conf.html for how this is configured on PG server. |
Beta Was this translation helpful? Give feedback.
3 replies
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.
-
I have a flask app using sqlalchemy with postgres. The app and db are both running on docker containers. Now I am trying to generate an initial migration file to create the tables, but I am getting the error
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) FATAL: password authentication failed for user "postgres" FATAL: password authentication failed for user "postgres".For alembic.ini I am using "sqlalchemy.url = postgresql:postgres:test@localhost:test_db". The postgres docker container is up and have port 54322 exposed. Using "docker exec db psql -U postgres" I can access postgres and see that 'test_db' is there and have postgres as owner. Also, I can connect to it using d-beaver. So I don't get why sqlachemy is not able to connect. I am new to alembic and for the target_metadata on alembic env file I am using
registry().metadatasince I am using imperative mapping. I guess the issue is not related to an error there, but since I don't get exactly how alembic works I decided it was worth mentioning. tksBeta Was this translation helpful? Give feedback.
All reactions