Error: no RPC connection" when trying to run Bitcoin Core functional tests #28000

issue naftalimurgor openend this issue on June 29, 2023
  1. naftalimurgor commented at 11:58 am on June 29, 2023: none

    Motivation

    I’m getting a strange error running tests under /src/test/functional/ with the following error:

     0Temporary test directory at /tmp/test_runner_₿_🏃_20220504_123152
     1Running Unit Tests for Test Framework Modules
     2..........
     3----------------------------------------------------------------------
     4Ran 10 tests in 0.614s
     5
     6OK
     7Traceback (most recent call last):
     8  File "/usr/src/bitcoin/test/functional/create_cache.py", line 27, in <module>
     9    CreateCache().main()
    10  File "/usr/src/bitcoin/test/functional/test_framework/test_framework.py", line 156, in main
    11    exit_code = self.shutdown()
    12  File "/usr/src/bitcoin/test/functional/test_framework/test_framework.py", line 311, in shutdown
    13    self.stop_nodes()
    14  File "/usr/src/bitcoin/test/functional/test_framework/test_framework.py", line 567, in stop_nodes
    15    node.stop_node(wait=wait, wait_until_stopped=False)
    16  File "/usr/src/bitcoin/test/functional/test_framework/test_node.py", line 336, in stop_node
    17    self.stop(wait=wait)
    18  File "/usr/src/bitcoin/test/functional/test_framework/test_node.py", line 184, in __getattr__
    19    assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
    20AssertionError: [node 0] Error: no RPC connection
    212022-05-04T19:31:53.315000Z TestFramework (INFO): Initializing test directory /tmp/test_runner_₿_🏃_20220504_123152/cache
    222022-05-04T19:31:56.079000Z TestFramework (ERROR): Unexpected exception caught during testing
    23Traceback (most recent call last):
    24  File "/usr/src/bitcoin/test/functional/test_framework/test_framework.py", line 132, in main
    25    self.setup()
    26  File "/usr/src/bitcoin/test/functional/test_framework/test_framework.py", line 294, in setup
    27    self.setup_chain()
    28  File "/usr/src/bitcoin/test/functional/test_framework/test_framework.py", line 385, in setup_chain
    29    self._initialize_chain()
    30  File "/usr/src/bitcoin/test/functional/test_framework/test_framework.py", line 777, in _initialize_chain
    31    self.start_node(CACHE_NODE_ID)
    32  File "/usr/src/bitcoin/test/functional/test_framework/test_framework.py", line 534, in start_node
    33    node.wait_for_rpc_connection()
    34  File "/usr/src/bitcoin/test/functional/test_framework/test_node.py", line 225, in wait_for_rpc_connection
    35    raise FailedToStartError(self._node_msg(
    36test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 3 during initialization
    372022-05-04T19:31:56.133000Z TestFramework (INFO): Stopping nodes
    38[node 0] Cleaning up leftover process
    39Traceback (most recent call last):
    40  File "test/functional/test_runner.py", line 832, in <module>
    41    main()
    42  File "test/functional/test_runner.py", line 471, in main
    43    run_tests(
    44  File "test/functional/test_runner.py", line 525, in run_tests
    45    subprocess.check_output([sys.executable, tests_dir + 'create_cache.py'] + flags + ["--tmpdir=%s/cache" % tmpdir])
    46  File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
    47    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    48  File "/usr/lib/python3.8/subprocess.py", line 516, in run
    49    raise CalledProcessError(retcode, process.args,
    50subprocess.CalledProcessError: Command '['/usr/bin/python3', '/usr/src/bitcoin/test/functional/create_cache.py', '--cachedir=/usr/src/bitcoin/test/cache', '--configfile=/usr/src/bitcoin/test/functional/../config.ini', '--tmpdir=/tmp/test_runner_₿_🏃_20220504_123152/cache']' returned non-zero exit status 1.
    51`\
    

    any pointers are highly appreciated

    Possible solution

    No response

    Useful Skills

    • RPC/P2P layer
    • Debugging
    • overall understanding of Bitcoin Core

    Guidance for new contributors

    Want to work on this issue?

    For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.

  2. naftalimurgor added the label good first issue on Jun 29, 2023
  3. maflcko commented at 12:24 pm on June 29, 2023: member

    Can you try with:

     0diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py
     1index 5111d88e15..1e605e00b8 100755
     2--- a/test/functional/test_framework/test_node.py
     3+++ b/test/functional/test_framework/test_node.py
     4@@ -232,6 +232,8 @@ class TestNode():
     5         poll_per_s = 4
     6         for _ in range(poll_per_s * self.rpc_timeout):
     7             if self.process.poll() is not None:
     8+                self.stderr.seek(0)
     9+                print(self.stderr.read())
    10                 raise FailedToStartError(self._node_msg(
    11                     'bitcoind exited with status {} during initialization'.format(self.process.returncode)))
    12             try:
    
  4. maflcko commented at 7:53 pm on June 29, 2023: member
    Let us know if this is still an issue
  5. maflcko closed this on Jun 29, 2023

  6. bitcoin locked this on Jun 28, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-29 01:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me