Author

Topic: Interface disconnecting due to RPCError (Read 115 times)

copper member
Activity: 2338
Merit: 4543
Join the world-leading crypto sportsbook NOW!
May 26, 2022, 09:56:08 AM
#4
It's been a while since I've messed around with my node setup, but there's something I forgot:

This:

Code:
rpcuser=worldcoin
rpcpassword=worldcoin

Doesn't belong in the worldcoin.conf file, it belongs in electrumx.conf.

Here's the documentation for rpcauth.py from the bitcoin core master:

usage: rpcauth.py [-h] username [password]

Create login credentials for a JSON-RPC user

positional arguments:
  username    the username for authentication
  password    leave empty to generate a random password or specify "-" to
              prompt for password

optional arguments:
  -h, --help  show this help message and exit

So, you'll need to use rpcauth.py to generate the authorization code that needs to be in the coin daemon's configuration file.  For example:



As in the example above, if you use "worldcoin" as the rpc username and password (I suggest a stronger password, or let rpcauth.py generate one for you) you'll need the following code in your worldcoin.conf file:

Code:
rpcauth=worldcoin:1667bd1179bbdd121aec27fc98bb66e9$77cb74246ed721086f2b80cf32d76ffc63036dea38ae87794de662bc44155b83
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Remove the "/0" from the end of rpcallowip and add a whitebind directive for a whitelisted port and address you want ElectrumX to connect to, like this:

Code:
#bitcoin.conf # or whatever coin's .conf file you are using
whitebind=127.0.0.1:8332

This will allow RPC connections that connect to this IP and port without giving an "Authentication error". Note that this will only work if the RPC error you are getting is an authentication error. If it is not, then describe the error you are getting clearly.
copper member
Activity: 2338
Merit: 4543
Join the world-leading crypto sportsbook NOW!
Sorry, I have no experience with the coin in question, but this looks funny to me.

worldcoin.conf:
Code:
listen=1
server=1
txindex=1
rpcuser=worldcoin
rpcpassword=worldcoin
rpcallowip=0.0.0.0/0
rpcbind=0.0.0.0

addnode=....

Try removing rpcallowip, or comment it out by starting the line with a hashtag (#) like this:
Code:
#rpcallowip=0.0.0.0/0

And for rpcbind try pointing that to localhost or 127.0.0.1, like this:
Code:
rpcbind=127.0.0.1

or
Code:
rpcbind=localhost
newbie
Activity: 17
Merit: 2
I have installed global electrumx server, its up and running. Getting blocks from coin daemon. Configuration files are below. Somehow local electrum wallet does not connect to the server and i could not find anyone who reproduce the same error. I couldn't determine if the problem is with the local wallet or the server.

Need advise please.

Wallet: https://github.com/koraycoding/electrum-wdc

electrumx.conf:
Code:
COIN = Worldcoin
DB_DIRECTORY = /home/koray/electrumx_db
DAEMON_URL = worldcoin:worldcoin@ubuntu:11082
SERVICES = tcp://:50001,ssl://electrum.mydomain.biz:50002,rpc://142.132.237.8:11082
EVENT_LOOP_POLICY = uvloop
MAX_SESSIONS = 500
INITIAL_CONCURRENT = 50
COST_SOFT_LIMIT = 0
COST_HARD_LIMIT = 0
DONATION_ADDRESS = WU9eqGsiheuTG59mUhcksifzWzexRaDBPs
SSL_CERTFILE = /home/koray/electrumx/ssl/public.crt
SSL_KEYFILE = /home/koray/electrumx/ssl/private.key

electrumx.service:
Code:
[Unit]
Description=Electrumx
After=network.target

[Service]
EnvironmentFile=/etc/electrumx.conf
ExecStart=/home/koray/electrumx/electrumx_server
User=koray
LimitNOFILE=8192
TimeoutStopSec=30min

[Install]
WantedBy=multi-user.target

worldcoin.conf:
Code:
listen=1
server=1
txindex=1
rpcuser=worldcoin
rpcpassword=worldcoin
rpcallowip=0.0.0.0/0
rpcbind=0.0.0.0

addnode=....

electrum wallet log:
Code:
20220523T143545.238410Z |     INFO | simple_config.SimpleConfig | electrum directory /home/koray/.electrum-wdc
20220523T143545.240120Z |     INFO | logging | Electrum-WDC version: 4.2.1 - https://worldcoin.org - https://github.com/koraycoding/electrum-wdc
20220523T143545.241905Z |     INFO | logging | Python version: 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0]. On platform: Linux-5.15.41-1-lts-x86_64-with-glibc2.35
20220523T143545.242034Z |     INFO | logging | Logging to file: /home/koray/.electrum-wdc/logs/electrum_wdc_log_20220523T143545Z_16904.log
20220523T143545.242120Z |     INFO | logging | Log filters: verbosity '', verbosity_shortcuts ''
20220523T143545.243017Z |     INFO | plugin.Plugins | registering hardware bitbox02: ('hardware', 'bitbox02', 'BitBox02')
20220523T143545.243319Z |     INFO | plugin.Plugins | registering hardware coldcard: ('hardware', 'coldcard', 'Coldcard Wallet')
20220523T143545.243806Z |     INFO | plugin.Plugins | registering hardware digitalbitbox: ('hardware', 'digitalbitbox', 'Digital Bitbox wallet')
20220523T143545.245657Z |     INFO | plugin.Plugins | registering hardware keepkey: ('hardware', 'keepkey', 'KeepKey wallet')
20220523T143545.246116Z |     INFO | plugin.Plugins | registering hardware ledger: ('hardware', 'ledger', 'Ledger wallet')
20220523T143545.246585Z |     INFO | plugin.Plugins | registering hardware safe_t: ('hardware', 'safe_t', 'Safe-T mini wallet')
20220523T143545.246857Z |     INFO | plugin.Plugins | registering hardware trezor: ('hardware', 'trezor', 'Trezor wallet')
20220523T143545.247125Z |     INFO | plugin.Plugins | registering wallet type ('2fa', 'trustedcoin')
20220523T143545.247644Z |    DEBUG | util.profiler | Plugins.__init__ 0.0053
20220523T143545.247936Z |     INFO | network | blockchains [0]
20220523T143545.248268Z |     INFO | exchange_rate.FxThread | using exchange CoinGecko
20220523T143545.248760Z |    DEBUG | util.profiler | Daemon.__init__ 0.0010
20220523T143545.248873Z |     INFO | daemon.Daemon | launching GUI: qt
20220523T143545.249441Z |     INFO | network | starting network
20220523T143545.249749Z |     INFO | network | setting proxy None
20220523T143545.250180Z |     INFO | daemon.Daemon | starting taskgroup.
20220523T143545.250692Z |     INFO | network | connecting to electrum.mydomain.biz:50002:s as new interface
20220523T143545.252178Z |     INFO | network | starting taskgroup (0x7fd672b33040).
20220523T143545.252634Z |     INFO | daemon.CommandsServer | now running and listening. socktype=unix, addr=/home/koray/.electrum-wdc/daemon_rpc_socket
20220523T143545.253437Z |     INFO | exchange_rate.CoinGecko | getting fx quotes for USD
20220523T143545.308519Z |     INFO | gui.qt.history_list | could not import electrum_wdc.plot. This feature needs matplotlib to be installed.
20220523T143545.410602Z |     INFO | gui.qt.ElectrumGui | Qt GUI starting up... Qt=5.15.2, PyQt=5.15.6
20220523T143545.547121Z |    DEBUG | util.profiler | ElectrumGui.__init__ 0.1379
20220523T143545.547777Z |     INFO | storage.WalletStorage | wallet path /home/koray/.electrum-wdc/wallets/default
20220523T143545.548543Z |    DEBUG | util.profiler | WalletDB._load_transactions 0.0003
20220523T143545.549297Z |    DEBUG | util.profiler | AddressSynchronizer.load_local_history 0.0000
20220523T143545.549506Z |    DEBUG | util.profiler | AddressSynchronizer.check_history 0.0001
20220523T143545.597410Z |    DEBUG | util.profiler | AddressList.update 0.0000
20220523T143545.640200Z |    DEBUG | util.profiler | Deterministic_Wallet.try_detecting_internal_addresses_corruption 0.0103
20220523T143545.640381Z |    DEBUG | util.profiler | ElectrumWindow.load_wallet 0.0253
20220523T143545.641499Z |     INFO | gui.qt.ElectrumGui | starting Qt main loop
20220523T143546.023607Z |     INFO | gui.qt.history_list.HistoryModel | refreshing... reason: update_tabs
20220523T143546.024335Z |    DEBUG | util.profiler | Abstract_Wallet.get_full_history 0.0003
20220523T143546.024462Z |    DEBUG | util.profiler | HistoryModel.refresh 0.0009
20220523T143546.025486Z |    DEBUG | util.profiler | AddressList.update 0.0000
20220523T143550.684533Z |     INFO | interface.[electrum.mydomain.biz:50002] | succeeded in getting cert
20220523T143550.694637Z |     INFO | exchange_rate.CoinGecko | received fx quotes
20220523T143550.901152Z |     INFO | interface.[electrum.mydomain.biz:50002] | connection established. version: ['ElectrumX 1.16.0', '1.4']
20220523T143550.959309Z |     INFO | interface.[electrum.mydomain.biz:50002] | set blockchain with height -1
20220523T143550.959945Z |     INFO | interface.[electrum.mydomain.biz:50002] | can't connect 7240991
20220523T143550.960421Z |     INFO | interface.[electrum.mydomain.biz:50002] | requesting block header 0 in mode backward
20220523T143550.961407Z |     INFO | network | switching to electrum.mydomain.biz:50002:s
20220523T143551.005078Z |     INFO | network | fee_estimates {}
20220523T143551.020379Z |     INFO | interface.[electrum.mydomain.biz:50002] | requesting block header -7240991 in mode backward
20220523T143551.036040Z |     INFO | network | fee_histogram []
20220523T143551.103499Z |  WARNING | interface.[electrum.mydomain.biz:50002] | disconnecting due to RPCError(1, '-7240991 should be a non-negative integer')
20220523T143551.104255Z |    DEBUG | interface.[electrum.mydomain.biz:50002] | (disconnect) trace for RPCError(1, '-7240991 should be a non-negative integer')
Traceback (most recent call last):
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 498, in wrapper_func
    return await func(self, *args, **kwargs)
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 521, in run
    await self.open_session(ssl_context)
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 667, in open_session
    async with self.taskgroup as group:
  File "/home/koray/.local/lib/python3.10/site-packages/aiorpcx/curio.py", line 297, in __aexit__
    await self.join()
  File "/home/koray/electrum-wdc/electrum_wdc/util.py", line 1207, in join
    task.result()
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 737, in run_fetch_blocks
    await self._process_header_at_tip()
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 751, in _process_header_at_tip
    _, height = await self.step(height, header)
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 795, in step
    height, header, bad, bad_header = await self._search_headers_backwards(height, header)
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 881, in _search_headers_backwards
    while await iterate():
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 866, in iterate
    header = await self.get_block_header(height, 'backward')
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 604, in get_block_header
    res = await self.session.send_request('blockchain.block.header', [height], timeout=timeout)
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 171, in send_request
    response = await asyncio.wait_for(
  File "/usr/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
    return fut.result()
  File "/home/koray/.local/lib/python3.10/site-packages/aiorpcx/session.py", line 540, in send_request
    return await self._send_concurrent(message, future, 1)
  File "/home/koray/.local/lib/python3.10/site-packages/aiorpcx/session.py", line 512, in _send_concurrent
    return await future
aiorpcx.jsonrpc.RPCError: (1, '-7240991 should be a non-negative integer')
20220523T143552.048955Z |     INFO | network | connecting to electrum.mydomain.biz:50002:s as new interface
20220523T143552.277450Z |     INFO | interface.[electrum.mydomain.biz:50002] | connection established. version: ['ElectrumX 1.16.0', '1.4']
20220523T143552.333548Z |     INFO | interface.[electrum.mydomain.biz:50002] | set blockchain with height -1
20220523T143552.334190Z |     INFO | interface.[electrum.mydomain.biz:50002] | can't connect 7240991
20220523T143552.334687Z |     INFO | interface.[electrum.mydomain.biz:50002] | requesting block header 0 in mode backward
20220523T143552.335706Z |     INFO | network | switching to electrum.mydomain.biz:50002:s
20220523T143552.393364Z |     INFO | interface.[electrum.mydomain.biz:50002] | requesting block header -7240991 in mode backward
20220523T143552.396873Z |     INFO | network | fee_histogram []
20220523T143552.515824Z |  WARNING | interface.[electrum.mydomain.biz:50002] | disconnecting due to RPCError(1, '-7240991 should be a non-negative integer')
20220523T143552.516450Z |    DEBUG | interface.[electrum.mydomain.biz:50002] | (disconnect) trace for RPCError(1, '-7240991 should be a non-negative integer')
Traceback (most recent call last):
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 498, in wrapper_func
    return await func(self, *args, **kwargs)
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 521, in run
    await self.open_session(ssl_context)
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 667, in open_session
    async with self.taskgroup as group:
  File "/home/koray/.local/lib/python3.10/site-packages/aiorpcx/curio.py", line 297, in __aexit__
    await self.join()
  File "/home/koray/electrum-wdc/electrum_wdc/util.py", line 1207, in join
    task.result()
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 737, in run_fetch_blocks
    await self._process_header_at_tip()
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 751, in _process_header_at_tip
    _, height = await self.step(height, header)
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 795, in step
    height, header, bad, bad_header = await self._search_headers_backwards(height, header)
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 881, in _search_headers_backwards
    while await iterate():
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 866, in iterate
    header = await self.get_block_header(height, 'backward')
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 604, in get_block_header
    res = await self.session.send_request('blockchain.block.header', [height], timeout=timeout)
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 171, in send_request
    response = await asyncio.wait_for(
  File "/usr/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
    return fut.result()
  File "/home/koray/.local/lib/python3.10/site-packages/aiorpcx/session.py", line 540, in send_request
    return await self._send_concurrent(message, future, 1)
  File "/home/koray/.local/lib/python3.10/site-packages/aiorpcx/session.py", line 512, in _send_concurrent
    return await future
aiorpcx.jsonrpc.RPCError: (1, '-7240991 should be a non-negative integer')
20220523T143553.390308Z |     INFO | network | connecting to electrum.mydomain.biz:50002:s as new interface
20220523T143553.616538Z |     INFO | interface.[electrum.mydomain.biz:50002] | connection established. version: ['ElectrumX 1.16.0', '1.4']
20220523T143553.672049Z |     INFO | interface.[electrum.mydomain.biz:50002] | set blockchain with height -1
20220523T143553.672866Z |     INFO | interface.[electrum.mydomain.biz:50002] | can't connect 7240991
20220523T143553.673495Z |     INFO | interface.[electrum.mydomain.biz:50002] | requesting block header 0 in mode backward
20220523T143553.674737Z |     INFO | network | switching to electrum.mydomain.biz:50002:s
20220523T143553.731810Z |     INFO | interface.[electrum.mydomain.biz:50002] | requesting block header -7240991 in mode backward
20220523T143553.734345Z |     INFO | network | fee_histogram []
20220523T143553.851536Z |  WARNING | interface.[electrum.mydomain.biz:50002] | disconnecting due to RPCError(1, '-7240991 should be a non-negative integer')
20220523T143553.852210Z |    DEBUG | interface.[electrum.mydomain.biz:50002] | (disconnect) trace for RPCError(1, '-7240991 should be a non-negative integer')
Traceback (most recent call last):
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 498, in wrapper_func
    return await func(self, *args, **kwargs)
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 521, in run
    await self.open_session(ssl_context)
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 667, in open_session
    async with self.taskgroup as group:
  File "/home/koray/.local/lib/python3.10/site-packages/aiorpcx/curio.py", line 297, in __aexit__
    await self.join()
  File "/home/koray/electrum-wdc/electrum_wdc/util.py", line 1207, in join
    task.result()
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 737, in run_fetch_blocks
    await self._process_header_at_tip()
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 751, in _process_header_at_tip
    _, height = await self.step(height, header)
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 795, in step
    height, header, bad, bad_header = await self._search_headers_backwards(height, header)
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 881, in _search_headers_backwards
    while await iterate():
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 866, in iterate
    header = await self.get_block_header(height, 'backward')
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 604, in get_block_header
    res = await self.session.send_request('blockchain.block.header', [height], timeout=timeout)
  File "/home/koray/electrum-wdc/electrum_wdc/interface.py", line 171, in send_request
    response = await asyncio.wait_for(
  File "/usr/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
    return fut.result()
  File "/home/koray/.local/lib/python3.10/site-packages/aiorpcx/session.py", line 540, in send_request
    return await self._send_concurrent(message, future, 1)
  File "/home/koray/.local/lib/python3.10/site-packages/aiorpcx/session.py", line 512, in _send_concurrent
    return await future
aiorpcx.jsonrpc.RPCError: (1, '-7240991 should be a non-negative integer')
20220523T143554.587536Z |     INFO | gui.qt.main_window.[default] | close_wallet /home/koray/.electrum-wdc/wallets/default
20220523T143554.597515Z |     INFO | storage.WalletStorage | saved /home/koray/.electrum-wdc/wallets/default
20220523T143554.597919Z |    DEBUG | util.profiler | WalletDB._write 0.0072
20220523T143554.602734Z |     INFO | daemon.Daemon | stop() entered. initiating shutdown
20220523T143554.603018Z |     INFO | gui.qt.ElectrumGui | closing GUI
20220523T143554.603249Z |     INFO | daemon.Daemon | stopping all wallets
20220523T143554.603499Z |     INFO | daemon.Daemon | stopping network and taskgroup
20220523T143554.603909Z |     INFO | network | stopping network
20220523T143554.604650Z |     INFO | daemon.Daemon | taskgroup stopped.
20220523T143554.604964Z |     INFO | network | taskgroup stopped (0x7fd672b33040).
20220523T143554.605538Z |     INFO | daemon.Daemon | removing lockfile
20220523T143554.605880Z |     INFO | daemon.Daemon | stopped
20220523T143554.707466Z |     INFO | plugin.Plugins | stopped
Jump to: