Read timed out.

Vaga
I am frequently getting the read timeout error. Below is the error message

{"exc_type": "ReadTimeout", "exc_message": ["ReadTimeoutError(\"HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)\",)"], "exc_module": "requests.exceptions"}
  • rakeshr
    @Vaga
    We are looking at it. For time being, you can handle ReadTimeout exception at your end, something like:
    try:
    Your code logic here
    except ReadTimeout:
    pass
  • Vaga
    @rakeshr currently, we resend the request 3 times for the all timeout error. Even after 3 iterations of request we are getting the same error in some cases.
  • rakeshr
    @Vaga
    We are aware of this issue and already looking to it. For time being, can you use above exception handle method, that will keep requesting historical response, until data is fetched.
  • Vaga
    Thanks. Please update us when resolved.
  • Ramu772
    I am getting errors from historical api from past week. i am getting all kinds of errors each time. Please let us know if there are any changes made to historical API in last one month

    1. requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
    2. NetworkException: Request failed (kitetrade-common).
    3. requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))
    4. kiteconnect.exceptions.NetworkException: Request failed (kitetrade-common).
  • gkaranam
    Hi @rakeshr @sujith . Any update on the issue fix. I am still getting these error and the connection is being broken.. The links which you provided for us to follow does not show any solution.
  • ravishastry
    ravishastry edited April 2020
    Hi, This error is still not resolved for the current quote api. Any specific cause for this that we can fix from our end?

    ReadTimeout: HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)
  • rakeshr
    @gkaranam @ravishastry
    I am still getting these error and the connection is being broken..
    Hi, This error is still not resolved for the current quote api. Any specific cause for this that we can fix from our end?
    You need to handle the Timeout exception as stated above and retry the request again.
  • sujith
    @ravishastry,
    The cause could be your network or network connection between client and server or our internal hop connection issue. You can either add delay and fetch it or use Websockets API to fetch live market data.
  • AbhishekAlgo
    @gkaranam @sujith

    I am still getting these errors

    self._sslobj.do_handshake()
    socket.timeout: _ssl.c:1106: The handshake operation timed out

    During handling of the above exception, another exception occurred:

    requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)

    Can you tell if there is a problem at my end or it there a timeout if we fetch data using historical api? my network connection is 100% stable as I am using google cloud virtual server
  • rohitm
    will function like below work ? calling itself if there is an error

    def ltp_symbol(symbol):
    try :
    ltp = int(kite.ohlc(['NSE:' + symbol])['NSE:' + symbol]['last_price'])
    except Exception as e:
    print(e)
    ltp_symnol(symbol)
    return ltp
Sign In or Register to comment.