Fault Rule for "ApplicationNotFound" Error is not working

We want to create a custom fault rule for the below 404 Error "ApplicationNotFound" error when API endpoint is not correct.

{
  "fault": {
     "faultstring":"Unable to identify proxy for host: <hostalias>:443 and url: \/somepath",
     "detail":{
        "errorcode":"messaging.adaptors.http.flow.ApplicationNotFound"}
   }
}

We are able to use the Fault rules and create custom error message for 401 Errors with "InvalidAPIKey" or "FailedToResolveAPIKey".

However, we notice that when we get the above 404 Error , we are unable to capture in the trace or generate any custom error message.

Is it possible to create a custom error message when we get the above 404 Error ?

Solved Solved
0 4 3,256
1 ACCEPTED SOLUTION

When an API request hits the Message Processor (MP) component in Apigee Edge, it checks whether it is able to find the specific Proxy for which the request is made.

If it can't find then it responds with 404 response code with the following error message:

"Unable to identify proxy for host: <hostalias>:<port#> and url: \/somepath"


This happens much before the MP can process the request or execute any policies in the request.
Hence, these requests don't show up in the trace.

Thus, you won't be able to generate a custom error message using Fault Rule for the above 404 Error.

View solution in original post

4 REPLIES 4

When an API request hits the Message Processor (MP) component in Apigee Edge, it checks whether it is able to find the specific Proxy for which the request is made.

If it can't find then it responds with 404 response code with the following error message:

"Unable to identify proxy for host: <hostalias>:<port#> and url: \/somepath"


This happens much before the MP can process the request or execute any policies in the request.
Hence, these requests don't show up in the trace.

Thus, you won't be able to generate a custom error message using Fault Rule for the above 404 Error.

Not applicable

The error you are seeing is because of the proxy not found. This happens at the virtual host config level or api deployment level . As the proxy is not found no error handling or trace can be done on this.

You can check the proxy virtual host configuration and deployment issues. Error handling in this case is not possible at Apigee. If you configure custom error at the load balancer level if you are using APIGEE onprem.

@Priyadarshi Ajitav Jena,

It is the Message Processor which checks if a particular API Proxy is deployed on it or not. If it is not deployed, then it can throw the error

"Unable to identify proxy for host: <hostalias>:<port#> and url: \/somepath"

There are multiple other reasons as well that can result in this error. Please refer to this playbook for more details.

Not applicable

Yep. There are multiple reasons,here it specifies the hostalias and port matching is not there for the base path /somepath.

You can see if all the apis are facing same issue. If yes then you have to work on the alias name, port number and DNS configuration with request flow.

If this is only issue for a specific api, then you need to configure the virtualhost in the proxy endpoint, or redeploy the proxy, maybe there would be partial deployment or deployement timeout related issue.