Intro to Data Eng: Week 4 Lab 3 Vector Database error

Hello,
I’m having an error to connect to the db. I’m copying the same password as got when typing terraform output vector_db_master_password

Here is the code

coder@f7c3e393ff2f:~/project$ psql --host=de-c1w4-vector-db.c1oo0wisaub1.us-east-1.rds.amazonaws.com --username=postgres --password --port=5432 -no-color
Password:
psql: error: connection to server at “de-c1w4-vector-db.c1oo0wisaub1.us-east-1.rds.amazonaws.com” (52.44.250.171), port 5432 failed: FATAL: password authentication failed for user “postgres”
connection to server at “de-c1w4-vector-db.c1oo0wisaub1.us-east-1.rds.amazonaws.com” (52.44.250.171), port 5432 failed: FATAL: no pg_hba.conf entry for host “50.16.135.185”, user “postgres”, database “postgres”, no encryption

Hello @Egonzalez,

I could reproduce the error, it seems you included the quotes when you copied the password in step 2.5.. It says Note : The outputs are printed in double quotes, which are not part of the username or password. Could you try without the quotes to connect. Hope it helps:

Hello @Georgios
Thanks for your reply

Unfortunately, this doesn’t seem to be the cause, I copied it without the quotes.
Any other idea what could be happening? I retried and now the terminal just crashes and closes automatically without any error

Hello @Egonzalez,

Sorry for the inconvenience, the terminal crashed to me as well. There are two potential reasons and one is existing resources, the other could be bad configuration files for terraform init/plan. I had to delete the terraform folder and use get latest version to proceed (check this post since others had the same issue and hawraa explains 100%.

Aferwards to stop terraform apply from crashing you should instead use terraform apply -no-color 2> errors.txt and check errors.txt file for existing resources. Then delete them:

  1. rds connection

  1. glue role

  1. ml database

Since the terminal crashed again you need to use source scripts/setup.sh to load the terraform variables before you go to terraform folder. Then run the terraform commands as usual and terraform apply -no-color 2> errors.txt to find more resources:

  1. The second time you might also need to delete the crawler

The password that you used is probably the issue that you can’t connect. I got that error and used ctr+c to password (e.g. “p3VJhQmilAY”)without the quotes or spaces (p3VJhQmilAY) and ctr+v in the empty space. Hope it helps