test: different error message fails rpc_signer.py #31506

issue 110CodingP openend this issue on December 16, 2024
  1. 110CodingP commented at 3:48 am on December 16, 2024: none

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    On my Ubuntu 24.04 system on running rpc_signer.py functional test (after compiling from source) fails the test which tests the case of missing script (on master and 28.x but passes on 27.x !) I tried running (with only regtest = 1 in bitcoin.conf)

    0bitcoind  -daemon  -signer=fake.py
    1bitcoin-cli enumeratesigners
    

    to get the following:

    0execve failed: Not a directory (20)
    

    which is different than what is asserted in the test. I tried compiling 28.x and master on a Ubuntu 24.04 VM running on Qemu/KVM and the test passes there.

    I followed all the steps for installing the dependencies mentioned in build-unix.md and checked the versions mentioned in dependencies.md . Also tried removing bitcoin and again compiling from source but the test still fails.

    Expected behaviour

    The functional test should pass just like it does on the CI.

    Steps to reproduce

    I referred to build-unix.md for compile instructions and installing dependencies. For master followed the following commands:

    0cmake -B build
    1cmake --build build
    2cmake --install build
    3build/test/functional/rpc_signer.py
    

    which gives basically the following error:

     0Traceback (most recent call last):
     1  File "/home/codingp110/bitcoin/test/functional/test_framework/test_framework.py", line 135, in main
     2    self.run_test()
     3  File "/home/codingp110/bitcoin/build/test/functional/rpc_signer.py", line 56, in run_test
     4    assert_raises_rpc_error(
     5  File "/home/codingp110/bitcoin/test/functional/test_framework/util.py", line 151, in assert_raises_rpc_error
     6    assert try_rpc(code, message, fun, *args, **kwds), "No exception raised"
     7           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     8  File "/home/codingp110/bitcoin/test/functional/test_framework/util.py", line 166, in try_rpc
     9    raise AssertionError(
    10AssertionError: Expected substring not found in error message:
    11substring: 'execve failed: No such file or directory'
    12error message: 'execve failed: Not a directory (20)'.
    

    For 28.x and 27.x (used git worktree to create separate directories and then git reset hard to overwrite with upstream/28.x and upstream/27.x):

    0./autogen.sh
    1./configure
    2make
    3test/functional/rpc_signer.py
    

    28.x gives similar error as master but 27.x passes!

    Relevant log output

    relevant log (master):

     02024-12-16T02:42:47.859000Z TestFramework (ERROR): Assertion failed
     1Traceback (most recent call last):
     2  File "/home/codingp110/bitcoin/test/functional/test_framework/util.py", line 160, in try_rpc
     3    fun(*args, **kwds)
     4  File "/home/codingp110/bitcoin/test/functional/test_framework/coverage.py", line 50, in __call__
     5    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
     6                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     7  File "/home/codingp110/bitcoin/test/functional/test_framework/authproxy.py", line 146, in __call__
     8    raise JSONRPCException(response['error'], status)
     9test_framework.authproxy.JSONRPCException: execve failed: Not a directory (20) (-1)
    10
    11During handling of the above exception, another exception occurred:
    12
    13Traceback (most recent call last):
    14  File "/home/codingp110/bitcoin/test/functional/test_framework/test_framework.py", line 135, in main
    15    self.run_test()
    16  File "/home/codingp110/bitcoin/build/test/functional/rpc_signer.py", line 56, in run_test
    17    assert_raises_rpc_error(
    18  File "/home/codingp110/bitcoin/test/functional/test_framework/util.py", line 151, in assert_raises_rpc_error
    19    assert try_rpc(code, message, fun, *args, **kwds), "No exception raised"
    20           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    21  File "/home/codingp110/bitcoin/test/functional/test_framework/util.py", line 166, in try_rpc
    22    raise AssertionError(
    23AssertionError: Expected substring not found in error message:
    24substring: 'execve failed: No such file or directory'
    25error message: 'execve failed: Not a directory (20)'.
    

    running bitcoind with the -signer=fake.py and then getting strace output on running enumeratesigners rpc gave only the following major differences on master and 27.x on master:

    0readv(6, [{iov_base="HTTP/1.1 200 OK\r\nContent-Type: application/json\r\nDate: Sat, 14 Dec 2024 09:31:05 GMT\r\nContent-Length: 93\r\nConnection: close\r\n\r\n{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-1,\"message\":\"execve failed: Not a directory (20)\"},\"id\":1}\n", iov_len=220}], 1) = 220
    

    on 27.x

    0readv(6, [{iov_base="HTTP/1.1 500 Internal Server Error\r\nContent-Type: application/json\r\nDate: Sat, 14 Dec 2024 09:32:19 GMT\r\nContent-Length: 96\r\nConnection: close\r\n\r\n{\"result\":null,\"error\":{\"code\":-1,\"message\":\"execve failed: No such file or directory\"},\"id\":1}\n", iov_len=242}], 1) = 242
    

    but on doing the same for master and 28.x on a VM(Ubuntu 24.04.1 LTS on VirtualBox) gave the same strace output as my system but with the correct error message.

    PS: The logs/outputs mentioned for master(except for the first one in this section) are old and not for master-b042c4f0538c

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    v28.99.0-b042c4f0538c

    Operating system and version

    Ubuntu 24.04.1 LTS

    Machine specifications

    OS: Ubuntu 24.04 Architecture: x86_64 CPU(s): 8 Vendor ID: GenuineIntel Model name: 12th Gen Intel(R) Core(TM) i3-1215U

  2. 110CodingP commented at 3:50 am on December 16, 2024: none
    I understand that this may be a problem with only my system and hence not relevant, happy to close the issue in that case!
  3. maflcko commented at 7:57 am on December 16, 2024: member

    28.x gives similar error as master but 27.x passes!

    In this case, a git bisect would help to see for which commit the test first fails.

  4. maflcko added the label Tests on Dec 16, 2024
  5. Sjors commented at 11:46 am on December 16, 2024: member

    The error “execve failed: Not a directory (20)” is quite strange, since we’re not expecting -signer to point to a directory.

    Most of the action happens here: https://github.com/bitcoin/bitcoin/blame/master/src/common/run_command.cpp

    And the biggest change between v27 and v28 is #28981

    I assume you’ve tried deleting the build directory to see if you still get the test error?

    Does enumeratesigners work with the real HWI?

  6. 110CodingP commented at 2:02 am on December 17, 2024: none

    Thanks a lot maflcko and Sjors for the suggestions! git bisect gave [70434b1c443d9251a880d0193af771f574c40617] external_signer: replace boost::process with cpp-subprocess compiling bad (the same one Sjors mentioned) as the commit at which the test first fails.

    Tried deleting build and then rebuilding but still the test fails

    Does real HWI mean https://github.com/bitcoin-core/HWI ? Sorry not very familiar with this, will try to see if it works.

    replacing fake.py by ./fake.py fixes the test for both my system and the VM! Did not really understood how the above commit relates to this though.

  7. Sjors commented at 3:22 am on December 17, 2024: member

    Yes, the real HWI is at https://github.com/bitcoin-core/HWI

    No need to connect an actual hardware wallet to it.

    replacing fake.py by ./fake.py fixes the test for both my system and the VM!

    That might be enough info to figure out what’s going on.

    cc @hebasto


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-12-21 12:12 UTC

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