connect() failure

vijoeyz
@rakeshr

Since last two days, ws.connect() has been failing. I found the error to be:
failing WebSocket connection (code=1000): "module 'log' has no attribute 'connect'"
I found ws.socket_url (below) value to be correct. Here is the log. Max retries are tried out, and every retry fails with above error.
2023-02-22 16:26:15.257588: socket_url: wss://ws.kite.trade?api_key=6063OVERWRITTENa1xp9&access_token=PArKJVdWcSOVERWRITTENXOpDZ8CI

2023-02-22 16:26:15+0530 [-] Log opened.
2023-02-22 16:26:15+0530 [-] failing WebSocket connection (code=1000): "module 'log' has no attribute 'connect'"
2023-02-22 16:26:15+0530 [-] dropping connection to peer tcp4:3.6.127.72:443 with abort=True: I dropped the WebSocket TCP connection: module 'log' has no attribute 'connect'
2023-02-22 16:26:15+0530 [-] <twisted.internet.tcp.Connector instance at 0x2821114df30 disconnected IPv4Address(type='TCP', host='ws.kite.trade', port=443)> will retry in 2 seconds
2023-02-22 16:26:15+0530 [-] Stopping factory <kiteconnect.ticker.KiteTickerClientFactory object at 0x000002821114E6B0>
2023-02-22 16:26:18+0530 [-] Starting factory <kiteconnect.ticker.KiteTickerClientFactory object at 0x000002821114E6B0>
2023-02-22 16:26:18+0530 [-] failing WebSocket connection (code=1000): "module 'log' has no attribute 'connect'"
2023-02-22 16:26:18+0530 [-] dropping connection to peer tcp4:3.6.127.72:443 with abort=True: I dropped the WebSocket TCP connection: module 'log' has no attribute 'connect'
2023-02-22 16:26:18+0530 [-] <twisted.internet.tcp.Connector instance at 0x2821114df30 disconnected IPv4Address(type='TCP', host='ws.kite.trade', port=443)> will retry in 5 seconds
2023-02-22 16:26:18+0530 [-] Stopping factory <kiteconnect.ticker.KiteTickerClientFactory object at 0x000002821114E6B0>
I am using Kiteconnect version 4.2.0. What could be the issue?
  • rakeshr
    failing WebSocket connection (code=1000): "module 'log' has no attribute 'connect'"
    Doesn't seems related to websocket connection, but some logging module. Are you using a different "log" module or package?
    Can you add below logging level and paste the response from same here:
    import logging
    logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
  • vijoeyz
    A local bug within on_connect() was causing connection failure. Since I didn't catch exception in on_connect(), I spent lot of time debugging.
Sign In or Register to comment.