'WSO2APIM: APIs are failing with Error Message as - STATUS = Message dispatched to the main sequence. Invalid URL., RESOURCE =

I am using WSO2 APIM 2.5.0

I have recently started created/Onboarding APIs into APIM but seeing some issues in accessing them from store or from post. For few of the API, it does not create any issue and it works absolutely fine. But for few of them I have getting below error:

INFO {org.apache.synapse.mediators.builtin.LogMediator} -  STATUS = 
Message dispatched to the main sequence. Invalid URL., RESOURCE = 
/rest/abc/fun 
{org.apache.synapse.mediators.builtin.LogMediator}

When I am checking the APIs, they donot have the anything dissimilar which points me that something missing in the not working API configuration.

I have checked the /usr/lib/wso2/wso2am/2.5.0/repository/deployment/server/synapse- configs/default/endpoints and /usr/lib/wso2/wso2am/2.5.0/repository/deployment/server/synapse- configs/default/api

Here is the response when I am trying to consume the API from postman:

<am:fault xmlns:am="http://wso2.org/apimanager">
    <am:code>404</am:code>
    <am:type>Status report</am:type>
    <am:message>Not Found</am:message>
    <am:description>The requested resource is not available. 

APIs are present as it should be. I am stuck here from long time now and not able to get any resolution.

Adding synapse file as well from usr/lib/wso2/wso2am/2.5.0/repository/deployment/server/synapse-configs/default/api

<?xml version="1.0" encoding="UTF-8"?>
<api xmlns="http://ws.apache.org/ns/synapse"
name="john.doe-AT-abc.com--FUNAPI"
context="/FUNAPI/3.0.0"
version="3.0.0"
version-type="context">
<resource methods="POST" url-mapping="/fun" faultSequence="fault">
 <inSequence>
<property name="api.ut.backendRequestTime"
expression="get-property('SYSTEM_TIME')"/>
<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
<then>
<send>
<endpoint key="FUNAPI--v3.0.0_APIproductionEndpoint"/>
</send>
</then>
<else>
  <sequence key="_sandbox_key_error_"/>
</else>
</filter>
</inSequence>
<outSequence>
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
<send/>
</outSequence>
</resource>
<handlers>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.common.APIMgtLatencyStatsHandler"/>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.CORSRequestHandler">
<property name="apiImplementationType" value="ENDPOINT"/>
</handler>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler">
<property name="RemoveOAuthHeadersFromOutMessage" value="true"/>
</handler>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.throttling.ThrottleHandler"/>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtUsageHandler"/>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtGoogleAnalyticsTrackingHandler">
<property name="configKey" value="gov:/apimgt/statistics/ga-config.xml"/>
</handler>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.ext.APIManagerExtensionHandler"/>
</handlers>
 </api>

Request I am making from postman and below is the request form:

curl -X POST \
  https://xxx.xx.xx/api/funapifun/1.0.0/fun \
  -H 'Accept: */*' \
  -H 'Authorization: Bearer <tokenvalue>' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Host: xxx.xx.xx' \
  -H 'Postman-Token: e729-4c33-b3fc-3337cd63d691,c5cbadcd-dace-487d-9cc0- 
  8e833262905b' \
  -H 'User-Agent: PostmanRuntime/7.11.0' \
  -H 'accept-encoding: gzip, deflate' \
  -H 'cache-control: no-cache'
  -H 'content-length: 51' \
  -d '{
  "abc": "xxx",
  "cde": "iouiio"
    }'

Can someone please help me.

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source