0

I published new service on WSO2, then I do Subscriptions on DevPortal and do API testing on DevPortal then I get 404 - Not found API error: Carbon log: "Error:404 / Message dispatched to the main sequence. Invalid URL., RESOURCE = /internal/***, HEALTH CHECK URL"

Then I tried restarting WSO2 according to some comments on stackoverflow, the service was working normally.

However, after about a week without any impact on the service, the service keeps giving 404 error. Or sometimes when I try to publish a new service, I get a 404 error. The solution I do is restart wso2 ..

But it is a PRODUCTION environment so it is not possible to restart WSO2 so often.

According to search the problem is JMS connection between Control Plane(CP) and Gateway(GW).

Is there any way to check JMS connection between CP and GW? Or is there a JMS connection log anywhere? Please assist me with the solution.

Sincerely thank you,

Tony
  • 11
  • 3
  • You can enable Debug logs and see, take a look at this blog https://medium.com/@iloshinikarunarathne/troubleshooting-throttling-related-issues-in-wso2-apim-d636106ef3c9. This is for an older version of the product which uses log4j1 so the log configs are a bit different in the latest version but the package name should be same. So take note of it. Also closely check the configs mentioned here, and make sure you don't have Firewalls blocking the connections. https://apim.docs.wso2.com/en/latest/install-and-setup/setup/distributed-deployment/deploying-wso2-api-m-in-a-distributed-setup/ – ycr Mar 21 '23 at 12:12
  • I added the following lines in the log4j2.properties file: "logger.org.apache.synapse.transport.jms.name = org.apache.synapse.transport.jms logger.org.apache.synapse.transport.jms.level = debug logger.org.apache.axis2.name = org.apache.axis2 logger.org.apache.axis2.level = debug" and this is the log I get: "DEBUG {org.apache.synapse.transport.http.wire} - ****{"code":"404","type":"Status report","message":"Runtime Error","description":"No matching resource found for given API Request"}[\r][\n]" I don't see any previous error related to JMS or 404 error, can you guide me how to check? – Tony Mar 22 '23 at 10:15

1 Answers1

0

If there is an issue establishing the JMS connection between CP and GW, there should be multiple errors logged in the carbon logs similar to the following.

WARN - DataEndpointGroup No receiver is reachable at URL Endpoint/Endpoints       
ERROR - DataEndpointConnectionWorker Error while trying to connect to the endpoint. Cannot borrow client for ssl://172.16.2.63:9711

Also, you can check the events received by the gateway by enabling debug logs for gateway listerns package.

Add the following logger to the log4j.properties file found in <APIM_HOME>/repository/conf directory.

logger.jms_listner.name = org.wso2.carbon.apimgt.gateway.listeners
logger.jms_listner.level = DEBUG

And use this logger with the existing loggers by appending to the list as below.

loggers = jms_listner, AUDIT_LOG, trace-messages ...

This will log all the events received by the gateway regarding API deployments, subscriptions etc. When you deploy the API in gateway, an event will be published from CP and received from Gateway. If this event is not received by the gateway, then there can be observations similar to what you are facing right now. Therefore verify whether the events are received by the gateway.

Events received by the gateway will as below.

DEBUG - GatewayJMSMessageListener Event received in JMS Event Receiver - Body:
{"event":{"payloadData":{"eventType":"DEPLOY_API_IN_GATEWAY",

DEBUG - GatewayJMSMessageListener Event received in JMS Event Receiver - Body:
{"event":{"payloadData":{"eventType":"SUBSCRIPTIONS_CREATE",
Lakshitha
  • 1,021
  • 1
  • 6
  • 15
  • Thanks @Lakshitha, I am getting 404 error for previously deployed services, these services are running on PROD so there is almost no impact of service modification. When the 404 error occurs, it is necessary to restart the server for the service to work properly. I enabled jms log to trace but no JMS related error log for deployed services. Can you give me advice in case of this error? – Tony Mar 23 '23 at 09:19