Posts

WSO2 APIM | Server Startup Heap Size Changes

Image
Hello WSO2 folks, I'll be sharing another good experience of WSO2 APIM production monitoring & troubleshooting. Environment WSO2 API Manager v3.2.0.x Use Case We have deployed WSO2 API Manager v3.2.0.x on the OpenShift Container platform and got some critical observations in carbon logs. The initial deployment was successful and carbon logs were not printing any error messages. So the APIs are configured via the publisher portal, and subscriptions are done via the dev portal. API calls started and traffic on gateway components started. However, after some time we noticed that the API gateway calls are getting failed with HTTP 5XX error codes . Root Cause Analysis We have done the analysis of the issue and found that there is a heap size issue in the carbon server and it's resulting in the API gateway component going down. Following error logs were identified- j ava.lang.OutOfMemoryError: Java heap space Ther Solution This problem has arisen due to insufficient memory i.e. R

WSO2 APIM | API key generation with new subscription tier

Image
Hello WSO2 folks! In this blog, I am going to share a use case where I've to generate new API Key In WSO2 API Manager with a new subscription tier. Environment WSO2 API Manager v3.2.0.x Use Case There was an API subscribed with an application with subscription tier 10 Request/Minute i.e. the default one and the API consumer was using the same with API Key. The API consumer was not provided the dev portal access and shared the API  Key over the email.  After some time, the API consumer has reported that sometimes they are getting HTTP 429 Too Many Requests Error and API call is failed. This issue was intermittently reported by the API consumer. Analysis We have done further investigation and found that they have provisioned a batch process that also calls the same API with 8 Request/Sec i.e. 480 Request/Minute. So we have created a custom rate-limiting policy with 1000 Request/Minute and attached it to the same application. However, the issue remains the same. The Solution We have

WSO2 APIM | Sequence to print throttlling messages

Image
Hi everyone, I will be sharing my another experience with the WSO2 API Manager sample use case for API throttling. Scenario So I had a situation encountered where I have to see the throttling messages in my wso2carbon.log file. By default, it has not been enabled and we have to make some changes to see the required output in the wso2carbon log file.   API Manager Version 3.2.0 Changes done WSO2 Sequence to print throttling messages in wso2carbon.log file Navigate to <APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences directory. Open the file named _throttle_out_handler_.xml. Update the contents of file _throttle_out_handler_.xml as per the below custom changes <sequence name="_throttle_out_handler_" xmlns="http://ws.apache.org/ns/synapse">         <property name="X-JWT-Assertion" scope="transport" action="remove"/>     <class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.AP

WSO2 APIM | Server startup takes long time in linux/Mac

Image
Recently I have been trying to run WSO2 APIM V4 on my MacBook Air but it was taking too long to start. I have also faced the similar issue in linux environment previously. To overcome this issue,  need to map hostile entries (127.0.0.1 & ::1) to my hostname. Before 127.0.0.1 localhost ::1              localhost Now let's check the hostname in Mac kumargaurav@Kumars-MacBook-Air bin % hostname Kumars-MacBook-Air.local Let's update the hostname with current one in addition to the localhost as shown below- After   127.0.0.1 localhost Kumars-MacBook-Air.local ::1             localhost Kumars-MacBook-Air.local Now, start the API Manager and it would start in normal time ~<2 mins.   Kindly note that the changes here are for localhost hostname & IP 127.0.0.1, in case of environment specific deployment we need to change as per the environment IP & hostname.

WSO2 APIM 3.2.0 | Unable to load APIs in developer portal

Image
Hello guys, I'll be sharing my another experience in WSO2 API Manager for one of the use cases I faced issue. Environment : WSO2 APIM 3.2.0, RHEL8.x Problem: The developer portal is unable to load the list of APIs as default. Although, it can load the APIs if I filter out the APIs via tag. Below is the screenshot of the same- Further I tried to investigate wso2carbon logs to see the error/exception and I found below relevant logs for the same- ================================================================================ ERROR - ApisApiServiceImpl Error while retrieving API : 07b6c6a7-eaa6-42be-a687-e04dd40a1ee6 org.wso2.carbon.apimgt.api.APIManagementException: Unable to find the API: admin-test001-1.0.0 in the database at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.getAPIID_aroundBody310(ApiMgtDAO.java:7148) ~[org.wso2.carbon.apimgt.impl_6.7.206.168.jar:?] at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.getAPIID(ApiMgtDAO.java:7117) ~[org.wso2.carbon.apimgt.impl_6.7.206.168.jar:?] a

WSO2 APIM OpenShift Deployment- Create http route for API gateway

Image
In this post I'll be sharing one of the use case to achieve in WSO2 OpenShift Deployment Environment: OpenShift 4.x, WSO2 APIM 3.2.0.x, RHEL 8.3 Business Requirement: Getting http based URL for API gateway component in OpenShift deployment of WSO2 API Manager Steps to achieve: By default WSO2 APIM (deployment pattern-1: all in one two node stateful set) provides 3 routes for respective services based on https protocol as For Analytics :  wso2am-analytics-dashboard-test.apps.devtest.host.local For API Gateway : wso2am-gateway-test.apps.devtest.host.local For APIM Portals   :  wso2am-am-test.apps.devtest.host.local Now in order to get a http based URL for API gateway, we have to create a new route. This can be achieved via config map or directly via OpenShift console. I've used  OpenShift  console to create a new route for API gateway based on http protocol. Below are the steps- 1. Login to OpenShift console & Navigate to respective project 2. Navigate to Networking > Ro

Docker run failed for apim analytics image with illegal option

Image
In this post I am going to share my experience for running the docker image of wso2 apim analytics dashboard that caused some issue while running it. Below is the summary of the same- Environment: Windows, RHEL 8.3, WSO2 Analytics 3.2.0 Problem: While executing docker run command, it gives following error- sudo docker run wso2am-analytics-dashboard:3.2.0.20 : not foundarbon/docker-entrypoint.sh: 17: /home/wso2carbon/docker-entrypoint.sh: 18: set: Illegal option - Cause:  The problem occurred due to dos2unix conversion issue. Basically the file docker-entrypoint.sh was created in a winodws machine in notepad++ utility but remained with EOL conversion as Windows (CR LF). Further this file was uploaded to a linux machine where actual execution has to be done. Solution We need to change the EOL conversion of the file ( docker-entrypoint.sh ) to Linux (LR) prior to docker image creation. I have used windows environment and notepad++ utility to do the same as- 1. Open the file docker-entry

WSO2 APIM OpenShift Deployment Experience

Image
Hello Guys, In this blog I am going to share my experience in WSO2 API Manager OpenShift deployment where I faced some issues with respect to Persistent Volumes/ Persistent Volume Claims. Environment OpenShift Version 4.x WSO2 APIM version 3.2.0.x Use Case 1- runAsUser SecurityContext I have tried to apply the template yaml to create the resources, following error encountered [userdemo@mycustomhost yaml]$ oc get pods NAME READY STATUS RESTARTS AGE wso2am-pattern-1-am-analytics-dashboard-deployment-1-deploy 0/1 Error 0 13m wso2am-pattern-1-am-analytics-worker-2-deployment-1-deploy 0/1 Error 0 13m wso2am-pattern-1-am-analytics-worker-deployment-1-deploy 0/1 Error 0 13m [appadmin1@apiextappppsb01 yaml]$ oc logs -f wso2am-pattern-1-am-analytics-dashboard-deployment-1-deploy --> Scaling wso2am-pattern-1-am-analytics-dashboard-deployment-1 to 1 --> FailedCreate: ws