1 Answer
- Newest
- Most votes
- Most comments
0
Diagnosis
This is a network reachability problem. IAM, SSL, and your connection pool settings are not the cause. The key line in the trace is:
io.netty.channel.ConnectTimeoutException: connection timed out after 30000 ms: ...:8182
The client tried to open a TCP connection to port 8182 and got no reply at all for 30 seconds. The TLS handshake and IAM (SigV4) signing had not started yet. Other failures would look different:
| Cause | Typical error |
|---|---|
| Blocked or unreachable network path | ConnectTimeoutException (your case) |
| Nothing listening on the port / wrong port | Connection refused |
| TLS problem | SSLHandshakeException |
| IAM or SigV4 problem | HTTP 403 during the WebSocket handshake |
The "20 ms to get traversal" log is misleading. The driver connects lazily, so the connection is only attempted at the first iterate(). That's why the error shows up there.
Likely causes, most common first
- The client is not inside the Neptune VPC. By default Neptune has no public access. A laptop, an on-prem server, or a Lambda not attached to the VPC can't reach it. Check the IP the endpoint resolves to (it's masked in your log). If it's private (10.x, 172.16–31.x, 192.168.x), the client needs a network path into that VPC.
- The security group doesn't allow the client. The security group on the Neptune cluster needs an inbound rule for TCP 8182 from the client's security group or CIDR. This is the most common cause when the client is in the same VPC.
- NACLs or route tables. Check the subnet NACLs, including the return traffic on ephemeral ports 1024–65535. If the client is in another VPC or on-prem, also check the peering, Transit Gateway, VPN, or Direct Connect routes.
- A corporate firewall or proxy blocks outbound 8182.
- The cluster isn't available. It may be stopped, have no instances, or be in the middle of a failover or maintenance. Confirm the status is
availablein the console. - Wrong endpoint. Make sure you're using the cluster endpoint for writes (
x.cluster-yyy.<region>.neptune.amazonaws.com) and not a stale instance endpoint.
Quick checks from the same host that runs the Java app
# 1. DNS: should resolve (usually to a private IP) nslookup <your-neptune-endpoint> # 2. TCP reachability: this is the critical test nc -vz <your-neptune-endpoint> 8182 # 3. HTTPS: any HTTP response, even 403 with IAM enabled, proves the network path works curl -v https://<your-neptune-endpoint>:8182/status
- If
ncorcurlhang and time out, fix the security group, routing, or VPC placement. - If they connect but the Java app still fails, the problem is on the app side (for example a JVM proxy setting, or a different host or container network than you expect).
Fixes by scenario
- App on EC2, ECS, or EKS in the same VPC: add an inbound rule to the Neptune security group allowing TCP 8182 from the app's security group.
- Lambda: attach it to the Neptune VPC's private subnets with a security group that Neptune allows.
- Local development: use an SSH tunnel through a bastion host, or SSM port forwarding, then add a hosts-file entry that maps the Neptune hostname to
127.0.0.1. The hosts entry keeps the SSL certificate hostname check passing. Alternatively, use Client VPN. - Direct access from outside AWS: newer Neptune engine versions support public endpoints (IAM auth required). Check whether your engine version supports it and whether it fits your security policy before you enable it.
Once connectivity works
- Your pool settings are fine. You can also set
minConnectionPoolSizeexplicitly (for example 1–2). - Keep the IAM signing setup as it is. If you then get a 403, check that the credentials in the client's environment have
neptune-db:*permissions and that the region used for signing matches the cluster's region.
If you tell me where the Java app runs (EC2, Lambda, local machine, on-prem), I can narrow this down to the exact settings to change.
Relevant content
asked 2 years ago

Hi, After executing curl -v https://<your-neptune-endpoint>:8182/status I received a following error on my java application using code
The logged exception is