How to handle Error code 50000 in wso2esb - wso2

I am using wso2esb4.7.0 and wso2dss3.0.0.
i am getting this error some times not every time
if i tried with multiple user then its successful for 1 or 2 user other returning 50000 error code.
i mentioned this property in every sequence
<property name="FORCE_ERROR_ON_SOAP_FAULT" value="true"/>
so my user are unable to process there data continue sly why it is getting like this
what is the error behind this?
error is coming like this
[2014-03-06 18:10:01,473] WARN - EndpointContext Endpoint : endpoint_5c5f8a43ba64941b19b81abcebf92924c90a25e29775053c will be marked SUSPENDED as it failed
[2014-03-06 18:10:01,473] WARN - EndpointContext Suspending endpoint : endpoint_5c5f8a43ba64941b19b81abcebf92924c90a25e29775053c - current suspend duration is : 30000ms - Next retry after : Thu Mar 06 18:10:31 IST 2014
[2014-03-06 18:10:01,475] INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:60fea14f-daa6-413e-82b8-8dbb640492c6, Direction: response, MESSAGE = Executing default 'fault' sequence, ERROR_CODE = 500000, ERROR_MESSAGE = null

You are getting error code 500000 as you used following property.
<property name="FORCE_ERROR_ON_SOAP_FAULT" value="true"/>
See ESB Error Handling docs.
I think you should investigate why your endpoint is failing.
ESB is suspending your endpoint due to the failure and it will help to make sure ESB is running smoothly.
You can configure suspend on failure related values. Check ESB doc on Endpoint Error Handling.
There is a good article on error handling as well.
I hope this helps

Related

wso2am 2.6.0: SSL exception when invoking API which uses custom class mediator

Installed wso2am 2.6.0.
Created and published API - Myapi. Myapi is visible in API store and it can be invoked from there (receives correct response).
Created my own custom class demo mediator (nothing fancy, just outputs some information) and uploaded it to <API-M_HOME>/repository/components/lib.
Created sequence xml with my own custom class and manually uploaded it for Myapi (in API publisher 'Enabled message Mediation', for 'In Flow').
Restarted server and it looks like registered my custom class mediator successfully.
But now then i try to invoke this API through API store it throws such exception:
[2019-03-23 21:04:00,858] ERROR - SourceHandler I/O error: Received fatal alert: certificate_unknown
javax.net.ssl.SSLException: Received fatal alert: certificate_unknown
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1666)
at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1634)
at sun.security.ssl.SSLEngineImpl.recvAlert(SSLEngineImpl.java:1800)
at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:1083)
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:907)
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:781)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
at org.apache.http.nio.reactor.ssl.SSLIOSession.doUnwrap(SSLIOSession.java:245)
at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:280)
at org.apache.http.nio.reactor.ssl.SSLIOSession.isAppInputReady(SSLIOSession.java:410)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:119)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:159)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:338)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:316)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:277)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:105)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:586)
at java.lang.Thread.run(Thread.java:748)
[2019-03-23 21:04:00,874] INFO - LogMediator IN_MESSAGE = json_validator
[2019-03-23 21:04:00,879] INFO - LogMediator STATUS = Executing default 'fault' sequence, ERROR_CODE = 0, ERROR_MESSAGE = Error occured in the mediation of the class mediator
Same issue happens when i selected another i.e. json_validator mediator (which is not my custom, so issue is not just in my custom mediator), but i.e. with debug_in_flow mediator everything works.
It seems that this issue appears when mediator uses some class mediator and then it throws this SSL exception.
Any ideas where certificate should be added? As I understand inner service tries to invoke custom java class without certificate and fails.
Exception is throwing, but it doesn't affect custom mediator flow.

WSO2 APIM Application Registration urn:approve action not found

UPDATE: We have reproduced the same problem connecting to EI 6.1.1 business process module
We are trying to implement a application registration (generation of key) for API manager (version 2.1.0), using BPS (version 3.6.0).
For this, we are following the instructions in
https://docs.wso2.com/display/AM210/Adding+an+Application+Registration+Workflow
We have also corrected a typo in the content of the package, as provide by the
https://github.com/wso2/product-apim/pull/2730/files#diff-737be153055f194110665b96252dcebe
The previous workflow (ApplicationCreation) works fine, but this, when we click in "GenerateKeys" in store, fails with error in BPS, saying that the action urn:approve is invalid
TID: [-1234] [] [2018-06-20 21:11:32,909] DEBUG {org.wso2.carbon.bpel.messagetrace} - Message received: ApplicationRegistrationWorkFlowProcess.{http://workflow.application.apimgt.carbon.wso2.org}initiate {org.wso2.carbon.bpel.messagetrace}
TID: [-1234] [] [2018-06-20 21:11:33,824] WARN {org.apache.axis2.addressing.AddressingFaultsHelper} - triggerActionNotSupportedFault: messageContext: [MessageContext: logID=11ff1a7f886692cdddf6394b6d5e88da06b8bac0e1095ec3] problemAction: urn:approve {org.apache.axis2.addressing.AddressingFaultsHelper}
TID: [-1234] [] [2018-06-20 21:11:33,830] ERROR {org.apache.axis2.engine.AxisEngine} - The [action] cannot be processed at the receiver. {org.apache.axis2.engine.AxisEngine}
org.apache.axis2.AxisFault: The [action] cannot be processed at the receiver.
We have checked, in BPS carbon console, that the service ApplicationRegistrationWorkFlowProcess is deployed, and the WSDL 1.1 endpoint is deployed with soapAction=urn:approve.
The endpoint in API Manager (store), the workflow-extensions in registry /_system/governance/apimgt/applicationdata/workflow-extensions.xml are modified as described to
<SandboxApplicationRegistration executor="org.wso2.carbon.apimgt.impl.workflow.ApplicationRegistrationWSWorkflowExecutor">
<Property name="serviceEndpoint">http://apibps.example.com:9765/services/ApplicationRegistrationWorkFlowProcess/</Property>
<Property name="username">admin</Property>
<Property name="password">admin</Property>
<Property name="callbackURL">https://apimanager.example.com:8243/services/WorkflowCallbackService</Property>
</SandboxApplicationRegistration>
I tested the same with APIM 2.2.0 and BPS 3.6.0 and EI 6.2.0. It worked fine. Can you change the port in callbackURL of SandboxApplicationRegistration in workflow-extensions.xml to 8248 and retry?

WSO2 Token regeneration issue in store

I am using wso2 standalone on Linux machine, I have changed configuration for SSL to use own certificate. I followed this guide,
https://docs.wso2.com/display/ADMIN44x/Creating+New+Keystores
Now I am having some issue, when I am regenerating the tokens in store > applications > sandboxkeys or productionkeys then it is giving an error,
Token revoke failed : HTTP error code : 500
in logs,
[2017-09-20 06:58:56,114] WARN - EndpointContext Endpoint : AnonymousEndpoint with address https://{uri.var.hostname}:{uri.var.portnum}/oauth2/revoke will be marked SUSPENDED as it failed
[2017-09-20 06:58:56,114] WARN - EndpointContext Suspending endpoint : AnonymousEndpoint with address https://{uri.var.hostname}:{uri.var.portnum}/oauth2/revoke - last suspend duration was : 30000ms and current suspend duration is : 30000ms - Next retry after : Wed Sep 20 06:59:26 UTC 2017
[2017-09-20 06:58:56,114] INFO - LogMediator STATUS = Executing token 'fault' sequence, ERROR_CODE = 101500, ERROR_MESSAGE = Error in Sender
[2017-09-20 06:58:56,115] INFO - HandlerUtils Massage Info: Transaction id=5857679204959341105735016 Message direction=OUT Server name=gitcapp.com Timestamp=1505890736115 Service name=__SynapseService Operation Name=mediate
[2017-09-20 06:58:56,146] ERROR - subscription-add:jag java.lang.RuntimeException: Token revoke failed : HTTP error code : 500
However rest is working fine, endpoints are working fine for HTTPS.
Can anyone please help me out here?
Thanks in advance.
Make sure you have configured <APIKeyValidator> section in api-manager.xml properly, like this.
<APIKeyValidator>
<!-- Server URL of the API key manager -->
<ServerURL>https://your.new hostname.com:9443/services/</ServerURL>

WSO2 ESB Proxy to WSO2 IS RemoteUserStoreManagerService

I want to proxy RemoteUserStoreManagerService (exposed on WSO2 IS) over WSO2 ESB.
When I call getUserClaimValuesForClaims operation I get the response. I tested the WSO2 IS (connected to my Active Directory) for performance. I sent requests in 100 threads (each thread with 250ms delay) and it gave me an average response of 250ms (which is ok for me).
So I proxied the getUserClaimValuesForClaims operation using the Transformation proxy and it also worked. But during the performace testing (with the same or smaller load) I have got following errors and not all the messages have returned (on average 1 of 100 messages).
[2014-01-06 19:28:21,047] INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:d2b85c03-beaf-409b-bf39-2e8143bd9e0b, Direction: response
[2014-01-06 19:28:38,441] ERROR - SourceHandler I/O error: An established connection was aborted by the software in your host machine
java.io.IOException: An established connection was aborted by the software in your host machine
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:25)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:202)
at sun.nio.ch.IOUtil.read(IOUtil.java:175)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:243)
at org.apache.http.nio.reactor.ssl.SSLIOSession.receiveEncryptedData(SSLIOSession.java:348)
at org.apache.http.nio.reactor.ssl.SSLIOSession.isAppInputReady(SSLIOSession.java:376)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady
[2014-01-06 19:29:14,051] WARN - TargetHandler http-outgoing-66: Connection time out while in state: REQUEST_DONE
[2014-01-06 19:29:14,061] WARN - EndpointContext Endpoint : AnonymousEndpoint will be marked SUSPENDED as it failed
[2014-01-06 19:29:15,041] WARN - EndpointContext Suspending endpoint : AnonymousEndpoint - last suspend duration was : 30000ms and current suspend duration is : 30000ms - Next retry after : Mon
[2014-01-06 19:29:14,451] WARN - SourceHandler Connection time out after request is read: http-incoming-57
I thing that it says, it timeouts on backend; but I get the response logged in faultSeuence.
I noticed that the problem is caused by the XSLT mediator in proxy implementation, because when I removed the xslt mediators the log is empty. I tried xquery and it was the same. Even the log mediator in outSequence causes this issues.
Here is my final Proxy.
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="GetUserProxy" transports="https http" startOnLoad="true" trace="disable">
<target>
<endpoint>
<address uri="https://localhost:9443/services/RemoteUserStoreManagerService.RemoteUserStoreManagerServiceHttpsSoap12Endpoint/"/>
</endpoint>
<inSequence/>
<outSequence>
<log/>
<send/>
</outSequence>
<faultSequence/>
</target>
</proxy>
When I remove the log mediator, the WARN messages disapears from log and ALL response messages are returned to SoapUI.
Could anybody tell me why it behaves this way?
Thank you very much.
David
RemoteUserStoreManagerService is an admin service. Therefore, you need to send Identity Server's user name/password in a basic authentication header or session cookie. I can not see setting of authorization headers in your proxy configuration such as following
<property expression="fn:concat('Basic ', base64Encode('username:password'))" name="Authorization" scope="transport"></property>
More details would be here. Also you need to create a message body to send to the "RemoteUserStoreManagerService" and read the response messages. These must be implemented using ESB configuration. However, you can write an custom ESB mediator to do this also. Sample java code to call this service can be found here. You can find the detail on writing custom mediator from here
We have figured out, that the problem is probably more general and doesn't relate only to WSO2 IS, because we have the same problem when similating the WSO2 IS service as SoapUI mock.
The problem is probably in HTTP-passthru transport in axis configuration, because when we switched to HTTP-NIO the problem disapears and it is even faster.
There is a post about performance tunnig that helped us.
Howevever, I would like to know what transport we should use in production or where the problem is. Because now it seems that we cannot use HTTP-passthru transport for production environment.
Is anyone experiencing this problem?
what are the versions of ESB and IS your working with..?
try to restart the ESB and call the Service again. Do remember call to Identity server is a secure call.

WSO2 API Manager service API call failure while loading throttling policy

Currently we are trying to expose our Axis2 web services via WSO2 API manager. However in some cases service do not return result and looking at logs on WSO2 API manager we see the following
ERROR {org.wso2.carbon.apimgt.gateway.handlers.throttling.APIThrottleHandler} - Unable to load throttling policy using key: gov:/apimgt/applicationdata/tiers.xml {org.wso2.carbon.apimgt.gateway.handlers.throttling.APIThrottleHandler} TID: [0] [AM] [2013-01-07 16:42:22,951]
INFO {org.apache.synapse.mediators.builtin.LogMediator} - To: /TestService/1.0.0, WSAction: urn:testOperation, SOAPAction: urn:testOperation, MessageID: urn:uuid:a8f94f58-5e2d-4d51-afc7-83182b51d173, Direction: request, STATUS = Executing default 'fault' sequence, ERROR_CODE = 0, ERROR_MESSAGE = Unable to load throttling policy using key: gov:/apimgt/applicationdata/tiers.xml, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><p:testOperation xmlns:p="http://example.com"><param>d1</param></p:testOperation></soapenv:Body></soapenv:Envelope> {org.apache.synapse.mediators.builtin.LogMediator}
For configuration i use the default h2 database as registry and mysql database for user and api manager database.
This issue is a known issue [1],which will be fixed in the next AM release. We also encountered this issue at a instance,when we are trying invoking two different APIs at same time or within short time period.
Thanks;
[1] https://wso2.org/jira/browse/APIMANAGER-835