We are getting 404 response for all the APIs in a specific environment

We are getting 404 Response for all the APIs in one of the environments "hybrid" as shown below:

curl -v "https://myorg-hybrid.apigee.net/apps"
... 
HTTP/1.1 404 Not Found 
<!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> 
How to troubleshoot this issue ?
Solved Solved
0 1 1,032
1 ACCEPTED SOLUTION

  1. I had a look at the Nginx configuration folder /opt/nginx/conf.d on the Routers and noticed that the conf files for the Virtual Hosts in "hybrid" environment were missing.
  2. Checked the /opt/apigee/var/log/edge-router/logs/startupruntimeerrors.log and noticed the below exception:
    2018-04-17 16:53:22,737 org:orionhealth-internal env:hybrid main ERROR STARTUP_RUNTIME_ERROR - AbstractConfigurator.handleUpdate() : 'status':'error', 'action':'add','type':'KeyStore','message':'ADD KeyStore /organizations/myorg/environments/hybrid/keystores/test_trust_store/','ExceptionMessage':'{}'
    java.lang.NullPointerException: null 
    at com.apigee.entities.configurators.KeyStore.handleAdd(KeyStore.java:76) ~[config-entities-1.0.0.jar:na] 
    at com.apigee.entities.AbstractConfigurator.handleUpdate(AbstractConfigurator.java:137) ~[config-entities-1.0.0.jar:na] 
    at com.apigee.application.entities.Environment.handleUpdate(Environment.java:108) [application-classification-1.0.0.jar:na] 
    ... <snipped>
  3. This indicated that the Router is unable to add the truststore "test_trust_store" for some reason. Hence, it is not able to load the environment and create the conf files for the virtual hosts in hybrid environment.
  4. Next, I checked if this truststore exists in the first place in hybrid environment using the below management API:
    GET v1/organizations/myorg/environments/hybrid/keystores

    The truststore was listed in the output of this API.

  5. When I tried to fetch the contents of the truststore, I got the below error:
    GET v1/organizations/myorg/environments/hybrid/keystores/test_trust_store
    { 
      "code" : "messaging.config.beans.KeyStoreNotFound",
      "message" : "Key store with name : test_trust_store not found in environment : hybrid", 
      "contexts" : [ ]
    }
  6. This indicated that the test_trust_store has somehow got into a bade state.
  7. Since we didn't need the Truststore "test_trust_store" any longer, we went ahead and deleted from the Cassandra datastore with the help of Database administrator.
  8. Restarted the routers.

After this, we started getting successful responses for all the APIs in hybrid environment.

View solution in original post

1 REPLY 1

  1. I had a look at the Nginx configuration folder /opt/nginx/conf.d on the Routers and noticed that the conf files for the Virtual Hosts in "hybrid" environment were missing.
  2. Checked the /opt/apigee/var/log/edge-router/logs/startupruntimeerrors.log and noticed the below exception:
    2018-04-17 16:53:22,737 org:orionhealth-internal env:hybrid main ERROR STARTUP_RUNTIME_ERROR - AbstractConfigurator.handleUpdate() : 'status':'error', 'action':'add','type':'KeyStore','message':'ADD KeyStore /organizations/myorg/environments/hybrid/keystores/test_trust_store/','ExceptionMessage':'{}'
    java.lang.NullPointerException: null 
    at com.apigee.entities.configurators.KeyStore.handleAdd(KeyStore.java:76) ~[config-entities-1.0.0.jar:na] 
    at com.apigee.entities.AbstractConfigurator.handleUpdate(AbstractConfigurator.java:137) ~[config-entities-1.0.0.jar:na] 
    at com.apigee.application.entities.Environment.handleUpdate(Environment.java:108) [application-classification-1.0.0.jar:na] 
    ... <snipped>
  3. This indicated that the Router is unable to add the truststore "test_trust_store" for some reason. Hence, it is not able to load the environment and create the conf files for the virtual hosts in hybrid environment.
  4. Next, I checked if this truststore exists in the first place in hybrid environment using the below management API:
    GET v1/organizations/myorg/environments/hybrid/keystores

    The truststore was listed in the output of this API.

  5. When I tried to fetch the contents of the truststore, I got the below error:
    GET v1/organizations/myorg/environments/hybrid/keystores/test_trust_store
    { 
      "code" : "messaging.config.beans.KeyStoreNotFound",
      "message" : "Key store with name : test_trust_store not found in environment : hybrid", 
      "contexts" : [ ]
    }
  6. This indicated that the test_trust_store has somehow got into a bade state.
  7. Since we didn't need the Truststore "test_trust_store" any longer, we went ahead and deleted from the Cassandra datastore with the help of Database administrator.
  8. Restarted the routers.

After this, we started getting successful responses for all the APIs in hybrid environment.