Skip to content

L3 Workshop: Getting connection timeout while connecting to RDS Postgres

0

I'm encountering the below error while doing the Data Migration.

2025/10/27 06:14:14.980 ERROR 1 --- [ main] An unexpected error has occurred a.a.a.a.a.b.d.a: Error while openning connection with the database properties at a.a.a.a.a.b.b.f.a(f.java) at a.a.a.a.a.b.b.a.b(a.java) at a.a.a.a.a.b.b.a.a(a.java) at a.a.a.a.a.b.b.a.a(a.java) at a.a.a.a.a.g.a(g.java) at a.a.a.a.a.g.a(g.java) at a.a.a.a.a.j.lambda$launchStepsMigration$3(j.java) at a.a.a.a.a.d.a.a(a.java) at a.a.a.a.a.j.c(j.java) at a.a.a.a.a.j.main(j.java) Caused by: org.postgresql.util.PSQLException: The connection attempt failed. at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:315) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:51) at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:223) at org.postgresql.Driver.makeConnection(Driver.java:465) at org.postgresql.Driver.connect(Driver.java:264) at a.a.a.a.a.b.b.g.connect(g.java) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:681) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:190) ... 10 more Caused by: java.net.SocketTimeoutException: Connect timed out at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:551) at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:602) at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) at java.base/java.net.Socket.connect(Socket.java:633) at org.postgresql.core.PGStream.createSocket(PGStream.java:231) at org.postgresql.core.PGStream.<init>(PGStream.java:95) at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:98) at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:213) ... 17 more

asked a year ago190 views

1 Answer
0

The "Connect timed out" error you're encountering while trying to connect to your RDS PostgreSQL database during the AWS Blu Age L3 Workshop data migration is a common connectivity issue. Here are several troubleshooting steps to resolve this:

  1. Check your VPC configuration: Ensure that the RDS instance is in the same VPC as your AppStream 2.0 instance where you're running the migration tool. This is crucial for proper connectivity.

  2. Verify security group settings: The most common cause of connection problems is incorrect security group configuration. Make sure the security group assigned to your RDS instance allows inbound traffic on port 5432 (PostgreSQL default port) from your AppStream instance's security group.

  3. Public accessibility: If you're trying to access the database from outside the VPC, check that "Public access" is set to "Yes" for the RDS instance.

  4. Add proper inbound rules: In the RDS instance's security group, add an inbound rule of type PostgreSQL (port 5432) with the source set to the security group ID of your AppStream instance or the "default" security group of the VPC.

  5. Check network ACLs: If you've modified the default Network ACLs, ensure they're not blocking the necessary traffic.

  6. Verify endpoint and credentials: Double-check that you're using the correct endpoint, port, database name, username, and password when attempting to connect.

  7. Database user permissions: Ensure the database user has CONNECT access to the database. You can grant this with: GRANT CONNECT ON DATABASE database_name TO username;

If you've confirmed all these settings and still can't connect, you might need to open a support case with AWS, providing your Environment ID and relevant logs for further diagnosis.
Sources
BluAge L3 Workshop Go-Live: Unable to access RDS PostGres database created on default VPC | AWS re:Post
AWS Glue job fails to connect to RDS PostgreSQL (Publicly Accessible) — “SocketTimeoutException: connect timed out” | AWS re:Post
Troubleshooting connections to your RDS for PostgreSQL instance - Amazon Relational Database Service

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.