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

excessive connection retries on bad electrums #1161

Closed
cipig opened this issue Dec 7, 2021 · 3 comments
Closed

excessive connection retries on bad electrums #1161

cipig opened this issue Dec 7, 2021 · 3 comments
Assignees

Comments

@cipig
Copy link
Member

cipig commented Dec 7, 2021

i stumbled upon one electrum server which shows this when i pass a manual request:

(echo '{ "id": 1, "method": "server.version", "params": ["barterDEX", ["1.4", "2.0"]] }'; sleep 0.5) | ncat --ssl zeta-seed-c.zetacoin.tech 50012

HTTP/1.1 400 Bad Request
Date: Tue, 07 Dec 2021 09:10:09 GMT
Server: Python/3.7 websockets/10.1
Content-Length: 77
Content-Type: text/plain
Connection: close

Failed to open a WebSocket connection: did not receive a valid HTTP request.

problem is that mm2 tries like crazy to reconnect to it, this i a sequence:

07 09:06:55, coins:rpc_clients:1864] INFO Electrum client connected to zeta-seed-c.zetacoin.tech:50012
07 09:06:55, coins:rpc_clients:1726] ERROR expected value at line 1 column 1
07 09:06:55, coins:rpc_clients:1726] ERROR expected value at line 1 column 1
07 09:06:55, coins:rpc_clients:1726] ERROR expected value at line 1 column 1
07 09:06:55, coins:rpc_clients:1726] ERROR expected value at line 1 column 1
07 09:06:55, coins:rpc_clients:1726] ERROR expected value at line 1 column 1
07 09:06:55, coins:rpc_clients:1726] ERROR expected value at line 1 column 1
07 09:06:55, coins:rpc_clients:1726] ERROR EOF while parsing a value at line 1 column 1
07 09:06:55, coins:rpc_clients:1726] ERROR expected value at line 1 column 1
07 09:06:55, coins:rpc_clients:1888] INFO EOF from zeta-seed-c.zetacoin.tech:50012
07 09:06:55, coins:rpc_clients:1930] INFO zeta-seed-c.zetacoin.tech:50012 connection dropped

this happens without pause several times in a second
to fix, coin needs to be disabled, bad electrum server removed and re enabled

question is: can mm2 make a pause of at least 1s before retrying in such cases? :-)

@artemii235
Copy link
Member

@cipig Thanks for opening the issue! I plan to work on Electrum client improvements this week. I will check this report too.

@artemii235 artemii235 self-assigned this Dec 7, 2021
@cipig
Copy link
Member Author

cipig commented Dec 8, 2021

It turned out i was told the wrong port... port 50012 was the WSS port of this electrum, so i connected with SSL to the WSS port, which led to the above error... but maybe still worth adding some additional check in mm2, to prevent it from dying when you accidentally connect to wrong port or person running the electrum server accidentally changes something... wouldn't be good if i can kill all mm2's by pointing SSL port to WSS port :-)

@artemii235
Copy link
Member

Fixed in the linked PR. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants