- Newest
- Most votes
- Most comments
The "connection timeout" error you're experiencing when accessing your REST endpoint through APEX or curl (but not through Chrome) suggests there are network connectivity issues between your calling environment and the ALB-fronted REST service.
Here are several potential causes and solutions:
-
Security Group Configuration: Check that the security groups for your EC2 instances, ALB, and any intermediate components allow the necessary traffic. Ensure that outbound TCP 443 (HTTPS) traffic is permitted from the source of your APEX_WEB_SERVICE calls, and that inbound traffic is allowed to your ALB.
-
Network ACLs: Verify that your network ACLs allow both outbound traffic (TCP 443) from the calling instance/service and the return ephemeral traffic back into the same subnet.
-
VPC Network Firewall: If you have a VPC Network Firewall in place, check that it's not blocking the required traffic patterns.
-
Intermediate Network Components: There might be firewalls, proxies, or other network components between your calling service and the ALB that are blocking connections or have timeout settings that are too short.
-
Client-side Timeout Settings: The APEX_WEB_SERVICE package might have default timeout settings that are shorter than needed. You may need to adjust these settings to accommodate your service response time.
-
Proxy Configuration: If your environment requires a proxy to access external resources, ensure that APEX_WEB_SERVICE is configured to use the appropriate proxy settings.
-
DNS Resolution: Ensure that the ALB hostname can be properly resolved from the environment where you're making the API calls.
Since Chrome works but programmatic access doesn't, this suggests that the browser might be using different network paths or configurations than your server-side code. This is common in environments where browsers have different proxy settings or network access than server processes.
To troubleshoot, try:
- Testing with explicit timeout parameters in your APEX_WEB_SERVICE call
- Checking if there are any proxy requirements for server-side connections
- Verifying all security group and network ACL settings along the entire path
- Checking if the calling service can resolve and reach the ALB DNS name
Sources
Getting Error: socket hang up on long requests in my AWS architecture | AWS re:Post
Troubleshoot connection to AWS service endpoints from Linux | AWS re:Post
EC2 Website Connection Timeout | AWS re:Post
Hi, I'm not familiar with APEX. However, I think general networking advice applies here:
I might have misunderstood your question, but my understanding is that the machine with the chrome browser is not the same as the instance from which you make the curl request. The following assumes the server making the request is an AWS resource (EC2 for example). Please give more information on your setup if I'm mistaken
I'm going to assume the ALB is internet facing here, is that the case ? In that scenario, you have to make sure the server making the request to it has a way to reach it:
- Its security group must allow HTTP port 80 outbound access (or any listener port configured on your ALB) to 0.0.0.0/0.
- VPC must be correctly configured: server making request must be able to reach an Internet Gateway (IGW), for example. Also, no NACLs should block requests (if VPC was created by default, this should be no issue). If VPC firewall exists, make sure .amazonaws.com is allowed.
- ALB's security group must accept inbound traffic from the IGW's IP
Relevant content
- asked a year ago
- asked 4 years ago
- AWS OFFICIALUpdated 3 years ago
