TICK Stopped with Error from Kite package (AttributeError: 'NoneType' object has no attribute )

babansfolio
Hello Team,

Today my Tick data Suddenly stopped with following Error,
This problem repeated 2-3 times in last few months,

If you know what is reason Kite is Throwing's this error and How to solve it then It will be really great help.

================================================================================================
TICK AT 2021-06-15 12:02:44.655586 FOR BANKNIFTY21JUNFUT_NFO FOR 2021-06-15 12:02:27
Traceback (most recent call last):
File "/home/ubuntu/my_folder/my_env/lib/python3.5/site-packages/kiteconnect/ticker.py", line 613, in set_mode
six.b(json.dumps({"a": self._message_setmode, "v": [mode, instrument_tokens]}))
File "/home/ubuntu/my_folder/my_env/lib/python3.5/site-packages/autobahn/websocket/protocol.py", line 2266, in sendMessage
self.sendFrame(opcode=opcode, payload=payload, sync=sync, rsv=4 if sendCompressed else 0)
File "/home/ubuntu/my_folder/my_env/lib/python3.5/site-packages/autobahn/websocket/protocol.py", line 1880, in sendFrame
self.sendData(raw, sync, chopsize)
File "/home/ubuntu/my_folder/my_env/lib/python3.5/site-packages/autobahn/websocket/protocol.py", line 1336, in sendData
self.transport.write(data)
File "/home/ubuntu/my_folder/my_env/lib/python3.5/site-packages/twisted/protocols/tls.py", line 467, in write
self._write(bytes)
File "/home/ubuntu/my_folder/my_env/lib/python3.5/site-packages/twisted/protocols/tls.py", line 547, in _write
self._flushSendBIO()
File "/home/ubuntu/my_folder/my_env/lib/python3.5/site-packages/twisted/protocols/tls.py", line 252, in _flushSendBIO
bytes = self._tlsConnection.bio_read(2 ** 15)
AttributeError: 'NoneType' object has no attribute 'bio_read'
==================================================================================================

  • rakeshr
    rakeshr edited June 16
    AttributeError: 'NoneType' object has no attribute 'bio_read'
    If you know what is reason Kite is Throwing's this error
    This is twisted byte read error.
    Are you trying to open multiple sessions at the same time?
    Also, can you let us know, more about your setup python version and kiteconnect package version(pip show kiteconnect)
  • babansfolio
    Hello,

    I am using one API Session at a time.
    However Multiple GUI Sessions may be have open.

    Here is Kite Connect Vesion:
    ====================================================================
    Name: kiteconnect
    Version: 3.9.2
    Summary: The official Python client for the Kite Connect trading API
    Home-page: https://kite.trade
    Author: Zerodha Technology Pvt ltd. (India)
    Author-email: [email protected]
    License: MIT
    Location: /home/ubuntu/my_folder/my_env/lib/python3.5/site-packages
    Requires: service-identity, autobahn, pyOpenSSL, enum34, requests, python-dateutil, six
    Required-by:
    ==================================================================

    What could be reason of such Errors ?
    How to Prevent it?
  • rakeshr
    Can you upgrade to latest twisted package by pip install twisted --upgrade and then pip install --upgrade kiteconnect and check once, if this reoccurs?
  • babansfolio
    Hello @rakeshr : I had Upgraded to latest twisted package. But Today Problem again reproduced, here is relevant logs, Kindly suggest way forward,

    ==================================================================
    TICK AT 2021-09-03 13:47:20.727443 FOR BANKNIFTY2190938200CE_NFO FOR 2021-09-03 13:47:12
    Traceback (most recent call last):
    File "/home/ubuntu/my_folder/my_env/lib/python3.5/site-packages/kiteconnect/ticker.py", line 613, in set_mode
    six.b(json.dumps({"a": self._message_setmode, "v": [mode, instrument_tokens]}))
    File "/home/ubuntu/my_folder/my_env/lib/python3.5/site-packages/autobahn/websocket/protocol.py", line 2266, in sendMessage
    self.sendFrame(opcode=opcode, payload=payload, sync=sync, rsv=4 if sendCompressed else 0)
    File "/home/ubuntu/my_folder/my_env/lib/python3.5/site-packages/autobahn/websocket/protocol.py", line 1880, in sendFrame
    self.sendData(raw, sync, chopsize)
    File "/home/ubuntu/my_folder/my_env/lib/python3.5/site-packages/autobahn/websocket/protocol.py", line 1336, in sendData
    self.transport.write(data)
    File "/home/ubuntu/my_folder/my_env/lib/python3.5/site-packages/twisted/protocols/tls.py", line 467, in write
    self._write(bytes)
    File "/home/ubuntu/my_folder/my_env/lib/python3.5/site-packages/twisted/protocols/tls.py", line 547, in _write
    self._flushSendBIO()
    File "/home/ubuntu/my_folder/my_env/lib/python3.5/site-packages/twisted/protocols/tls.py", line 252, in _flushSendBIO
    bytes = self._tlsConnection.bio_read(2 ** 15)
    AttributeError: 'NoneType' object has no attribute 'bio_read'

    During handling of the above exception, another exception occurred:
    =====================================================================

Sign In or Register to comment.