HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read time out=7)

razcads
Hi
I got this error while placing order
HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read time out=7)
Never seen this before. Why does this come? Any inputs to avoid this?

Regards
Ravi
  • sujith
    sujith edited May 2018
    If you are facing this at the market opening. You can follow up here.
  • razcads
    @sujith boss this was not at market open. So when and why does this error get thrown?
  • sujith
    The 7 seconds timeout is more like a python client's timeout which means there might be some connectivity issue.
  • razcads
    so you mean python client (place_order function) of kite terminated the connection when it didn't receive a response within 7 seconds is it? So ideally I could catch this error and retry, correct?
  • sujith
    yes but before placing another order double-check the orderbook.
  • razcads
    ok thanks. Is this error message new to kite 3?
  • sujith
    This is more like an error message at the client end. It is not something that is being sent from the server.
  • razcads
    @sujith this is a error message at client end -yes - but client here is Kite place_order function not user written code and server is OMS. My question - Is this exception handling added to place_order function in kite 3? I don't think i saw this error in kite 2.
    I used to get GATEWAY TIMEOUT error in kite 2 for such situations.. Need to know if GATEWAY TIMEOUT error message has been replaced by this error in kite 3. Do recheck and confirm pls.
  • sujith
    There are two things here, one is gateway timeout which occurred because Kite Trade didn't receive any response from the OMS(this is what you are referring to in the above comment) and another one is the above scenario wherein Kite Trade didn't respond within seven seconds.
    But the second scenario can happen when there is a connection issue at client end or because Kite Trade didn't respond within the 7 seconds.

    Since this is happening at client's end even Kite Trade will not have any logs. Do you observe this only for place order or in other API calls also?
    We will write some script to keep making requests every 30 seconds or one minute tomorrow and check.
    In the meanwhile, if you see any pattern here, you can let us know.
  • razcads
    @sujith thanks for the detail. This happened many times on May 21st for place order api - that's the only direct api call i use outside of KiteTicker. But since then i haven't noticed this issue. I will keep a tab though and revert if i sense something fishy!
  • sujith
    @razcads,
    You can update to the latest version of pykiteconnect. We have released a patch for this.
  • razcads
    @sujith thanks.. i will check out. to upgrade to latest version i just do this right? pip install kiteconnect --upgrade --pre
  • sujith
    This should be fine.
    pip install kiteconnect --upgrade
  • saurabh3679
    got this error today : HTTPSConnectionPool(host='api.kite.trade', port=443): Max retries exceeded with url: /orders/191223001184318?order_id=191223001184318 (Caused by ConnectTimeoutError
    (, 'Connection to api.kite.trade timed out. (connect timeout=7)'))
Sign In or Register to comment.