HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure connecting to RDS postgresql instance

I cannot connect to the rds postgresql instance. I installed my survey solutions on my RDC . However, when i try connecting to local host i get that error. i have tried uninstalling both survey solutions and .Net application and re-installed survey solutions, still same error. I have checked my RDS instance, security groups everything is fine. What do i do?