ReactorNotRestartable

Gjain75
kws.connect(threaded=True)
Exception in thread Thread-10:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\ProgramData\Anaconda3\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\twisted\internet\base.py", line 1317, in run
self.startRunning(installSignalHandlers=installSignalHandlers)
File "C:\ProgramData\Anaconda3\lib\site-packages\twisted\internet\base.py", line 1299, in startRunning
ReactorBase.startRunning(cast(ReactorBase, self))
File "C:\ProgramData\Anaconda3\lib\site-packages\twisted\internet\base.py", line 843, in startRunning
raise error.ReactorNotRestartable()
twisted.internet.error.ReactorNotRestartable
Tagged:
  • Gjain75
    Fabulous! I expected response like that on StackOverflow.com. I did go through these FAQs before posting, but couldn't find solution. Kindly bear, I am not a developer, but a finance professional. Have learnt basics of coding and trying to make do things on my own. You may choose to ignore this, or extend a helping hand with a generous heart.
  • Gjain75
    @rakeshr I looked at all documentation. the problem is not getting solved. "Reactor Not Restartable" error comes when 'kws.connect()' is run again in a live session already successfully connected. However, running it for the first time after establishing connection successfully, gives below error, which I am unable to debug, tried many times:

    ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (403 - Forbidden))
  • tahseen
    @Gjain75

    Could you share more part of your code to understand ? It seems you are trying to run something in thread and there is an uncaught error thrown in that thread and because of that the web socket connection is getting closed

    While you are seeing Connection error: 1006, it is not related to web socket of kite at all

    If you are new to python, this kind of error might mislead you into thinking that there is kite library issue but it is not.
  • Gjain75
    Gjain75 edited August 28
    got connected, I was passing wrong parameter..
  • Gjain75
    Gjain75 edited August 28
    Its solved for the time being:

    it gets connected, I was making an error in kws.connect - instead of passing 'access_token' I passed 'api_secret'. Now it connected, figuring out next step.
  • Gjain75
    @rakeshr Thank you Rakesh and Tahseen. My issue is resolved. Its been my 2nd day, and I guess I would need more time to come to terms with technicals. However, as of now, I am able to get streaming data. Now figuring out how to save it and use multi threading.
  • Gjain75
    My issue is solved, with brilliant example on multi thread, I am now able to get data flawlessly. This post may kindly be closed by the moderator.
This discussion has been closed.