It looks like you're new here. If you want to get involved, click one of these buttons!
Connection Closed !! Reason: connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)I'm not able to connect to TickerService using kws.connect(threaded = True) .
https://kite.trade/forum/discussion/comment/39433/#Comment_39433
About the websocket not connecting after this error without throwing error,t's because you are using threaded=True ,so the program exits before it can throw the exception. Try without using threaded=True,or put a sleep after connecting with threaded=True,so the program can properly throw the error.
The error will be ReactorNotRestartable error from twisted library.
This is because a twisted reactor is only meant to be started once in a script.
So,you have to restart your script.
You said But
[2022-07-12 17:57:29,130] INFO - Connection Closed !! Reason: connection was closed uncleanly (peer dropped
the TCP connection without previous WebSocket closing handshake)
as you can see from logs time, this error came @17:57, and I have no logic past 15:30, I unsubscribed from all tokens at 15:30, I also checked, no endpoint was hit post 15:30.
I'm still unsure, how this "peer dropped TCP connection" happens.
What type of internal error you might be referring to in this comment?
If you are sure that no error happened in your program,then it might be happening due to really heavy computation.
You can try queue method as described in solution 1 here instead of threaded ticker.
https://kite.trade/forum/discussion/comment/25535/#Comment_25535
Even if this doesn't help,you have to debug yourself.
Queue method, yeah I do eventually plan to switch to that.
Thanks again, appreciate you. : )
Only thing that remains now is locating the root cause of code breaking error, as it happens when neither any calculations are running, nor am I subscribed to any instrument.
In above image, code broke around 08:06 today morning, after working fine the previous day.
I hadn't even logged in by that point.
For now I'm forced to restart script. Anyway, I'll keep looking for the bug.