Reputation: 11
I'm relatively new to python and postgresql. I have inherited some code (python) that built a postgresql database using psycopg2 and sqlalchemy.
The database is named 'tetradev'
with user 'tetra'
On top of this is a browser based application running via flask that queries the database to load information on a map.
I recently changed the password for the user 'tetra'
and now I get a
"Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application"
on the URL.
Through the server where this is all hosted I get a
"OperationalError: (psycopg2.OperationalError) FATAL: password authentication failed for user " error.
However, via the terminal, I have no issues connecting to 'tetradev'
via user 'tetra'
directly.
Any ideas on how to fix this?
Edit
Below are the settings in the config file.
db_NAME = os.getenv(‘db_NAME', ‘tetradev')
db_USER = os.getenv(‘db_USER', ’tetra’)
db_PASSWD = os.getenv(‘db_PASSWD', 'default')
db_HOST = os.getenv(‘db_HOST', ‘xxx.xx.xxx.xx’)
db_PORT = os.getenv(‘db_PORT', 5432)
Upvotes: 0
Views: 2266
Reputation: 11
Finally figured this one out. I did end up updating the config file to the proper password but it still did not work.
I later learned that environmental variables were set that over-rode the config file (this is all being hosted through a cloud service). I updated the password there and the URL now works.
Lesson learned, watch out when changing user names or passwords.
Upvotes: 1