WSO2 APIM - No matching resources found for newly added resources in api
Hi All, let me share another experience of WSO2 APIM with you all.
Environment- WSO2 APIMv3.2.x, MSSQL, OpenShift
Problem Statement
Recently I have added 3 new resources to an existing API having 10 resources.. I re-deployed the API and tried testing the same via developer portal but the gateway responded with No Matching Resources error; though the resources are present and hence it was shown in the devportal. Below is the error message-
<ams:fault xmlns:ams="http://wso2.org/apimanager/security">
<ams:code>900906</ams:code>
<ams:message>No matching resource found in the API for the given request</ams:message>
<ams:description>Access failure for API: /reports/v1.0.0, version: v1.0.0 status: (900906) - No matching resource found in the API for the given request. Check the API documentation and add a proper REST resource path to the invocation URL</ams:description>
</ams:fault>
Root Cause
This is not an expected behavior especially when you add a new resource in an existing API. However, following checks can be done to do a sanity-
1. Re-Publish the API on respective gateway. >> Didn't worked
2. Check the resources are available in api xml file inside AM_HOME/repository/deployment/server/synapse-configs/defailt/api/admin--APINAME-v1.0.0.xml >> API resources are available
3. Checking wso2carbon logs while publishing the api >> No error log captured
4. Checking wso2carbon logs while consuming the API >> Error captured as highlighted above in yellow (no matching resources found)
Solution Applied
After checking the possible root cause via above steps, I proceeded for a server reboot. Once the server gets up and running, I tried accessing the APIs and it was working fine as expected.
Based on this experience, this may be due to server cache cleanup issue and hence the respective error was encountered while consuming the API. Server reboot clears the cache and resolved it. However, this is not permanent solution but a workaround to overcome the issue.
If you also have faced similar issue. please do share your experience and the solution as well :)
References-
- https://github.com/wso2/product-apim/issues/5487
- https://stackoverflow.com/questions/69435389/getting-900906-no-matching-resource-found-in-the-api-for-existing-resource
Comments
Post a Comment