So dropping connection to reconnect , Connection error: 1006 - connection was closed uncleanly

smitparikh98
DEBUG:kiteconnect.ticker:last ping was 20.001878261566162 seconds back.
DEBUG:kiteconnect.ticker:Last pong was 20.71118474006653 seconds ago. So dropping connection to reconnect.
DEBUG:kiteconnect.ticker:Last pong was 21.25336456298828 seconds ago. So dropping connection to reconnect.
DEBUG:kiteconnect.ticker:ping =>
DEBUG:kiteconnect.ticker:last ping was 20.070510864257812 seconds back.
DEBUG:kiteconnect.ticker:ping =>
DEBUG:kiteconnect.ticker:last ping was 20.06448531150818 seconds back.
DEBUG:kiteconnect.ticker:ping =>
DEBUG:kiteconnect.ticker:last ping was 20.03793478012085 seconds back.
DEBUG:kiteconnect.ticker:ping =>
DEBUG:kiteconnect.ticker:last ping was 20.03090500831604 seconds back.
ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (None)


getting these details in log.
It comes all of a sudden or else ping is good
DEBUG:kiteconnect.ticker:last pong was 2.9608266353607178 seconds back.
DEBUG:kiteconnect.ticker:pong => b''
DEBUG:kiteconnect.ticker:last pong was 3.0520267486572266 seconds back.
DEBUG:kiteconnect.ticker:pong => b''
DEBUG:kiteconnect.ticker:last pong was 3.026381731033325 seconds back.
DEBUG:kiteconnect.ticker:pong => b''
DEBUG:kiteconnect.ticker:last pong was 3.0187182426452637 seconds back.
DEBUG:kiteconnect.ticker:pong => b''
DEBUG:kiteconnect.ticker:last pong was 2.9667623043060303 seconds back.
DEBUG:kiteconnect.ticker:pong => b''
DEBUG:kiteconnect.ticker:last pong was 2.9747424125671387 seconds back.
DEBUG:kiteconnect.ticker:pong => b''
DEBUG:kiteconnect.ticker:ping =>
DEBUG:kiteconnect.ticker:last ping was 2.9047999382019043 seconds back.
DEBUG:kiteconnect.ticker:ping =>
DEBUG:kiteconnect.ticker:last ping was 3.122086524963379 seconds back.
DEBUG:kiteconnect.ticker:ping =>
DEBUG:kiteconnect.ticker:last ping was 3.125037670135498 seconds back.
DEBUG:kiteconnect.ticker:ping =>
DEBUG:kiteconnect.ticker:last ping was 2.6753439903259277 seconds back.
DEBUG:kiteconnect.ticker:ping =>
DEBUG:kiteconnect.ticker:last ping was 2.6663095951080322 seconds back.
DEBUG:kiteconnect.ticker:ping =>
DEBUG:kiteconnect.ticker:last ping was 2.662339925765991 seconds back.


Is this a code error or should I consider it as a server network issue and move to AWS ?
Tagged:
  • smitparikh98
    smitparikh98 edited September 2023
    twisted.internet.tcp.Connector instance at 0x16732df56d0 disconnected IPv4Address(type='TCP', host='ws.kite.trade', port=443) will retry in 2 seconds
  • MAG
    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.
  • smitparikh98
    smitparikh98 edited September 2023
    running the code on cloud only and still I'm having this issue than should I move to AWS ?
  • MAG
    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.
  • smitparikh98
    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.
  • smitparikh98
    smitparikh98 edited October 2023
    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.

    @sujith
  • sujith
    You may refer to the websockets FAQs of pykiteconnect.
Sign In or Register to comment.