spesmilo / electrum

Electrum Bitcoin Wallet
https://electrum.org
MIT License
7.35k stars 3.06k forks source link

Cannot connect to own node through TOR (since v4.1.0) #7256

Closed polaris1205 closed 2 years ago

polaris1205 commented 3 years ago

I am on Windows 7 (very old laptop), and I use Tor to connect to my own node remotely.

However, in versions 4.1.0 and 4.1.2, it doesn't connect, it is simply stuck on "not connected (proxy enabled)"

I couldn't find any information as to why. My settings remain the same, and it works fine in version 4.0.5, which I can corroborate because it works once I downgrade.

Any help would be appreciated, as I would like to upgrade to the latest version fo Electrum.

Attached are my redacted logs.

electrum_log_20210430T050623Z_954028.log

SomberNight commented 3 years ago
Extracted log 1 ``` 20210430T050623.540238Z | ERROR | exchange_rate.CoinDesk | failed fx quotes: ProxyConnectionError(10022, 'Can not connect to proxy localhost:9050 [An invalid argument was supplied]') Traceback (most recent call last): File "python_socks\async_\asyncio\ext\_proxy.py", line 59, in _connect File "python_socks\async_\asyncio\ext\_stream.py", line 61, in open_connection File "asyncio\streams.py", line 52, in open_connection File "asyncio\base_events.py", line 1025, in create_connection File "asyncio\base_events.py", line 1010, in create_connection File "asyncio\base_events.py", line 924, in _connect_sock File "asyncio\proactor_events.py", line 702, in sock_connect File "asyncio\windows_events.py", line 596, in connect OSError: [WinError 10022] An invalid argument was supplied The above exception was the direct cause of the following exception: Traceback (most recent call last): File "electrum\exchange_rate.py", line 81, in update_safe File "electrum\exchange_rate.py", line 285, in get_rates File "electrum\exchange_rate.py", line 65, in get_json File "aiohttp\client.py", line 1117, in __aenter__ File "aiohttp\client.py", line 520, in _request File "aiohttp\connector.py", line 535, in connect File "aiohttp\connector.py", line 892, in _create_connection File "aiohttp\connector.py", line 1020, in _create_direct_connection File "aiohttp_socks\connector.py", line 58, in _wrap_create_connection File "python_socks\async_\asyncio\ext\_proxy.py", line 47, in connect File "python_socks\async_\asyncio\ext\_proxy.py", line 73, in _connect python_socks._errors.ProxyConnectionError: [Errno 10022] Can not connect to proxy localhost:9050 [An invalid argument was supplied] ```
Extracted log 2 ``` 20210430T050720.742510Z | INFO | network | connecting to myaddress.onion:50002:s as new interface 20210430T050720.797513Z | INFO | interface.[myaddress.onion:50002] | disconnecting due to: ConnectError(OSError(10022, 'An invalid argument was supplied', None, 10022, None)) ```

However, in versions 4.1.0 and 4.1.2, it doesn't connect, it is simply stuck on "not connected (proxy enabled)" it works fine in version 4.0.5

Could you please test 4.0.9, to narrow down where it got broken?

polaris1205 commented 3 years ago

Just tried 4.0.9, and it works fine! Can confirm that it broke with 4.1.0.

SkanderHelali commented 2 years ago

Similar (?) issue with 4.2.1. You can not connect to an electrum server on localhost if tor is configured as a proxy.

Shouldn't 127.0.0.1 / localhost be ignored if a proxy is configured?

network | connecting to 127.0.0.1:50011:t as new interface

INFO | interface.[127.0.0.1:50011] | disconnecting due to: SOCKSFailure('general SOCKS server failure')

Edit: Better issue would be #3126 I guess.