WSO2 API-Manager HTTP Requests terminate after 5mins with Error 101508 - wso2

We deployed a long running HTTP service on WSO2 APIM 3.2.0 that needs approx. 6-15minutes to reply to a request. To support long running HTTP calls we configured the API endpoint timeouts to 15mins and also the APIM in the deployment.toml:
[synapse_properties]
'synapse.global_timeout_interval' = 900000
[passthru_http]
'http.socket.timeout' = 1000000
However, always after exactly 5 minutes we get the following error:
<am:fault xmlns:am=“http://wso2.org/apimanager”><am:code>101508</am:code><am:type>Status report</am:type><am:message>Runtime Error</am:message><am:description>Error in Sender</am:description></am:fault>
This indicates that our backend service is terminating the connection. However, if we call the service directly, i.e. without APIM Gateway it replies after 6-15min. Do we miss any timeout settings in APIM that it completes after 5mins ?
Thanks a lot for your help!
Cheers,
Sebastian

101508, this will happen because the backend endpoint is getting timed out. You could see the occurrences of the endpoint time out and in the same way, the entire HTTP socket also gets timeout in the wso2carbon.log.
Sample endpoint timeout log
TID: [-1234] [] [2022-02-22 21:30:43,187] WARN {org.apache.synapse.endpoints.EndpointContext} - Endpoint : <ENDPOINT> will be marked SUSPENDED as it failed {org.apache.synapse.endpoints.EndpointContext}
Sample socket timeout
TID: [-1] [] [2022-02-22 21:30:43,186] WARN {org.apache.synapse.transport.passthru.TargetHandler} - Connection closed by target host before receiving the response {org.apache.synapse.transport.passthru.TargetHandler
Please check the endpoint and htp.socket.timeout values as mentioned in the WSO2 documentation[1].
You should increase the above values that should be more than 6-15 minutes. You can configure it in milliseconds.
[1] https://apim.docs.wso2.com/en/3.2.0/learn/design-api/endpoints/resiliency/endpoint-timeouts/
Note: The socket timeout value should be greater than both the Synapse global timeout and any endpoint timeouts given for your API.

Related

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>

Callback requests at random ports in WSO2 EI 6.0

I have a proxy to an external web services being called by a schedule task in WSO2 EI 6.0. I can see the request being sent out of the ESB as an instance gets logged in ESB Analytics but it's not clear to me what is happening with the response payload.
These log messages show up in wso2carbon.log file:
TID: [-1] [] [2017-05-08 18:22:27,875] WARN {org.apache.synapse.transport.passthru.SourceHandler} - Connection time out after request is read: http-incoming-85 Socket Timeout : 180000 Remote Address : /XX.XX.XX.XX:35380 {org.apache.synapse.transport.passthru.SourceHandler}
TID: [-1] [] [2017-05-08 18:17:27,896] WARN {org.apache.synapse.transport.passthru.SourceHandler} - Connection time out after request is read: http-incoming-84 Socket Timeout : 180000 Remote Address : /XX.XX.XX.XX:57507 {org.apache.synapse.transport.passthru.SourceHandler}
TID: [-1] [] [2017-05-08 18:12:28,364] WARN {org.apache.synapse.transport.passthru.SourceHandler} - Connection time out after request is read: http-incoming-83 Socket Timeout : 180000 Remote Address : /XX.XX.XX.XX:50387 {org.apache.synapse.transport.passthru.SourceHandler}
XX.XX.XX.XX is the remote address where the webserices are hosted. I can understand from this the the response is getting lost because these ports are not open in the firewall hosting this WSO2 instance, but for security reasons I cannot open all ports so these random ports would always work.
I need to understand why WSO2 is expecting the response at these ports and not on the same port where the request connection was made (443 in my case), and even why a separate connection need to be established since this is a synchronous web service.
Please let me know any resource available containing more details on how the transport pass trough is affecting this.
If this is some functionality from WSO2 or Synapse is there a way to disable it?
If I end up having to open all ports in the firewall to support this, is there a way to limit the random port numbers to an specific range?
Thanks in advance.

Errors using input-only web service (OUT_ONLY from ESB)

I have a webservice with some input only operations. In the ESB i've created a proxy and sets the properties OUT_ONLY and FORCE_SC_ACCEPTED to true. Everytime I call the proxied operation I get the following error message in the wso2carbon.log:
TID: [0] [ESB] [2015-04-02 09:52:45,307] ERROR {org.apache.axis2.transport.base.threads.NativeWorkerPool} - Uncaught exception {org.apache.axis2.transport.base.threads.NativeWorkerPool}
java.lang.UnsupportedOperationException: Not yet implemented
at org.apache.axis2.description.OutOnlyAxisOperation.getMessage(OutOnlyAxisOperation.java:124)
at org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.processResponse(MultitenantMessageReceiver.java:125)
at org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.receive(MultitenantMessageReceiver.java:81)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:225)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Althought everything seems to work OK, I am worried about this message. What am I doing wrong. These input only will be called very frequently in production, so I'd like them to be error free.
WSO2 ESB: 4.8.1
Thanks,
Danny
this exception will occur if OUT_ONLY=true and your backend sending a response back to the esb.if OUT_ONLY is set true, your are getting a response from the backend then it is not a valid scenarion for if OUT_ONLY property.check this post[1]
1.https://mohanadarshan.wordpress.com/2013/05/05/out_only-scenario-in-proxy-service-wso2-esb/
Out-only property is set to inform that this service does not return a response back. For instance if you are sending messages to a message broker. Force-sc-accepted flag causes ESB to send HTTP Accepted status response back to the client (which calls ESB) since otherwise client will timeout without a reaponse. So please make sure your backend service does not send a response and it is accessible to ESB.
Solved this issue for now: My ESB was running in multi-tenant mode. The proxy service were created in the tenant. I did a fresh install and put the config in (so no tenants). The error disappears immediately. When I remove the config and create a tenant and put the config into the tenant the error reappears. So might this be a bug. I can try to verify with running sample 253 (OneWayProxy) in a tenant.

Can we use Multiple Users at a time for one service in wso2 Esb

my client sending me single request that time my proxy processing the response well
whenever number of clients increasing my proxy went error
means same service hit by number of client request with HTTP request
my error like this
PassThroughHttpListener System may be unstable: HTTP ListeningIOReactor encountered a runtime exception : null
java.lang.NullPointerException
at org.apache.synapse.transport.passthru.SourceResponse.start(SourceResponse.java:83)
at org.apache.synapse.transport.passthru.SourceHandler.responseReady(SourceHandler.java:184)
at org.apache.http.impl.nio.DefaultNHttpServerConnection.produceOutput(DefaultNHttpServerConnection.java:223)
at org.apache.http.impl.nio.DefaultServerIOEventDispatch.outputReady(DefaultServerIOEventDispatch.java:161)
at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:179)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:344)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:318)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:278)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:542)
at java.lang.Thread.run(Thread.java:679)
Can we handle number of clients in wso2esb for that i need to set any HTTP NOnBlocking Property

Blackberry Httpconnection Request Timeout issue

I am facing issue related to Httpconnection request timeout (not response timeout).
When i am trying to connect with the server via application i am getting response code 408 or 502 but the same url is working on the blackberry default browser (plz not that this happen only in the 3G network).
And this issue not reprodusing each and every time but it occurs 70 % times.
From Wikipedia http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
408 Request Timeout
The server timed out waiting for the request.[2] According to W3 HTTP specifications: "The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time."
502 Bad Gateway
The server was acting as a gateway or proxy and received an invalid response from the upstream server.
So I am guessing some sort of proxy/gateway needs to be set in your application (as may be set in your default BB browser).
Cheers!