Message Processor not able to make requests to target server

Dears,

I am having a mock proxy for which is being called by other proxies.

For example:

<LocalTargetConnection>
    <Path>/du-mock</Path>
</LocalTargetConnection>

/users proxy is calling /mock proxy with proxy chaining. This setup works fine but when I change from proxy chaining to direct connection such as URL or LoadBalancer like below where users-target is defined in environment config target servers with proper IP and port details:

<HTTPTargetConnection>
        <LoadBalancer>
            <Server name="users-target">
            </Server>
        </LoadBalancer>
        <Path>/mock</Path>
        <Properties/>
    </HTTPTargetConnection>

I am able to make curl calls to /mock from the same box where this proxy is deployed. But not able to make any calls from trace tool or from /users proxy for target servers setup.

I even tried changing it to direct URL instead of LoadBalancer still no luck.

below is the response I get in tracetool from target server:

Headers:

Connection  	keep-alive
Content-Length  	344
Content-Type  	text/html
Date  	Wed, 21 Sep 2016 14:31:30 GMT
ETag  	574dd5a3-158
Server  	Apigee Router

Body:

<!DOCTYPE html>
<html>
<head>
<title>Error</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>An error occurred.</h1>
<p>Sorry, the page you are looking for is currently unavailable.<br/>
Please try again later.</p>
</body>
</html>

Has any one come across this scenario?

Solved Solved
1 2 718
1 ACCEPTED SOLUTION

@Mohammed Zuber ,

It's due missing host alias in Apigee Edge Virtual Hosts for the DNS name.

I believe you are making the call using the IP:PORT, when above request is made from Proxy 1 to Proxy 2, Proxy 1 reconstructs http request with host header based on reverse DNS lookup. Instead of IP, it's getting changed to DNS name. If DNS name is not added to virtual host aliases for the particular environment it will result in 404.

Use below management API to add same,

POST http://{MANAGEMENTAPI}/v1/organizations/{ORG}/e/{ENV}/virtualhosts/default

{
  "hostAliases": [
    "IP:PORT",
    "IP:PORT",
    "DNS:PORT",
    "DNS:PORT"
  ],
  "interfaces": [],
  "name": "default",
  "port": "PORT"
}

Thank you @Akash Prabhashankar & @tskumar@apigee.com for helping with this issue. Appreciate your time & effort guys. Way to go!!

Hope it helps others.

View solution in original post

2 REPLIES 2

@Mohammed Zuber ,

It's due missing host alias in Apigee Edge Virtual Hosts for the DNS name.

I believe you are making the call using the IP:PORT, when above request is made from Proxy 1 to Proxy 2, Proxy 1 reconstructs http request with host header based on reverse DNS lookup. Instead of IP, it's getting changed to DNS name. If DNS name is not added to virtual host aliases for the particular environment it will result in 404.

Use below management API to add same,

POST http://{MANAGEMENTAPI}/v1/organizations/{ORG}/e/{ENV}/virtualhosts/default

{
  "hostAliases": [
    "IP:PORT",
    "IP:PORT",
    "DNS:PORT",
    "DNS:PORT"
  ],
  "interfaces": [],
  "name": "default",
  "port": "PORT"
}

Thank you @Akash Prabhashankar & @tskumar@apigee.com for helping with this issue. Appreciate your time & effort guys. Way to go!!

Hope it helps others.

@Anil Sagar, Thanks man! Worked like a charm.