Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

electrums crash on WSS connection #3

Closed
tonymorony opened this issue Dec 17, 2021 · 3 comments
Closed

electrums crash on WSS connection #3

tonymorony opened this issue Dec 17, 2021 · 3 comments
Labels
bug Something isn't working P0

Comments

@tonymorony
Copy link

that looks like a huge airdex blocker [ CC @cipig @ca333 @yurii-khi ]
From time to time our electrums crash on websocket connection

Dec 17 09:48:43 electrum3 electrumx_server[3796884]: websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason

the issue looks the same as:
kyuupichan/electrumx#966

@tonymorony tonymorony added bug Something isn't working P0 labels Dec 17, 2021
@cipig
Copy link
Member

cipig commented Jan 2, 2022

updated python websockets lib to websockets-10.1 and the issue seemed to be gone, but i just caught a new crash on KMD:

Jan 02 12:55:02 electrum3 electrumx_server[1446915]: ERROR:electrumx:ElectrumX server terminated abnormally
Jan 02 12:55:02 electrum3 electrumx_server[1446915]: Traceback (most recent call last):
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 944, in transfer_data
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     message = await self.read_message()
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 1013, in read_message
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     frame = await self.read_data_frame(max_size=self.max_size)
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 1089, in read_data_frame
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     frame = await self.read_frame(max_size)
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 1148, in read_frame
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     extensions=self.extensions,
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/framing.py", line 70, in read
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     data = await reader(2)
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/lib/python3.7/asyncio/streams.py", line 679, in readexactly
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     await self._wait_for_data('readexactly')
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/lib/python3.7/asyncio/streams.py", line 473, in _wait_for_data
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     await self._waiter
Jan 02 12:55:02 electrum3 electrumx_server[1446915]: concurrent.futures._base.CancelledError
Jan 02 12:55:02 electrum3 electrumx_server[1446915]: The above exception was the direct cause of the following exception:
Jan 02 12:55:02 electrum3 electrumx_server[1446915]: Traceback (most recent call last):
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/bin/electrumx_server", line 35, in main
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     asyncio.run(controller.run())
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     return loop.run_until_complete(main)
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "uvloop/loop.pyx", line 1501, in uvloop.loop.Loop.run_until_complete
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/electrumx/lib/server_base.py", line 129, in run
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     await server_task
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/electrumx/lib/server_base.py", line 102, in serve
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     await self.serve(shutdown_event)
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/electrumx/server/controller.py", line 134, in serve
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     await group.spawn(wait_for_catchup())
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/aiorpcx/curio.py", line 255, in __aexit__
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     await self.join()
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/aiorpcx/curio.py", line 213, in join
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     raise task.exception()
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/electrumx/server/session.py", line 641, in serve
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     await group.spawn(self._manage_servers())
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/aiorpcx/curio.py", line 255, in __aexit__
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     await self.join()
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/aiorpcx/curio.py", line 213, in join
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     raise task.exception()
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/electrumx/server/session.py", line 1016, in notify
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     await self.send_notification('blockchain.headers.subscribe', args)
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/aiorpcx/session.py", line 542, in send_notification
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     await self._send_message(message)
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/aiorpcx/session.py", line 153, in _send_message
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     await self.transport.write(message)
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/aiorpcx/websocket.py", line 85, in write
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     await self.websocket.send(framed_message)
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 619, in send
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     await self.ensure_open()
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:   File "/usr/local/lib/python3.7/dist-packages/websockets/legacy/protocol.py", line 929, in ensure_open
Jan 02 12:55:02 electrum3 electrumx_server[1446915]:     raise self.connection_closed_exc()
Jan 02 12:55:02 electrum3 electrumx_server[1446915]: websockets.exceptions.ConnectionClosedError: sent 1011 (unexpected error) keepalive ping timeout; no close frame received

@cipig
Copy link
Member

cipig commented Jan 15, 2022

i see the config is wrong, this is KMD

    "electrum": [
      {
        "url": "electrum3.cipig.net:10001",
        "ws_url": "electrum3.cipig.net:30001"
      },
      {
        "url": "electrum2.cipig.net:10001",
        "ws_url": "electrum3.cipig.net:30001"
      },
      {
        "url": "electrum1.cipig.net:10001",
        "ws_url": "electrum3.cipig.net:30001"
      }
    ],

in https://github.com/KomodoPlatform/atomicDEX-Desktop/blob/dev/assets/config/0.5.4-coins.json#L4702
so it has electrum3 setup 3x for wss... maybe part of the problem
KomodoPlatform/komodo-wallet#1557

@cipig
Copy link
Member

cipig commented Jun 22, 2022

this issue is fixed

@cipig cipig closed this as completed Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0
Projects
None yet
Development

No branches or pull requests

2 participants