Connection error: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (429

niftystockmarketshow
I get this error when i try to connect to the Kite Ticker -

Connection error: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (429 - TooManyRequests))

I know that this error happens if we open too many web socket connections.
I have shut down all my servers completely.

My server crashed unexpectedly, and now how do I close these socket connections ?
I read that if the server is shut down abruptly, the socket close registration does get happen on Zerodha servers.

How do I recover from this situation now ? @sujith please help.
  • niftystockmarketshow
    @rakeshr , your help would be much appreciated too.
  • rakeshr
    connection was closed uncleanly (WebSocket connection upgrade failed (429 - TooManyRequests))
    I know that this error happens if we open too many web socket connections.
    Yes, this happens when you are exceeding the maximum allowed limit for WebSocket connection.
    I read that if the server is shut down abruptly, the socket close registration does get happen on Zerodha servers.
    Yes, a complete close connection does get registered at our ws server. But, abrupt disconnections don't get registered at the server for the hanging connections. So, make sure you are force-killing the hanging script/connections.
    Also, you can invalidate the access token, to kill the active running session using invalidate_access_token.
  • niftystockmarketshow
    Thank you so much, this worked ! :smile:
Sign In or Register to comment.