Just FYI, I think I saw frequent connection issue yesterday as well however in evening they were less when I was trying to get ticks for Crude Oil. Greatly appreciate any suggestion or help from you.
Hi Rakesh and team, I am able to run on_ticks callback and calculation on those ticks in different threads now.
Nonetype error doesn't occur now.
Thanks a lot for your suggestion.
Another thing I noticed is -
1. Before using "threaded = Ture" entire execution was in MAinThread
2. After using "threaded = True", now on_ticks and any method called within on_ticks is in Thread-1
I am not able to run on_ticks and method call wit…
I tried below code with "threaded = true" and still end up getting same error after few executions.
Could you please suggest?
----------------------------------------------------------
try:
kws.connect(threaded=True)
except Exception as e:
…
By the way, you can also replicate this in production by just inducing any simple exception in "on_ticks" callback method and it will happen after few ticks(could be big number of ticks also).
Now this situation is pretty random, my real code doesn…
As you can see even with exception my program keep running after every tick until it stumbles upon "Nonetype" exception when it stops executing further and I have to terminate my python program as nothing happens after that on consecutive ticks.
I …
I tried to bang my head a lot but no vein. I even changed your code to "self.frame_data = []" but now instead of "Nonetype" exception, it just stops execution after it reaches that point.
BElow is my code where I use on_ticks callback function, how …
File "\venv\lib\site-packages\autobahn\websocket\protocol.py", line 1218, in consumeData
while self.processData() and self.state != WebSocketProtocol.STATE_CLOSED:
File "\venv\lib\site-packages\autobahn\websocket\protocol.py", line 1578, in p…
File "\venv\lib\site-packages\twisted\internet\selectreactor.py", line 149, in _doReadOrWrite
why = getattr(selectable, method)()
File "\venv\lib\site-packages\twisted\internet\tcp.py", line 243, in doRead
return self._dataReceived(data)
…
You are right about that. I am able to replicate this error by causing any simple exception on every tick. With same faulty code exception in question appears after random number of exception's occurrence caused by me.
I am not able to paste except…
Ok, I figured that problem with pasting stacktrace was not with length but name of folder I kept KITE API. I just removed that and it worked.
Please check the stacktrace now.
Unhandled Error
Traceback (most recent call last):
File "\venv\lib\site-packages\kiteconnect\ticker.py", line 532, in connect
reactor.run(**opts)
File "\venv\lib\site-packages\twisted\internet\base.py", line 1283, in run
self.mainLoop()
…
I am able to replicate this exception now by just printing a boolean value at each tick which fails as boolean needs to be converted to string.
That "print" keeps failing on each tick and after a random number of failures, I get failure from "proto…
Looked into protocol.py file and found that frame_data is set to None how it could be set to it's default value [] instead of none. I am not sure but something is triggering onMEssageFrameEnd method and resulting frame_data to NoneType but it should…
I too got the same error and believe status was "Trigger Pending". I will test it again as I can test only until 3:30 PM. I will test and update tomorrow morning. For your reference below is my code:
for i in range(len(kite.orders())):
…
on_tick callback is working perfectly fine. seems to be issue with Orders related websocket connections only.
I would need to make my program failsafe or at least having good exception handling.
Appreciate any help from you on this.
I got similar error in order_history also. Is it today's specific issue with kite connection?
Or could be my network at home?
self.kite.order_history(order_id)[-1]["status"].find("COMPLETE") != -1):
Got below error while calling method above:
req…
I am also able to get ticks but getting "kiteconnect.exceptions.GeneralException: Request method not allowed", when I try to place order. I am using Python APIs and code below to place order.
order_id = kite.place_order(variety= kite.PR…