0

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)
DavidB
  • 11
  • 3
  • Did you modify the password on the flask config ? – polku Jun 24 '16 at 07:45
  • No I did not. I thought about doing that but the password was set to 'default' and I don't really understand what that means. – DavidB Jun 24 '16 at 07:48
  • To further clarify, the user 'tetra' had a password set before I changed it but in the config file, the password = 'default' and not the actual password. – DavidB Jun 24 '16 at 07:57
  • Well the pass must be set somewhere, maybe after that, but without your config details it's hard to help you. – polku Jun 24 '16 at 08:32

1 Answers1

1

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.

DavidB
  • 11
  • 3