cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
1021
Views
16
Helpful
2
Replies
Highlighted
Beginner

Rest Call Timeout Error Handling

I have a cvp studio application that is using the Rest Client element.  We are seeing frequent timeout errors when making the Rest call.  The Read timeout is set at 30000 currently.  We're finding that sometimes the call is taking longer than that.  Currently when this time expires the call is dropped.  In the events on the Rest Client element I configured an event for java.net.SocketTimeoutException and one for java.lang.Exception thinking that would allow the call to continue on instead of getting dropped.  I must not have my Event set correctly though given the call drop.  The error log is below.  I'm wondering what I should set the Error Event as to capture this correctly and not drop the call?  On the other side we realize this REST call shouldn't take that long and are working on that as well, but still want/need to figure out what to do if the Read timeout occurs.  Thanks!

.1517949183121.604516.GetProductsById,02/06/2018 14:33:33.793, The error was: A built-in element encountered an exception of type com.sun.jersey.api.client.ClientHandlerException. The root cause was: com.sun.jersey.api.client.ClientHandlerException: java.net.SocketTimeoutException: Read timed out

com.audium.server.AudiumException: A built-in element encountered an exception of type com.sun.jersey.api.client.ClientHandlerException.

    at com.audium.server.voiceElement.ActionElementBase.service(ActionElementBase.java:416)

    at com.audium.server.controller.Controller.goToAction(Controller.java:4363)

    at com.audium.server.controller.Controller.goToElement(Controller.java:3999)

    at com.audium.server.controller.Controller.continueCall(Controller.java:3679)

    at com.audium.server.controller.Controller.doPost(Controller.java:1099)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)

    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)

    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)

    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)

    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502)

    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

    at java.lang.Thread.run(Thread.java:745)

Caused by: com.sun.jersey.api.client.ClientHandlerException: java.net.SocketTimeoutException: Read timed out

    at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:151)

    at com.sun.jersey.api.client.Client.handle(Client.java:648)

    at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)

    at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)

    at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:507)

    at com.audium.server.action.rest.client.RestClientUtil.doGet(RestClientUtil.java:449)

    at com.audium.server.action.rest.client.RestClientUtil.executeAPI(RestClientUtil.java:314)

    at com.audium.server.action.rest.client.RestClientAction.doAction(RestClientAction.java:280)

    at com.audium.server.voiceElement.ActionElementBase.service(ActionElementBase.java:390)

    ... 26 more

Caused by: java.net.SocketTimeoutException: Read timed out

    at java.net.SocketInputStream.socketRead0(Native Method)

    at java.net.SocketInputStream.read(SocketInputStream.java:152)

    at java.net.SocketInputStream.read(SocketInputStream.java:122)

    at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

    at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

    at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687)

    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)

    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1323)

    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)

    at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:249)

    at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:149)

    ... 34 more

.1517949183121.604516.GetProductsById,02/06/2018 14:33:33.871,A VoiceXML error occurred of type "error.badfetch"

.1517949183121.604516.GetProductsById,02/06/2018 14:33:33.871,An error has occurred.

2 REPLIES 2
Highlighted
Rising star

The error at the bottom of your log 'error.badfetch' means that the

voicexml gateway is timing out. That may be why it's 'dropping' the call.

Right before your rest call, in the audio element just prior, go into

the Settings tab and configure the VoiceXML Properites:

fetchtimeout  60s

fetchaudio     http://media/en-us/app/music.wav (pointToAudioAsFiller)

By the way, it should never 'drop' the call. It should go back to ICM

down the ErrorPath of the GS,Server,V.

If you hear  "I'm sorry, we're experiencing difficulty..." and then it's

'hanging up' - look under the Studio app in

Project/Properties/CallStudio/GeneralSettings. Ensure that 'Subdialog'

is set to 'true' - so it sends unhandled exceptions back to ICM.

Highlighted

Genius, Thanks!

Content for Community-Ad