spesmilo / spesmilo/electrumx

electrumx reports an error in the container

Open
#81 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
568
Forks
447
PR merge metrics
No merged PRs in 30d

Description

electrumx reports an error in the container,My error specific information below

INFO:electrumx:ElectrumX server starting
INFO:electrumx:logging level: INFO
INFO:Controller:Python version: 3.7.9 (default, Aug 18 2020, 04:11:54)  [GCC 9.3.0]
INFO:Controller:software version: ElectrumX 1.15.0
INFO:Controller:aiorpcX version: 0.18.4
INFO:Controller:supported protocol versions: 1.4-1.4.2
INFO:Controller:event loop policy: None
INFO:Controller:reorg limit is 200 blocks
INFO:Daemon:daemon #1 at 172.17.0.1:18332/ (current)
INFO:DB:switching current directory to /data
INFO:DB:using rocksdb for DB backend
INFO:DB:opened UTXO DB (for sync: True)
INFO:DB:UTXO DB version: 8
INFO:DB:coin: Bitcoin
INFO:DB:network: mainnet
INFO:DB:height: 656,477
INFO:DB:tip: 0000000000000000000457df9961a123212340daf566b899aaa54197d0648d1b
INFO:DB:tx count: 585,898,367
INFO:DB:flushing DB cache at 1,200 MB
INFO:History:history DB version: 1
INFO:History:flush count: 15,018
INFO:SessionManager:RPC server listening on 0.0.0.0:8000
INFO:Prefetcher:catching up to daemon height 656,684 (207 blocks behind)
INFO:BlockProcessor:chain reorg detected
INFO:BlockProcessor:chain was reorganised replacing 1 block at heights 656,477-656,477
INFO:BlockProcessor:read 1 blocks from disk
INFO:Prefetcher:cancelled; prefetcher stopping 
INFO:SessionManager:closing down server for rpc://0.0.0.0:8000
INFO:Controller:shutting down
INFO:Controller:shutdown complete
ERROR:electrumx:ElectrumX server terminated abnormally
Traceback (most recent call last):
  File "/electrumx/electrumx_server", line 35, in main
    asyncio.run(controller.run())
  File "/usr/local/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
    return future.result()
  File "/electrumx/electrumx/lib/server_base.py", line 129, in run
    await server_task
  File "/electrumx/electrumx/lib/server_base.py", line 102, in serve
    await self.serve(shutdown_event)
  File "/electrumx/electrumx/server/controller.py", line 134, in serve
    await group.spawn(wait_for_catchup())
  File "/usr/local/lib/python3.7/site-packages/aiorpcX-0.18.4-py3.7.egg/aiorpcx/curio.py", line 242, in __aexit__
    await self.join()
  File "/usr/local/lib/python3.7/site-packages/aiorpcX-0.18.4-py3.7.egg/aiorpcx/curio.py", line 211, in join
    raise task.exception()
  File "/electrumx/electrumx/server/block_processor.py", line 702, in fetch_and_process_blocks
    await group.spawn(self._process_prefetched_blocks())
  File "/usr/local/lib/python3.7/site-packages/aiorpcX-0.18.4-py3.7.egg/aiorpcx/curio.py", line 242, in __aexit__
    await self.join()
  File "/usr/local/lib/python3.7/site-packages/aiorpcX-0.18.4-py3.7.egg/aiorpcx/curio.py", line 211, in join
    raise task.exception()
  File "/electrumx/electrumx/server/block_processor.py", line 663, in _process_prefetched_blocks
    await self.check_and_advance_blocks(blocks)
  File "/electrumx/electrumx/server/block_processor.py", line 240, in check_and_advance_blocks
    await self.reorg_chain()
  File "/electrumx/electrumx/server/block_processor.py", line 282, in reorg_chain
    await self.run_in_thread_with_lock(self.backup_blocks, raw_blocks)
  File "/electrumx/electrumx/server/block_processor.py", line 212, in run_in_thread_with_lock
    return await asyncio.shield(run_in_thread_locked())
  File "/electrumx/electrumx/server/block_processor.py", line 211, in run_in_thread_locked
    return await run_in_thread(func, *args)
  File "/usr/local/lib/python3.7/site-packages/aiorpcX-0.18.4-py3.7.egg/aiorpcx/curio.py", line 68, in run_in_thread
    return await get_event_loop().run_in_executor(None, func, *args)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/electrumx/electrumx/server/block_processor.py", line 500, in backup_blocks
    self.backup_txs(block.transactions, is_unspendable)
  File "/electrumx/electrumx/server/block_processor.py", line 547, in backup_txs
    assert n == 0
AssertionError

Has anyone encountered this problem

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with electrumx/server/block_processor.py, especially backup_blocks(), backup_txs(), and the assertion at line 547 in the traceback. Review the reorg_chain() path and the reported container log to understand why the reorganization reaches this failure. Done means the reported reorg no longer terminates ElectrumX abnormally and the container remains running.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, databases
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.