Closed benchub closed 3 years ago
@AadiMehta would you please working with @benchub to make sure he can setup environment properly?
@benchub This is just a print statement error. Can you please take latest pull. That should resolve this
The lastest pull makes this run without errors... but from what I can see, nothing happens. (engine_instancestateinfo is empty after running.) Is there a way to run it with debug output?
Alternatively I'd be happy to do a screensharing session if that works for you.
OK, so looking to this more.....
I am successfully pulling instances from ec2. \o/
Sadly, I am unable to psql to any of those instances. It kept failing like so:
FATAL: Peer authentication failed for user "pygmy"
Traceback (most recent call last):
File "/home/pygmy/pygmy/engine/postgres_wrapper.py", line 13, in __init__
self.conn = psycopg2.connect(host=DB_HOST, database=DB_NAME, user=DB_USER, password=DB_PASS, port=DB_PORT)
I assumed this was due to hba errors, but hba seemed correct, and double-checking postgres logs, it turned out that pygmy wasn't even attempting to log in. I threw in a debug line to print out the variables pygmy was using to connect to each instance; it turns out for every instance, pygmy is using:
host=, database=postgres, user=pygmy, password=pygmy, port=5432
That is surprising to me, given that engine_dbcredentials has the actual password for pygmy to use (which is not "pygmy", although the role is). And, you know, how the host is completely unset.
Trying to track this down, this seems due to the line
db_conn = PostgresData(instance.publicDnsName, "pygmy", "pygmy", "postgres")
on engine/management/commands/get_all_db_data.py:34, which seems quite clearly incorrect.
1 - instance.publicDnsName should be instance.privateIpAddress 2 - user/role should not be hardcoded to pygmy.
we will change it to privateIpAddress once code is stable
main issue of command failure is not present hence we can close it
SHA-1: 2fb166f
Changes: Populate settings now ask for which regions to enable sync of Populate settings can now configure secrets Populate settings can now enable/disable RDS/EC2 sync Case correction Pygmy now using the right db credentials