Kite ticker error:The status code of the opening handshake response is not '101 Switching Protocols'

sudipto
Hi,
Today (may 21, 2020) the kite ticker that I used for trading started giving me intermittent connection error...
com.neovisionaries.ws.client.OpeningHandshakeException: The status code of the opening handshake response is not '101 Switching Protocols'. The status line is: HTTP/1.1 502 Bad Gateway

It get this often, but the retries on the KiteTicker object reconnects it eventually. Today however despite having 50 retries and 30 seconds between each retry, the Kite Ticker couldn't reconnect. The issue started around 14:21:01 hours. Other than the above mentioned error, I also logged the following error...
com.neovisionaries.ws.client.OpeningHandshakeException: The status code of the opening handshake response is not '101 Switching Protocols'. The status line is: HTTP/1.1 403 Forbidden

My Question is the follows....
1. How long was the down time?
2. I have already increased the number of retries, but like today when these things happen in the middle of a trade, it is not possible for my automated algorithm to keep trading, which inevitably results in a loss on that trade. So is there any alternative that I can use?

Regards
Sudipto
  • sujith
    We didn't have any issues yesterday. We checked our logs as well, it seems fine. A 502 for ticker shouldn't have happened. We will monitor today, you can let us know immediately if you face any issue.

    403 means, your session has expired and you need to give a new access token.

    Kite Ticker has nothing to do with rest of the APIs, others should be up and running. If it fails, you can still execute orders.
  • sudipto
    Hi Sujith,
    Three questions...
    1. How can the session expire in the middle of the day while trading when I am continuously accessing various kite rest api as well as consuming the kite ticker?
    2. My program runs on a server completely autonomously without any human intervention for the entire trading day. Only in the morning around 8:45 am, I log on to my server to log my program on to the Zerodha server and hence create the session for the day. Are you suggesting that if such a situation occurs, I have to manually log into my server and make my program log into zerodha once again?
    3. The algorithm needs a continuous feed of the prices to be able to make decisions on executing orders. So even if I can use Kite rest api to execute orders it is no use unless the algo keeps getting the prices fed continuously. Is there any polling mechanism that can be used as a fall back if the kite ticker fails?

    Regards
    Sudipto
Sign In or Register to comment.