Getting "Error: RSV2 and RSV3 must be clear" error and websocket disconnects while placing order

davidheisnam
When I try to place an order using the JavaScript client, I get the above error mentioned in the title. Then the websocket disconnects and reconnects.

I'm receiving the error in the Kite.Ticker.on('error') listener. I'm using the code below to place the order and it is getting placed.

placeOrder("co", {
exchange: 'NSE',
tradingsymbol: 'SAIL',
transaction_type: 'BUY',
quantity: 1,
product: 'MIS',
trigger_price: 130,
order_type: 'MARKET',
validity: 'DAY'
});

Could anybody tell me why this error is occuring? It's a real deal breaker if the websocket connect disconnects every time I place an order.
  • rakeshr
    When I try to place an order using the JavaScript client, I get the above error mentioned in the title. Then the websocket disconnects and reconnects.
    It's not recommended to block the kite ticker main thread, by performing any computation/API calls inside the same. This thread, explains more on this. Maybe you can consider using async for such calls.
  • davidheisnam
    Hi @rakeshr Thanks for the response. I'm actually using async for all my functions so it's a strange issue if it really is caused by the thread being blocked especially since I don't have any heavy computation happening inside those functions. Let me look further into this and share my findings here.
  • davidheisnam
    davidheisnam edited June 2021
    I found the issue. I had an exception in Ticker.on('update_trade') so it was crashing the websocket thread. Thanks for the help, @rakeshr .
This discussion has been closed.