java.io.InterruptedIOException , InputException

stillsweet
Dear sujith ji, i am facing these two exception every now and then, i have read few links shared by you, which mentions that i should update the liabrary provided by kite api, i want to know if you can help me in this ? error log attached for both the exceptions

i am using multithreading so i have put the synchronized keyword in all the kite api methods.

i am trying to put 4 orders(one by one) so is it creating the problem or something else?

please suggest,


===============================================================================
java.io.InterruptedIOException
at okhttp3.internal.http2.Http2Stream.waitForIo$okhttp(Http2Stream.kt:662)
at okhttp3.internal.http2.Http2Stream.takeHeaders(Http2Stream.kt:140)
at okhttp3.internal.http2.Http2ExchangeCodec.readResponseHeaders(Http2ExchangeCodec.kt:96)
at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:106)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:79)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:82)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:74)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:197)
at okhttp3.internal.connection.RealCall.execute(RealCall.kt:148)
at com.zerodhatech.kiteconnect.kitehttp.KiteRequestHandler.postRequest(KiteRequestHandler.java:84)
at com.zerodhatech.kiteconnect.KiteConnect.placeOrder(KiteConnect.java:319)
at mypackage.Strategy.placeLimitSellOrder(Strategy.java:2899)
at mypackage.Strategy$5.onTicks(Strategy.java:1085)
at com.zerodhatech.ticker.KiteTicker$3.onBinaryMessage(KiteTicker.java:275)
at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:368)
at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:270)
at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:990)
at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:749)
at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)
===============================================================================

com.zerodhatech.kiteconnect.kitehttp.exceptions.InputException
at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.dealWithException(KiteResponseHandler.java:54)
at com.zerodhatech.kiteconnect.kitehttp.KiteResponseHandler.handle(KiteResponseHandler.java:20)
at com.zerodhatech.kiteconnect.kitehttp.KiteRequestHandler.putRequest(KiteRequestHandler.java:118)
at com.zerodhatech.kiteconnect.KiteConnect.modifyOrder(KiteConnect.java:356)
at mypackage.FutureToOption.modifySLMSellOrder(FutureToOption.java:2895)
at mypackage.FutureToOption$5.onTicks(FutureToOption.java:1904)
at com.zerodhatech.ticker.KiteTicker$3.onBinaryMessage(KiteTicker.java:275)
at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:368)
at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:270)
at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:990)
at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:749)
at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)
Tagged:
  • sujith
    You need to print the exception message and status code. It seems like you are sending some invalid input.
  • stillsweet
    can you please elaborate how to print exception message and status code in kite api
  • sujith
    You can check out example here.
  • stillsweet
    hello sujith the issue has been resolved as the issue was with readtimeout which i have set to 1500 milliseconds( the issue was generated when there were multiple and frequent calls for getltp() which was making kind of a trafic jam to the network and while waiting for the response it gets timedout for read. so increased the readtimeout and i tried to reduces the trafic(frequent calls) so the issue resolved. Thank you so much for your help
This discussion has been closed.