WSO2 APIM v3- Resolving API Retrieval Failure in Publisher and Devportal
In this blog post I'll share my experience in fixing the issue for APIs loading in publisher and devportal of WSO2 API Manager v3.2. My WSO2 API Manager instance was running fine with respective functionality. I stopped the server due to infra/maintenance activity and started the same after 2 days. However, my publisher portal was opening, and login works fine but I found an issue post login in Publisher portal and the Developer. Portal The Publisher and Developer Portal fail to retrieve APIs, displaying an HTTP 500 error. This blog post explores the root cause and solution for this problem.
Environment
- WSO2 APIM v3.2.0.xxx
- DB- MSSQL Server as database
- OS- RHEL
ApisApiServiceImpl Error while retrieving APIs
org.wso2.carbon.apimgt.api.APIManagementException: Failed to Search APIs
at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs_aroundBody178(AbstractAPIManager.java:2310) ~[org.wso2.carbon.apimgt.impl_6.7.206.367.jar:?]
at org.wso2.carbon.apimgt.impl.AbstractAPIManager.searchPaginatedAPIs(AbstractAPIManager.java:2195) ~[org.wso2.carbon.apimgt.impl_6.7.206.367.jar:?]
at org.wso2.carbon.apimgt.rest.api.publisher.v1.impl.ApisApiServiceImpl.apisGet(ApisApiServiceImpl.java:245) [classes/:?]
at org.wso2.carbon.apimgt.rest.api.publisher.v1.ApisApi.apisGet(ApisApi.java:928) [classes/:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
......
......
......
......
Caused by: java.lang.NullPointerException
at org.wso2.carbon.registry.indexing.internal.IndexingServiceComponent$AttributeSearchServiceImpl.search(IndexingServiceComponent.java:172) ~[org.wso2.carbon.registry.indexing_4.7.35.jar:?]
at org.wso2.carbon.registry.indexing.internal.IndexingServiceComponent$AttributeSearchServiceImpl.search(IndexingServiceComponent.java:185) ~[org.wso2.carbon.registry.indexing_4.7.35.jar:?]
at org.wso2.carbon.registry.indexing.internal.IndexingServiceComponent$AttributeSearchServiceImpl.search(IndexingServiceComponent.java:155) ~[org.wso2.carbon.registry.indexing_4.7.35.jar:?]
at org.wso2.carbon.governance.api.util.GovernanceUtils.performAttributeSearch(GovernanceUtils.java:2181) ~[org.wso2.carbon.governance.api_4.8.19.jar:?]
....... 55 more
Root Cause
WSO2 API Manager relies on an indexing service to efficiently search and retrieve APIs. When this indexing process fails or becomes corrupted, API searches in both the Publisher and Developer Portal may break, resulting in an HTTP 500 error. In this case, indexing was either disabled or not functioning correctly.
deployment.toml
file:[indexing]
enable = true
re_indexing = 1
- Open the deployment.toml file located in the <APIM_HOME>/repository/conf/ directory.
- Add or update the [indexing] section with the above configuration.
2. Restart the Server- Restart the WSO2 API Manager server to apply the changes.
3. Verify the Fix:
- Navigate to the API Publisher and Developer Portal.
- Confirm that the APIs are listed without errors.
Comments
Post a Comment