- Newest
- Most votes
- Most comments
This error indicates a connection timeout when trying to reach your RDS PostgreSQL instance. Here are several troubleshooting steps to resolve this issue:
-
Check that your DB instance is in the "Available" state in the RDS console before attempting to connect.
-
Verify that you're using the correct endpoint and port number for your DB instance.
-
Ensure that the DB instance's "Public accessibility" setting is set to "Yes" if you're connecting from outside the VPC. You can modify this in the RDS console.
-
Check the security group assigned to your DB instance:
- Make sure it has inbound rules that allow traffic on your database port (default 5432) from your client's IP address.
- If connecting from an EC2 instance, verify that its security group is allowed in the RDS security group rules.
-
If your DB instance is in a VPC, check the Network ACLs (Access Control Lists) to ensure they allow both inbound and outbound traffic on the database port.
-
Verify your route table configuration to ensure there's a proper route for traffic between your client and the database.
-
Check for port conflicts on your local machine - ensure that port 5432 (or your custom port) isn't already in use by another application.
-
If connecting across different VPCs, verify that VPC peering is correctly configured and that DNS resolution is activated for the peering connection.
-
If you're using IAM authentication, verify that the IAM user or role has the appropriate permissions.
-
Check for IP address conflicts between your local network and the VPC CIDR range.
The "semaphore timeout period has expired" error typically indicates that the connection attempt timed out, which is often due to network configuration issues preventing traffic from reaching your RDS instance.
Sources
Troubleshooting connections to your RDS for PostgreSQL instance - Amazon Relational Database Service
Troubleshoot Aurora PostgreSQL connection timeout errors | AWS re:Post
Troubleshoot RDS PostgreSQL timeout errors | AWS re:Post
Troubleshooting connection issues to your Amazon RDS DB instance - Amazon Relational Database Service
