Kite 3- connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket


Getting this error on KiteTicker on Kite 3. I am using python. What does this mean? How can this be resolved? Previous version of kite works fine.
Error from: KiteTicker
Error code: 1006
Error reason:
connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
  • razcads
    Boys you have changed your kiteticker behaviour in the way it handles exceptions. In previous kite version if your code had any errors websocket wouldnt close it would throw error(s) and continue, here it throws an error and on_close event as well. Atleast thats my reading of the problem.
    I had a code error - usage of a variable before assignment - and I ended up with kiteticker throwing this weird 1006 error. I see many guys have reported the same 1006 error which was not coming up before. You need to put up some communication or update your change log to indicate this change in behaviour else you will keep getting the same question on 1006 over and over again.
  • zartimus
    @razcads I m sure traceback will be printed to stdout for errors like `usage of a variable before assignment`. KiteTicker class also supports a debug flag which further shows you all debug logs including that of twisted.
  • razcads
    @zartimus yes traceback is printed for errors but previously websocket wouldnt close.

    Anyway leave that.. why do you send an on_close event when a new KiteTicker connection is made using kws.connect(). I can see for every new connection i get back on_close event which basically has no impact on the current KiteTicker session. Is this by design that an on_close is sent for new KiteTicker connections to flush out old socket connections?
  • zartimus
    zartimus edited May 2018
    @razcads Please post your ticker code. No, new ticker connection wont trigger on_close. You cant run multiple ticker instances in the same python process.
  • razcads
    @zartimus My code blocks are the same example blocks you have displayed for KiteTicker streaming. I have a lot of custom code in def on_ticks function though. Anyway I see that when a programming error (error in user code) occurs within the def on_ticks(ws, ticks) function the web ticker sends the details of error and the also an on_close call back event. Ticker subsequently reconnects. Can you confirm this behavior?
  • zartimus
    @razcads Yep. I can confirm that behaviour when a programming error occurs.
  • razcads
    Perfect.. thanks!
This discussion has been closed.