Skip to content

Getting connection time out for Rest endpoints in APEX(AWS)

0

Hi,

We have installed ords and oracle DB (apex is installed on the DB) on aws EC2 servers on a private network. I have created rest endpoints using the apex restfull services. I'm accessing the rest endpoint using ALB, since the EC2 is in private network.

The rest endpoint is accessible on chrome when I hit it. But when I try it in oracle apex using apex_web_service.make_rest_request or using curl command in a sevrer, I'm getting connection time out. URL: http://<alb-name>.us-east-1.elb.amazonaws.com/<ords>/<schema>/hr/empinfo/

Please let me know if anyone is aware of this issue.

2 Answers
0

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:

  1. 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.

  2. 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.

  3. VPC Network Firewall: If you have a VPC Network Firewall in place, check that it's not blocking the required traffic patterns.

  4. 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.

  5. 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.

  6. 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.

  7. 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:

answered 10 months ago
EXPERT
reviewed 10 months ago
0

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
answered 10 months 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.