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

docker-electrumx immediately drops incoming RPC connections from Electrum #50

Open
schildbach opened this issue Dec 19, 2019 · 8 comments

Comments

@schildbach
Copy link

schildbach commented Dec 19, 2019

I'm running Electrum 3.2.4 (also tried 3.3.8) on a fully up to date Ubuntu 18.04 using this command:

electrum/electrum gui -v --oneserver --server <myhost>:50002:s

I'm getting this output in the console, the connection is immediately dropped and my wallets are not updated:

[Network] connecting to <myhost>:50002:s as new interface
[myhost] connected
[Network] switching to <myhost>:50002:s
[Network] sending subscriptions to <myhost>:50002:s 26 0
[myhost] connection closed remotely
[profiler] Standard_Wallet.get_full_history 0.0007
[profiler] HistoryList.on_update 0.0011

In electrumx-docker, I only see

electrumx_1  | INFO:ElectrumX:[23] SSL <myip>:34316, 0 total

sometimes (but not always) followed by

electrumx_1  | INFO:ElectrumX:[5] changing task concurrency from 10 to 6
electrumx_1  | INFO:ElectrumX:[5] disconnected whilst throttled

I can

$ telnet <myhost> 50002
Trying <myip>...
Connected to <myhost>.
Escape character is '^]'.

or

$ openssl s_client -connect <myhost>:50002
CONNECTED(00000005)
depth=0 O = ElectrumX
verify error:num=18:self signed certificate
verify return:1
depth=0 O = ElectrumX
verify return:1
[...]

and is stays connected for a while.

Both bitcoind and electrumx are fully synched, earlier in the log I see

electrumx_1  | INFO:SessionManager:SSL server listening on electrumx:50002

My host is a fully up to date Ubuntu Server 18.04. This is my docker-electrumx config:

$ cat docker-compose.yaml 
version: "3"
services:
  bitcoind:
    image: nicolasdorier/docker-bitcoin:0.18.1
    volumes:
      - "<mybitcoinddata>:/data"
    ports:
      - "<myip>:8333:8333"
    environment:
      BITCOIN_EXTRA_ARGS: |
        txindex=1
        disablewallet=1
        rpcuser=electrumx
        rpcpassword=<mypassword>
        [main]
        rpcbind=bitcoind
  electrumx:
    image: lukechilds/electrumx:v1.13.0
    volumes:
      - "<myelectrumxdata>:/data"
    ports:
      - "<myip>:50002:50002"
    environment:
      - DAEMON_URL=http://electrumx:<mypassword>@bitcoind
      - COIN=BitcoinSegwit
      - SERVICES=ssl://electrumx:50002
      - LOG_LEVEL=debug

I tried the same with testnet; same results.

(<myip>, <myhost>, <mypassword>, <mybitcoinddata> and <myelectrumxdata> obviously have real values in the real config)

@schildbach schildbach changed the title docker-electrumx immediately drops incoming RPC connections docker-electrumx immediately drops incoming RPC connections from Electrum Dec 19, 2019
@schildbach
Copy link
Author

To exclude any SSL-related problem, I configured a (non-SSL) TCP connection between ElectrumX and Electrum – the problem persists.

To exclude any limiting issues, I tried adding

      - COST_SOFT_LIMIT=0
      - COST_HARD_LIMIT=0

but the problem persists.

@lukechilds
Copy link
Owner

Can you get a response from ElectrumX over telnet?

Once you get a connection try pasting:

{"id": 1, "method": "server.version", "params": []}

And see if you get a response.

e.g:

lukechilds@bitcoin:~$ telnet localhost 50001
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
{"id": 1, "method": "server.version", "params": []}
{"jsonrpc": "2.0", "result": ["ElectrumX 1.13.0", "1.4"], "id": 1}

@1n5aN1aC
Copy link

1n5aN1aC commented Aug 7, 2020

I have what appears to be the same symptoms. for me, this began happening after I switched my image from v1.12 to v1.15

Both Electrum V3.3.8 & 4.0.2 Tested.

Here is what I get spammed in my ElectrumX console:

INFO:ElectrumX:[26] SSL 10.0.0.116:54339, 0 total
INFO:ElectrumX:[27] SSL 10.0.0.116:54344, 0 total
INFO:ElectrumX:[28] SSL 10.0.0.116:54349, 0 total
INFO:ElectrumX:[29] SSL 10.0.0.116:54354, 0 total
INFO:ElectrumX:[30] SSL 10.0.0.116:54361, 0 total

@1n5aN1aC
Copy link

1n5aN1aC commented Aug 8, 2020

I connected over telnet to TCP, and do get a response, but it complains about formatting:

{"id": 1, "method": "server.version", "params": []}
Responds with:
{"jsonrpc": "2.0", "error": {"code": -32700, "message": "messages must be encoded in UTF-8"}, "id": null}

And just hitting enter returns: {"jsonrpc": "2.0", "error": {"code": -32700, "message": "invalid JSON"}, "id": null}

@mariobyn
Copy link

mariobyn commented Sep 2, 2020

Any updates on this issue?

@1n5aN1aC
Copy link

1n5aN1aC commented Sep 3, 2020

@mariobyn I tried many things, and had no success.

What did bring success was blowing away all data relating to the image, and having it re-process the entire blockchain.

@mariobyn
Copy link

mariobyn commented Sep 4, 2020

@1n5aN1aC i tried your thing and it still didn't work after a while it started again, I looked on the RPC client with more verbose logs and it seems it was an issue on my part due to resources so I set
COST_SOFT_LIMIT=0 COST_HARD_LIMIT=0

and it worked...

@1n5aN1aC
Copy link

I had this happen again, and the only solution I could find was to blow away all my electrum data and have it rebuild it all from scratch again. Very strange.

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

4 participants