Its not a code or server issue. Its clearly a network issue where communication between your system and the server was disrupted. All broadband connnections will have these packet drops / network brownout issues from time to time and if you want to avoid these you would need to run your code on the cloud.
What do you mean by I am running the code on cloud? Which cloud is this? You wont have this issue on any of the major cloud service providers like GCP, Azure or AWS.
I'm running this on AWS and having this same error today,
INFO:root:Connection error: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time)) ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time)) DEBUG:kiteconnect.ticker:Start WebSocket connection. ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time)) INFO:root:Connection error: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time)) ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time)) DEBUG:kiteconnect.ticker:Start WebSocket connection.
I'm running this on AWS and having this same error today,
INFO:root:Connection error: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time)) ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time)) DEBUG:kiteconnect.ticker:Start WebSocket connection. ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time)) INFO:root:Connection error: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time)) ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time)) DEBUG:kiteconnect.ticker:Start WebSocket connection.
Its clearly a network issue where communication between your system and the server was disrupted. All broadband connnections will have these packet drops / network brownout issues from time to time and if you want to avoid these you would need to run your code on the cloud.
INFO:root:Connection error: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time))
ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time))
DEBUG:kiteconnect.ticker:Start WebSocket connection.
ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time))
INFO:root:Connection error: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time))
ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time))
DEBUG:kiteconnect.ticker:Start WebSocket connection.
INFO:root:Connection error: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time))
ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time))
DEBUG:kiteconnect.ticker:Start WebSocket connection.
ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time))
INFO:root:Connection error: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time))
ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (WebSocket opening handshake timeout (peer did not finish the opening handshake in time))
DEBUG:kiteconnect.ticker:Start WebSocket connection.
@sujith