KB Article #182137
Errors like "com.vordel.api.common.NotFoundException: Unknown API" occur under load
Problem
A com.vordel.api.common.NotFoundException: Unknown API may occur randomly when the parameter com.axway.apimanager.api.data.cache=true is present in jvm.xml and a flow like the one below is being run against the API Manager APIs:
a) GET OrgId
b) POST Backend API
c) POST Frontend API
d) POST Application
e) POST Link API with App
d) DELETE Application
f) DELETE Frontend
g) DELETE Backend API
After step E this exception may be observed:
DEBUG 21/Apr/2022:23:03:27.642 Failed to find API: 00000000-0000-0000-0000-000000000000
DEBUG 21/Apr/2022:23:03:27.642 java exception: com.vordel.api.common.NotFoundException: Unknown API
at com.vordel.apiportal.api.portal.controller.DiscoveryController.getSwaggerAPIbyID(DiscoveryController.java:452)
at com.vordel.apiportal.actionqueue.request.AppApiAccessRequest.<init>(AppApiAccessRequest.java:54)
at com.vordel.apiportal.api.portal.controller.ApplicationController.requestAPIAccess(ApplicationController.java:528)
at com.vordel.apiportal.api.portal.v1_2.APIApplications.requestApiAccess(APIApplications.java:553)
at sun.reflect.GeneratedMethodAccessor390.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
Resolution
The API and Application updates are done by the API Manager poller background processes asynchronously. API Manager API calls depend on these results. Sometimes the virtualized API has not been processed by API Manager when sending a request to access the API, which may result in the exception shown here.
When scripting a flow like this, you must check for API in the API Catalog (Discovery API), before doing further modifications, such as requesting API access. In the flow example above, this check could be inserted before steps D or E. In an HA setup, the API Manager API requests must be done against the same API Manager instance, not split across API Managers. That may require bypassing a load balancer if one is in place.
Our recommendation when the cache flag is set is to poll the virtualized API created at step C via a separate API call from API Catalog and to check for its presence, before doing other operations on that API. This has to be done before using the VAPI (Virtualized API) to process traffic and before granting API Accesses to the VAPI, because the event needs to be processed and the VAPI broker must have been created before this will work.