I am using websocket to get real time data for multiple symbols. the subscription is full mode. After sometime the mode is changed to quote on its own even thought I have made no change in subscription mode type.
getting below errors today. this is coming from zerodha package 'kiteconnect.ticker'
Inside the method 'def on_ticks(ws, tick)' I have currently added nothing & left it blank as I was getting these error very frequently.
Below are 2 types of error, can u suggest what needs to be done as these error logs are flooding the logs and meaningful logs are getting lost
2020-01-01T05:41:58.924725000Z ERROR:kiteconnect.ticker:Connection error: 0 - Message too big. Connection will be closed. 2020-01-01T05:41:58.947352000Z ERROR:kiteconnect.ticker:Connection error: 0 - Message too big. Connection will be closed. 2020-01-01T05:41:58.947571000Z ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time))
2020-01-01T05:50:00.018213000Z ERROR:kiteconnect.ticker:Connection error: 0 - Message too big. Connection will be closed. 2020-01-01T05:50:00.018403000Z ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
@prateek3211 I am developing code in python and need help!!! 1] By what method you are checking the size of "ticks" received on websockets ? (Especially imp when you have more than 1 full mode subscriptions & response tick is received only when there is any change in script LTP) 2] Has this "auto abrupt mode change" problem resolved? If so how? 3] Also if heart beats (of 1 byte fixed length) are received, is it having any fixed value???
After some exception as logged below the subscription changed to quote from full mode.
2019-12-23T11:01:30.610237000Z INFO:root:{'tradable': True, 'mode': 'full', 'instrument_token': 10224898, 'last_price': 610.35, 'last_quantity': 20, 'average_price': 607.64, 'volume': 3380, 'buy_quantity': 4640, 'sell_quantity': 3280, 'ohlc': {'open': 678.95, 'high': 679.0, 'low': 563.2, 'close': 600.25}, 'change': 1.6826322365681003, 'last_trade_time': datetime.datetime(2019, 12, 23, 9, 52, 17), 'oi': 1200, 'oi_day_high': 2140, 'oi_day_low': 1160, 'timestamp': datetime.datetime(2019, 12, 23, 10, 49, 41), 'depth': {'buy': [{'quantity': 40, 'price': 600.5, 'orders': 1}, {'quantity': 80, 'price': 600.0, 'orders': 1}, {'quantity': 20, 'price': 572.2, 'orders': 1}, {'quantity': 200, 'price': 556.85, 'orders': 1}, {'quantity': 200, 'price': 555.85, 'orders': 1}], 'sell': [{'quantity': 20, 'price': 613.5, 'orders': 1}, {'quantity': 20, 'price': 622.0, 'orders': 1}, {'quantity': 20, 'price': 630.05, 'orders': 1}, {'quantity': 200, 'price': 638.1, 'orders': 1}, {'quantity': 200, 'price': 639.1, 'orders': 1}]}}
2019-12-23T11:01:54.220896000Z ERROR:kiteconnect.ticker:Connection error: 0 - Message too big. Connection will be closed.
2019-12-23T11:01:54.221120000Z ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
2019-12-23T11:01:54.221315000Z ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
2019-12-23T11:01:54.700691000Z INFO:root:instrument tokens populated for NIFTY with size 384
2019-12-23T11:01:54.700914000Z ERROR:kiteconnect.ticker:Connection error: 0 - Message too big. Connection will be closed.
2019-12-23T11:01:54.701115000Z ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
2019-12-23T11:01:54.701309000Z ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
2019-12-23T11:01:56.020208000Z ERROR:kiteconnect.ticker:Connection error: 0 - Message too big. Connection will be closed.
2019-12-23T11:01:56.020445000Z ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
2019-12-23T11:01:56.020627000Z ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
2019-12-23T11:01:56.434035000Z ERROR:kiteconnect.ticker:Connection error: 0 - Message too big. Connection will be closed.
2019-12-23T11:01:56.444185000Z ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
2019-12-23T11:01:56.444400000Z ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
2019-12-23T11:01:56.848323000Z INFO:root:{'tradable': True, 'mode': 'quote', 'instrument_token': 10224898, 'last_price': 610.35, 'last_quantity': 20, 'average_price': 607.64, 'volume': 3380, 'buy_quantity': 4640, 'sell_quantity': 3280, 'ohlc': {'open': 678.95, 'high': 679.0, 'low': 563.2, 'close': 600.25}, 'change': 1.6826322365681003}
2019-12-23T11:01:57.712710000Z INFO:root:{'tradable': True, 'mode': 'quote', 'instrument_token': 10224898, 'last_price': 610.35, 'last_quantity': 20, 'average_price': 607.64, 'volume': 3380, 'buy_quantity': 4640, 'sell_quantity': 3280, 'ohlc': {'open': 678.95, 'high': 679.0, 'low': 563.2, 'close': 600.25}, 'change': 1.6826322365681003}
Facing this issue today as well.
Why is the subscription mode downgraded.
I have even added code as below to update it on every tick:
ws.set_mode(ws.MODE_FULL, OptionsWebsocketHandler.subscription_list)
logs are added to check the size of tick & it worked fine.
Today I have removed the logs but what I am still seeing only quote data.
NIFTY - 20JAN30 - 12200PE
"12200": {
"tradable": true,
"mode": "quote",
"instrument_token": 12396802,
"last_price": 125.95,
"last_quantity": 150,
"average_price": 123.72,
"volume": 548100,
"buy_quantity": 95100,
"sell_quantity": 80475,
"ohlc": {
"open": 124.95,
"high": 131.85,
"low": 116.75,
"close": 130.25
},
"change": -3.3013435700575795
}
As in the response u can see the mode is quote, whereas I have only subscribed to full mode
this is coming from zerodha package 'kiteconnect.ticker'
Inside the method 'def on_ticks(ws, tick)' I have currently added nothing & left it blank as I was getting these error very frequently.
Below are 2 types of error, can u suggest what needs to be done as these error logs are flooding the logs and meaningful logs are getting lost
2020-01-01T05:41:58.924725000Z ERROR:kiteconnect.ticker:Connection error: 0 - Message too big. Connection will be closed.
2020-01-01T05:41:58.947352000Z ERROR:kiteconnect.ticker:Connection error: 0 - Message too big. Connection will be closed.
2020-01-01T05:41:58.947571000Z ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time))
2020-01-01T05:50:00.018213000Z ERROR:kiteconnect.ticker:Connection error: 0 - Message too big. Connection will be closed.
2020-01-01T05:50:00.018403000Z ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
Please paste complete WebSocket code, so that we can reproduce the same at our end.
I am developing code in python and need help!!!
1] By what method you are checking the size of "ticks" received on websockets ? (Especially imp when you have more than 1 full mode subscriptions & response tick is received only when there is any change in script LTP)
2] Has this "auto abrupt mode change" problem resolved? If so how?
3] Also if heart beats (of 1 byte fixed length) are received, is it having any fixed value???