Time out issues

arpit1984
My python script experienced read timeout error when it tried to place order with kite apis. Was kite apis having network issues today morning between 09:15 and 09:20? Can anyone guide me as how to debug this issue
  • sodha_rakesh
    sodha_rakesh edited September 10
    Yes, since 2 days I am also getting timeout errors.

    Get Order Execution Price Failed
    HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7)

    Is there any changes from Zerodha? The order execution timeout yesterday happed at 9:33 and today at 9:18.
    The same code is running since years without any issues
  • sujith
    Is this local setup or hosted somewhere?
  • sodha_rakesh
    Hosted on AWS EC2
  • santhanakrishnan25
    Mine as well. For the past two days. Getting errors from 9:16 to 9:30.. Getting for historical_data api, kite.orders api and quotes api. @sujith Please help incurring losses due to this (Although have handled the errors, the loss can be avoided if fixed).
  • sujith
    Can you private message IP? We will check and get back to you.
  • sodha_rakesh
    Thanks @sujith
    For me, no issue/error today. Will share details in case encounter the issue again
  • santhanakrishnan25
    Didnt see the issue today. Will share details if we encounter again?
  • santhanakrishnan25
    Saw this issue again @sujith . from 9:51 to 9:56am
  • santhanakrishnan25
    Can you please help. Again 20k loss for us. This is highly erratic. We cant handle such unstable errors that comes adhoc. We have to trigger Killswitch and so missed a good profit of 20K.
    Started at
    2024-09-16 09:51:11,553 - INFO - zerodha Order placement failed: HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7) - 59
    And had this for 5 minutes (16 times it came - We sleep and then retry after a sec)
    2024-09-16 09:56:44,357 - ERROR - getOptionLtp Error => HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7) - 234
    Please help on this @sujith @nithin
  • sujith
    Is this from the Quote API or LTP API? How often do you fetch it?
  • santhanakrishnan25
    We got from multiple APIs.
    1. Quote
    2. LTP
    3. Place the SL orders as well
    We rely on the ticker for all the tokens subscribed. We poll the index once per sec to see possible entry criteria. But this didnt look like api rate limiting.
  • sujith
    It could be because CDN is thinking you are doing DDOS since you keep on requesting continuously, even when you get error. If you are polling HTTP endpoints every second then I would suggest using Websocket API.
  • santhanakrishnan25
    @sujith Can we subscribe for index as well in the websocket API?? What will be the instrument id? Can you give us a sample tick data for NIFTY50 then?
  • santhanakrishnan25
    BTW we are getting at each sec.
    2024-09-18 14:43:50,577 - ERROR - getLtp Error => HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7) - 217
    2024-09-18 14:52:52,837 - ERROR - getLtp Error => HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7) - 217
    2024-09-18 14:56:18,689 - ERROR - getLtp Error => HTTPSConnectionPool(host='api.kite.trade', port=443): Read timed out. (read timeout=7) - 217
  • santhanakrishnan25
    Got the tick
    {
    "instrument_token": 256265,
    "exchange_token": "1001",
    "tradingsymbol": "NIFTY 50",
    "name": "NIFTY 50",
    "last_price": 0.0,
    "expiry": "",
    "strike": 0.0,
    "tick_size": 0.0,
    "lot_size": 0,
    "instrument_type": "EQ",
    "segment": "INDICES",
    "exchange": "NSE"
    },
Sign In or Register to comment.