qa: Framework fails when initiating node from cached chain #34163

issue hebasto opened this issue on December 28, 2025
  1. hebasto commented at 6:45 PM on December 28, 2025: member

    Consider the following MRE:

    #!/usr/bin/env python3
    # File: test/functional/MRE.py
    
    from test_framework.test_framework import BitcoinTestFramework
    
    class MRE(BitcoinTestFramework):
        def set_test_params(self):
            self.num_nodes = 1
            self.setup_clean_chain = False  # Test succeeds when True.
    
        def skip_test_if_missing_module(self):
            self.skip_if_no_wallet()
    
        def run_test(self):
            self.log.info("OK")
    
    if __name__ == '__main__':
        MRE(__file__).main()
    

    On OpenIndiana:

    $ $ env CXXFLAGS="-pthread" cmake -B build -DENABLE_IPC=OFF
    $ cmake --build build
    $ python3.14 ./build/test/functional/MRE.py 
    2025-12-28T17:43:24.329616Z TestFramework (INFO): PRNG seed is: 2377333319933758475
    2025-12-28T17:43:24.331825Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_f81ll6fk
    2025-12-28T17:43:24.627126Z TestFramework (ERROR): Unexpected exception
    Traceback (most recent call last):
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 138, in main
        self.setup()
        ~~~~~~~~~~^^
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 269, in setup
        self.setup_network()
        ~~~~~~~~~~~~~~~~~~^^
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 360, in setup_network
        self.setup_nodes()
        ~~~~~~~~~~~~~~~~^^
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 384, in setup_nodes
        self.import_deterministic_coinbase_privkeys()
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 401, in import_deterministic_coinbase_privkeys
        self.init_wallet(node=i)
        ~~~~~~~~~~~~~~~~^^^^^^^^
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 408, in init_wallet
        n.createwallet(wallet_name=wallet_name, load_on_startup=True)
        ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/coverage.py", line 50, in __call__
        return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/authproxy.py", line 156, in __call__
        raise JSONRPCException(response['error'], status)
    test_framework.authproxy.JSONRPCException: Wallet file verification failed. SQLiteDatabase: Failed to open database: unable to open database file
     (-4)
    2025-12-28T17:43:24.682846Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    2025-12-28T17:43:24.683153Z TestFramework (WARNING): Not cleaning up dir /tmp/bitcoin_func_test_f81ll6fk
    2025-12-28T17:43:24.683377Z TestFramework (ERROR): Test failed. Test logging available at /tmp/bitcoin_func_test_f81ll6fk/test_framework.log
    2025-12-28T17:43:24.684155Z TestFramework (ERROR): 
    2025-12-28T17:43:24.684615Z TestFramework (ERROR): Hint: Call /export/home/hebasto/dev/bitcoin/test/functional/combine_logs.py '/tmp/bitcoin_func_test_f81ll6fk' to consolidate all logs
    2025-12-28T17:43:24.684729Z TestFramework (ERROR): 
    2025-12-28T17:43:24.684901Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    2025-12-28T17:43:24.685270Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    2025-12-28T17:43:24.685378Z TestFramework (ERROR): 
    [node 0] Cleaning up leftover process
    
  2. hebasto added the label Wallet on Dec 28, 2025
  3. hebasto added the label Tests on Dec 28, 2025
  4. maflcko commented at 10:22 AM on December 29, 2025: member

    I think the difference is where the wallets dir is located with a clean datadir vs a datadir with a chain (reminds me of #34128)

    If yes, this may be possible to reproduce outside the test framework.

    Is OpenIndiana the only distro that fails?

  5. hebasto commented at 11:06 AM on December 29, 2025: member

    Is OpenIndiana the only distro that fails?

    Yes, as far I'm aware of. OmniOS, another illumos-based distro, works fine.

  6. furszy commented at 5:30 PM on December 29, 2025: member

    I don't think it is related to #34128. It sounds more like a permissions issue. Can try creating a wallet in the /tmp/ dir manually to test it?

  7. furszy commented at 7:46 PM on December 29, 2025: member

    @hebasto, run #34176 whenever you get a chance.

  8. hebasto commented at 8:43 PM on December 29, 2025: member

    @hebasto, run #34176 whenever you get a chance.

    Thanks @furszy!

    Below is the log of running #34176:

    $ git rev-parse HEAD
    68a467799381d6e89f40267fc500b734975b5433
    $ env CXXFLAGS="-pthread" cmake -B build -DENABLE_IPC=OFF
    $ cmake --build build
    $ python3.14 ./build/test/functional/MRE.py
    2025-12-29T19:35:37.016521Z TestFramework (INFO): PRNG seed is: 3863112130535673226
    2025-12-29T19:35:37.017830Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_3_be70q7
    2025-12-29T19:35:37.317178Z TestFramework (ERROR): Unexpected exception
    Traceback (most recent call last):
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 138, in main
        self.setup()
        ~~~~~~~~~~^^
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 269, in setup
        self.setup_network()
        ~~~~~~~~~~~~~~~~~~^^
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 360, in setup_network
        self.setup_nodes()
        ~~~~~~~~~~~~~~~~^^
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 384, in setup_nodes
        self.import_deterministic_coinbase_privkeys()
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 401, in import_deterministic_coinbase_privkeys
        self.init_wallet(node=i)
        ~~~~~~~~~~~~~~~~^^^^^^^^
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 408, in init_wallet
        n.createwallet(wallet_name=wallet_name, load_on_startup=True)
        ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/coverage.py", line 50, in __call__
        return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
      File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/authproxy.py", line 156, in __call__
        raise JSONRPCException(response['error'], status)
    test_framework.authproxy.JSONRPCException: Wallet file verification failed. SQLiteDatabase: Failed to open database: unable to open database file
     (-4)
    2025-12-29T19:35:37.372890Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later.
    2025-12-29T19:35:37.373126Z TestFramework (WARNING): Not cleaning up dir /tmp/bitcoin_func_test_3_be70q7
    2025-12-29T19:35:37.373353Z TestFramework (ERROR): Test failed. Test logging available at /tmp/bitcoin_func_test_3_be70q7/test_framework.log
    2025-12-29T19:35:37.374043Z TestFramework (ERROR): 
    2025-12-29T19:35:37.374478Z TestFramework (ERROR): Hint: Call /export/home/hebasto/dev/bitcoin/test/functional/combine_logs.py '/tmp/bitcoin_func_test_3_be70q7' to consolidate all logs
    2025-12-29T19:35:37.374601Z TestFramework (ERROR): 
    2025-12-29T19:35:37.374783Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
    2025-12-29T19:35:37.375148Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
    2025-12-29T19:35:37.375266Z TestFramework (ERROR): 
    [node 0] Cleaning up leftover process
    

    The combined log follows:

    $ python3.14 /export/home/hebasto/dev/bitcoin/test/functional/combine_logs.py '/tmp/bitcoin_func_test_3_be70q7'
     test  2025-12-29T19:35:37.016521Z TestFramework (INFO): PRNG seed is: 3863112130535673226 
     test  2025-12-29T19:35:37.016742Z TestFramework (DEBUG): Setting up network thread 
     test  2025-12-29T19:35:37.017830Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_3_be70q7 
     test  2025-12-29T19:35:37.018043Z TestFramework (DEBUG): Copy cache directory /export/home/hebasto/dev/bitcoin/build/test/cache/node0 to node 0 
     test  2025-12-29T19:35:37.051574Z TestFramework.node0 (DEBUG): bitcoind started, waiting for RPC to come up 
     node0 2025-12-29T19:35:37.067254Z [init] [init/common.cpp:153] [LogPackageVersion] Bitcoin Core version v30.99.0-68a467799381 (release build) 
     node0 2025-12-29T19:35:37.067260Z [init] [init.cpp:747] [InitParameterInteraction] parameter interaction: -bind set -> setting -listen=1 
     node0 2025-12-29T19:35:37.067442Z [init] [kernel/context.cpp:20] [operator()] Using the 'x86_shani(1way;2way)' SHA256 implementation 
     node0 2025-12-29T19:35:37.168629Z [init] [random.cpp:110] [ReportHardwareRand] Using RdSeed as an additional entropy source 
     node0 2025-12-29T19:35:37.168644Z [init] [random.cpp:113] [ReportHardwareRand] Using RdRand as an additional entropy source 
     node0 2025-12-29T19:35:37.170733Z [init] [init/common.cpp:121] [StartLogging] Default data directory /export/home/hebasto/.bitcoin 
     node0 2025-12-29T19:35:37.170741Z [init] [init/common.cpp:122] [StartLogging] Using data directory /tmp/bitcoin_func_test_3_be70q7/node0/regtest 
     node0 2025-12-29T19:35:37.170756Z [init] [init/common.cpp:131] [StartLogging] Config file: /tmp/bitcoin_func_test_3_be70q7/node0/bitcoin.conf 
     node0 2025-12-29T19:35:37.170772Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: regtest="1" 
     node0 2025-12-29T19:35:37.170781Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] bind="127.0.0.1" 
     node0 2025-12-29T19:35:37.170787Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] connect="0" 
     node0 2025-12-29T19:35:37.170793Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] discover="0" 
     node0 2025-12-29T19:35:37.170799Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] dnsseed="0" 
     node0 2025-12-29T19:35:37.170805Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] fallbackfee="0.0002" 
     node0 2025-12-29T19:35:37.170810Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] fixedseeds="0" 
     node0 2025-12-29T19:35:37.170817Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] keypool="1" 
     node0 2025-12-29T19:35:37.170825Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] listenonion="0" 
     node0 2025-12-29T19:35:37.170831Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] maxconnections="94" 
     node0 2025-12-29T19:35:37.170837Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] natpmp="0" 
     node0 2025-12-29T19:35:37.170842Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] par="2" 
     node0 2025-12-29T19:35:37.170849Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] peertimeout="999999999" 
     node0 2025-12-29T19:35:37.170855Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] port="11413" 
     node0 2025-12-29T19:35:37.170861Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] printtoconsole="0" 
     node0 2025-12-29T19:35:37.170867Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] rpcdoccheck="1" 
     node0 2025-12-29T19:35:37.170873Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] rpcport="16413" 
     node0 2025-12-29T19:35:37.170878Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] rpcservertimeout="99000" 
     node0 2025-12-29T19:35:37.170885Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] rpcthreads="2" 
     node0 2025-12-29T19:35:37.170891Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] server="1" 
     node0 2025-12-29T19:35:37.170897Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] shrinkdebugfile="0" 
     node0 2025-12-29T19:35:37.170902Z [init] [common/args.cpp:863] [logArgsPrefix] Config file arg: [regtest] unsafesqlitesync="1" 
     node0 2025-12-29T19:35:37.170910Z [init] [common/args.cpp:863] [logArgsPrefix] Command-line arg: datadir="/tmp/bitcoin_func_test_3_be70q7/node0" 
     node0 2025-12-29T19:35:37.170916Z [init] [common/args.cpp:863] [logArgsPrefix] Command-line arg: debug="" 
     node0 2025-12-29T19:35:37.170922Z [init] [common/args.cpp:863] [logArgsPrefix] Command-line arg: debugexclude="libevent" 
     node0 2025-12-29T19:35:37.170928Z [init] [common/args.cpp:863] [logArgsPrefix] Command-line arg: debugexclude="leveldb" 
     node0 2025-12-29T19:35:37.170933Z [init] [common/args.cpp:863] [logArgsPrefix] Command-line arg: debugexclude="rand" 
     node0 2025-12-29T19:35:37.170945Z [init] [common/args.cpp:863] [logArgsPrefix] Command-line arg: loglevel="trace" 
     node0 2025-12-29T19:35:37.170951Z [init] [common/args.cpp:863] [logArgsPrefix] Command-line arg: logratelimit=false 
     node0 2025-12-29T19:35:37.170957Z [init] [common/args.cpp:863] [logArgsPrefix] Command-line arg: logsourcelocations="" 
     node0 2025-12-29T19:35:37.170962Z [init] [common/args.cpp:863] [logArgsPrefix] Command-line arg: logthreadnames="" 
     node0 2025-12-29T19:35:37.170969Z [init] [common/args.cpp:863] [logArgsPrefix] Command-line arg: logtimemicros="" 
     node0 2025-12-29T19:35:37.170975Z [init] [common/args.cpp:863] [logArgsPrefix] Command-line arg: uacomment="testnode0" 
     node0 2025-12-29T19:35:37.170981Z [init] [common/args.cpp:863] [logArgsPrefix] Command-line arg: v2transport="0" 
     node0 2025-12-29T19:35:37.171018Z [init] [init.cpp:1414] [AppInitMain] Using at most 94 automatic connections (65536 file descriptors available) 
     node0 2025-12-29T19:35:37.171600Z [init] [init.cpp:1454] [AppInitMain] Log rate limiting disabled 
     node0 2025-12-29T19:35:37.171642Z [scheduler] [util/thread.cpp:20] [TraceThread] scheduler thread start 
     node0 2025-12-29T19:35:37.177124Z [init] [httpserver.cpp:241] [InitHTTPAllowList] [http] Allowing HTTP connections from: 127.0.0.0/8 ::1/128 
     node0 2025-12-29T19:35:37.177357Z [init] [httpserver.cpp:394] [HTTPBindAddresses] Binding RPC on address ::1 port 16413 
     node0 2025-12-29T19:35:37.177537Z [init] [httpserver.cpp:394] [HTTPBindAddresses] Binding RPC on address 127.0.0.1 port 16413 
     node0 2025-12-29T19:35:37.177575Z [init] [httpserver.cpp:477] [InitHTTPServer] [http] Initialized HTTP server 
     node0 2025-12-29T19:35:37.177586Z [init] [httpserver.cpp:479] [InitHTTPServer] [http] creating work queue of depth 64 
     node0 2025-12-29T19:35:37.177593Z [init] [rpc/server.cpp:275] [StartRPC] [rpc] Starting RPC 
     node0 2025-12-29T19:35:37.177611Z [init] [httprpc.cpp:333] [StartHTTPRPC] [rpc] Starting HTTP RPC server 
     node0 2025-12-29T19:35:37.177709Z [init] [rpc/request.cpp:140] [GenerateAuthCookie] Generated RPC authentication cookie /tmp/bitcoin_func_test_3_be70q7/node0/regtest/.cookie 
     node0 2025-12-29T19:35:37.177725Z [init] [rpc/request.cpp:141] [GenerateAuthCookie] Permissions used for cookie: rw------- 
     node0 2025-12-29T19:35:37.177742Z [init] [httprpc.cpp:265] [InitRPCAuthentication] Using random cookie authentication. 
     node0 2025-12-29T19:35:37.177776Z [init] [httpserver.cpp:759] [RegisterHTTPHandler] [http] Registering HTTP handler for / (exactmatch 1) 
     node0 2025-12-29T19:35:37.177788Z [init] [httpserver.cpp:759] [RegisterHTTPHandler] [http] Registering HTTP handler for /wallet/ (exactmatch 0) 
     node0 2025-12-29T19:35:37.177797Z [init] [httpserver.cpp:502] [StartHTTPServer] Starting HTTP server with 2 worker threads 
     node0 2025-12-29T19:35:37.177917Z [http] [httpserver.cpp:354] [ThreadHTTP] [http] Entering http event loop 
     node0 2025-12-29T19:35:37.178037Z [init] [wallet/load.cpp:53] [VerifyWallets] Using wallet directory /tmp/bitcoin_func_test_3_be70q7/node0/regtest 
     node0 2025-12-29T19:35:37.178063Z [init] [wallet/walletdb.cpp:69] [LogDBInfo] Using SQLite Version 3.51.1 
     node0 2025-12-29T19:35:37.178111Z [init] [noui.cpp:57] [noui_InitMessage] init message: Verifying wallet(s)… 
     node0 2025-12-29T19:35:37.178216Z [init] [init.cpp:1574] [AppInitMain] Using /16 prefix for IP bucketing 
     node0 2025-12-29T19:35:37.178223Z [init] [noui.cpp:57] [noui_InitMessage] init message: Loading P2P addresses… 
     node0 2025-12-29T19:35:37.180357Z [init] [addrdb.cpp:211] [LoadAddrman] Creating peers.dat because the file was not found ("/tmp/bitcoin_func_test_3_be70q7/node0/regtest/peers.dat") 
     node0 2025-12-29T19:35:37.180575Z [init] [noui.cpp:57] [noui_InitMessage] init message: Loading banlist… 
     node0 2025-12-29T19:35:37.180592Z [init] [banman.cpp:42] [LoadBanlist] Recreating the banlist database 
     node0 2025-12-29T19:35:37.180648Z [init] [banman.cpp:68] [DumpBanlist] [net] Flushed 0 banned node addresses/subnets to disk  0ms 
     node0 2025-12-29T19:35:37.180674Z [init] [net.cpp:2434] [SetTryNewOutboundPeer] [net] setting try another outbound peer=false 
     node0 2025-12-29T19:35:37.180701Z [init] [net.cpp:3219] [SetNetworkActive] SetNetworkActive: true 
     node0 2025-12-29T19:35:37.183146Z [init] [policy/fees/block_policy_estimator.cpp:564] [CBlockPolicyEstimator] /tmp/bitcoin_func_test_3_be70q7/node0/regtest/fee_estimates.dat is not found. Continue anyway. 
     node0 2025-12-29T19:35:37.183260Z [init] [init.cpp:1780] [AppInitMain] Cache configuration: 
     node0 2025-12-29T19:35:37.183276Z [init] [init.cpp:1781] [AppInitMain] * Using 2.0 MiB for block index database 
     node0 2025-12-29T19:35:37.183288Z [init] [init.cpp:1789] [AppInitMain] * Using 8.0 MiB for chain state database 
     node0 2025-12-29T19:35:37.183342Z [init] [init.cpp:1300] [InitAndLoadChainstate] * Using 440.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space) 
     node0 2025-12-29T19:35:37.183384Z [init] [checkqueue.h:147] [CCheckQueue] Script verification uses 1 additional threads 
     node0 2025-12-29T19:35:37.183606Z [init] [node/blockstorage.cpp:1203] [InitBlocksdirXorKey] Using obfuscation key for blocksdir *.dat files (/tmp/bitcoin_func_test_3_be70q7/node0/regtest/blocks): '5d4aa856db94dcfc' 
     node0 2025-12-29T19:35:37.183686Z [init] [dbwrapper.cpp:236] [CDBWrapper] Opening LevelDB in /tmp/bitcoin_func_test_3_be70q7/node0/regtest/blocks/index 
     node0 2025-12-29T19:35:37.184533Z [init] [dbwrapper.cpp:244] [CDBWrapper] Opened LevelDB successfully 
     node0 2025-12-29T19:35:37.184564Z [init] [dbwrapper.cpp:260] [CDBWrapper] Using obfuscation key for /tmp/bitcoin_func_test_3_be70q7/node0/regtest/blocks/index: 0000000000000000 
     node0 2025-12-29T19:35:37.206110Z [init] [script/sigcache.cpp:35] [SignatureCache] Using 16 MiB out of 16 MiB requested for signature cache, able to store 524288 elements 
     node0 2025-12-29T19:35:37.227564Z [init] [validation.cpp:2067] [ValidationCache] Using 16 MiB out of 16 MiB requested for script execution cache, able to store 524288 elements 
     node0 2025-12-29T19:35:37.227582Z [init] [noui.cpp:57] [noui_InitMessage] init message: Loading block index… 
     node0 2025-12-29T19:35:37.227596Z [init] [node/chainstate.cpp:150] [LoadChainstate] Validating signatures for all blocks. 
     node0 2025-12-29T19:35:37.227607Z [init] [node/chainstate.cpp:152] [LoadChainstate] Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000000000000 
     node0 2025-12-29T19:35:37.228053Z [init] [node/blockstorage.cpp:530] [LoadBlockIndexDB] Loading block index db: last block file = 0 
     node0 2025-12-29T19:35:37.228070Z [init] [node/blockstorage.cpp:534] [LoadBlockIndexDB] Loading block index db: last block file info: CBlockFileInfo(blocks=200, size=52530, heights=0...199, time=2011-02-02...2011-02-02) 
     node0 2025-12-29T19:35:37.228077Z [init] [node/blockstorage.cpp:545] [LoadBlockIndexDB] Checking all blk files are present... 
     node0 2025-12-29T19:35:37.228202Z [init] [node/chainstate.cpp:87] [CompleteChainstateInitialization] Initializing chainstate Chainstate [ibd] @ height -1 (null) 
     node0 2025-12-29T19:35:37.228221Z [init] [dbwrapper.cpp:236] [CDBWrapper] Opening LevelDB in /tmp/bitcoin_func_test_3_be70q7/node0/regtest/chainstate 
     node0 2025-12-29T19:35:37.228740Z [init] [dbwrapper.cpp:244] [CDBWrapper] Opened LevelDB successfully 
     node0 2025-12-29T19:35:37.228765Z [init] [dbwrapper.cpp:260] [CDBWrapper] Using obfuscation key for /tmp/bitcoin_func_test_3_be70q7/node0/regtest/chainstate: 926cb82614cf3a36 
     node0 2025-12-29T19:35:37.228872Z [init] [validation.cpp:4651] [LoadChainTip] Loaded best chain: hashBestChain=30068a561f1d748696d6fe1368b2b9b9f765095cda5b767b291e8bf84caff9f1 height=199 date=2011-02-02T23:17:17Z progress=0.000425 
     node0 2025-12-29T19:35:37.228913Z [init] [noui.cpp:57] [noui_InitMessage] init message: Verifying blocks… 
     node0 2025-12-29T19:35:37.228938Z [init] [validation.cpp:4699] [VerifyDB] Verifying last 6 blocks at level 3 
     node0 2025-12-29T19:35:37.228966Z [init] [validation.cpp:4708] [VerifyDB] Verification progress: 0% 
     node0 2025-12-29T19:35:37.229357Z [init] [validation.cpp:4716] [VerifyDB] Verification progress: 16% 
     node0 2025-12-29T19:35:37.229547Z [init] [validation.cpp:4716] [VerifyDB] Verification progress: 33% 
     node0 2025-12-29T19:35:37.229733Z [init] [validation.cpp:4716] [VerifyDB] Verification progress: 50% 
     node0 2025-12-29T19:35:37.229926Z [init] [validation.cpp:4716] [VerifyDB] Verification progress: 66% 
     node0 2025-12-29T19:35:37.230132Z [init] [validation.cpp:4716] [VerifyDB] Verification progress: 83% 
     node0 2025-12-29T19:35:37.230322Z [init] [validation.cpp:4716] [VerifyDB] Verification progress: 99% 
     node0 2025-12-29T19:35:37.230330Z [init] [validation.cpp:4810] [VerifyDB] Verification: No coin database inconsistencies in last 6 blocks (6 transactions) 
     node0 2025-12-29T19:35:37.230337Z [init] [init.cpp:1388] [InitAndLoadChainstate] Block index and chainstate loaded 
     node0 2025-12-29T19:35:37.230396Z [init] [init.cpp:1888] [AppInitMain] Setting NODE_NETWORK in non-prune mode 
     node0 2025-12-29T19:35:37.230464Z [init] [init.cpp:2018] [AppInitMain] block tree size = 200 
     node0 2025-12-29T19:35:37.230470Z [init] [init.cpp:2031] [AppInitMain] nBestHeight = 199 
     node0 2025-12-29T19:35:37.230510Z [initload] [util/thread.cpp:20] [TraceThread] initload thread start 
     node0 2025-12-29T19:35:37.230592Z [init] [net.cpp:3192] [BindListenPort] Bound to 127.0.0.1:11413 
     node0 2025-12-29T19:35:37.230615Z [init] [noui.cpp:57] [noui_InitMessage] init message: Starting network threads… 
     node0 2025-12-29T19:35:37.230678Z [initload] [node/mempool_persist.cpp:49] [LoadMempool] Failed to open mempool file. Continuing anyway. 
     node0 2025-12-29T19:35:37.230710Z [init] [net.cpp:3388] [Start] DNS seeding disabled 
     node0 2025-12-29T19:35:37.230825Z [net] [util/thread.cpp:20] [TraceThread] net thread start 
     node0 2025-12-29T19:35:37.230889Z [init] [noui.cpp:57] [noui_InitMessage] init message: Done loading 
     node0 2025-12-29T19:35:37.230906Z [addcon] [util/thread.cpp:20] [TraceThread] addcon thread start 
     node0 2025-12-29T19:35:37.230955Z [msghand] [util/thread.cpp:20] [TraceThread] msghand thread start 
     node0 2025-12-29T19:35:37.231022Z [initload] [util/thread.cpp:22] [TraceThread] initload thread exit 
     node0 2025-12-29T19:35:37.311596Z [http] [httpserver.cpp:307] [http_request_cb] [http] Received a POST request for / from 127.0.0.1:41193 
     node0 2025-12-29T19:35:37.311969Z [httpworker.1] [rpc/request.cpp:243] [parse] [rpc] ThreadRPCServer method=getblockcount user=__cookie__ 
     node0 2025-12-29T19:35:37.313694Z [http] [httpserver.cpp:307] [http_request_cb] [http] Received a POST request for / from 127.0.0.1:41193 
     node0 2025-12-29T19:35:37.313798Z [httpworker.1] [rpc/request.cpp:243] [parse] [rpc] ThreadRPCServer method=getmempoolinfo user=__cookie__ 
     test  2025-12-29T19:35:37.314579Z TestFramework.node0 (DEBUG): RPC successfully started 
     node0 2025-12-29T19:35:37.315136Z [http] [httpserver.cpp:307] [http_request_cb] [http] Received a POST request for / from 127.0.0.1:41193 
     node0 2025-12-29T19:35:37.315238Z [httpworker.1] [rpc/request.cpp:243] [parse] [rpc] ThreadRPCServer method=createwallet user=__cookie__ 
     node0 2025-12-29T19:35:37.316047Z [httpworker.1] [wallet/sqlite.cpp:43] [ErrorLogCallback] [warning] SQLite Error. Code: 14. Message: cannot open file at line 46164 of [281fc0e9af] 
     node0 2025-12-29T19:35:37.316066Z [httpworker.1] [wallet/sqlite.cpp:43] [ErrorLogCallback] [warning] SQLite Error. Code: 14. Message: os_unix.c:46164: (0) lstat(/tmp/bitcoin_func_test_3_be70q7/node0/regtest/default_wallet/wallet.dat) - 
     node0 2025-12-29T19:35:37.316084Z [httpworker.1] [wallet/sqlite.cpp:43] [ErrorLogCallback] [warning] SQLite Error. Code: 14. Message: cannot open file at line 46239 of [281fc0e9af] 
     test  2025-12-29T19:35:37.317178Z TestFramework (ERROR): Unexpected exception 
                                       Traceback (most recent call last):
                                         File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 138, in main
                                           self.setup()
                                           ~~~~~~~~~~^^
                                         File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 269, in setup
                                           self.setup_network()
                                           ~~~~~~~~~~~~~~~~~~^^
                                         File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 360, in setup_network
                                           self.setup_nodes()
                                           ~~~~~~~~~~~~~~~~^^
                                         File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 384, in setup_nodes
                                           self.import_deterministic_coinbase_privkeys()
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
                                         File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 401, in import_deterministic_coinbase_privkeys
                                           self.init_wallet(node=i)
                                           ~~~~~~~~~~~~~~~~^^^^^^^^
                                         File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/test_framework.py", line 408, in init_wallet
                                           n.createwallet(wallet_name=wallet_name, load_on_startup=True)
                                           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                         File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/coverage.py", line 50, in __call__
                                           return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
                                         File "/export/home/hebasto/dev/bitcoin/test/functional/test_framework/authproxy.py", line 156, in __call__
                                           raise JSONRPCException(response['error'], status)
                                       test_framework.authproxy.JSONRPCException: Wallet file verification failed. SQLiteDatabase: Failed to open database: unable to open database file
                                        (-4)
     test  2025-12-29T19:35:37.321618Z TestFramework (DEBUG): Closing down network thread 
     test  2025-12-29T19:35:37.372890Z TestFramework (INFO): Not stopping nodes as test failed. The dangling processes will be cleaned up later. 
     test  2025-12-29T19:35:37.373126Z TestFramework (WARNING): Not cleaning up dir /tmp/bitcoin_func_test_3_be70q7 
     test  2025-12-29T19:35:37.373353Z TestFramework (ERROR): Test failed. Test logging available at /tmp/bitcoin_func_test_3_be70q7/test_framework.log 
     test  2025-12-29T19:35:37.374043Z TestFramework (ERROR): 
     test  2025-12-29T19:35:37.374478Z TestFramework (ERROR): Hint: Call /export/home/hebasto/dev/bitcoin/test/functional/combine_logs.py '/tmp/bitcoin_func_test_3_be70q7' to consolidate all logs 
     test  2025-12-29T19:35:37.374601Z TestFramework (ERROR): 
     test  2025-12-29T19:35:37.374783Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log. 
     test  2025-12-29T19:35:37.375148Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues 
     test  2025-12-29T19:35:37.375266Z TestFramework (ERROR): 
    
    
  9. hebasto commented at 8:46 PM on December 29, 2025: member

    I don't think it is related to #34128. It sounds more like a permissions issue. Can try creating a wallet in the /tmp/ dir manually to test it?

    Specifing any other directory, for example, with --tmpdir $(pwd)/tmp, does not help.

  10. maflcko commented at 7:58 AM on December 30, 2025: member

    I wonder if you can reproduce this outside of the test framework:

    • Start once, to create a datadir
    • Delete empty wallets dir, similar to the test framework: os.rmdir(cache_path('wallets')) # Remove empty wallets dir
    • Start again, and create the wallet, similar to the test framework via the createwallet RPC.
  11. furszy commented at 4:48 PM on December 30, 2025: member

    node0 2025-12-29T19:35:37.316047Z [httpworker.1] [wallet/sqlite.cpp:43] [ErrorLogCallback] [warning] SQLite Error. Code: 14. Message: cannot open file at line 46164 of [281fc0e9af] node0 2025-12-29T19:35:37.316066Z [httpworker.1] [wallet/sqlite.cpp:43] [ErrorLogCallback] [warning] SQLite Error. Code: 14. Message: os_unix.c:46164: (0) lstat(/tmp/bitcoin_func_test_3_be70q7/node0/regtest/default_wallet/wallet.dat) - node0 2025-12-29T19:35:37.316084Z [httpworker.1] [wallet/sqlite.cpp:43] [ErrorLogCallback] [warning] SQLite Error. Code: 14. Message: cannot open file at line 46239 of [281fc0e9af]

    Per the logs, sqlite is failing after a lstat() call. This seems to be OS specific rather than an issue on our side. OpenIndiana seems to have more advanced access control features, so probably perms behave differently than on other systems.

    Could try explicitly setting broader perms on the directory to ensure sqlite can access it. Also, could check perms during the test; add a breakpoint just before calling createwallet and check the directory perms manually.

  12. hebasto commented at 10:59 AM on January 1, 2026: member

    I wonder if you can reproduce this outside of the test framework:

    • Start once, to create a datadir

    • Delete empty wallets dir, similar to the test framework: os.rmdir(cache_path('wallets')) # Remove empty wallets dir

    • Start again, and create the wallet, similar to the test framework via the createwallet RPC.

    I tested this scenario, and it works as expected.

  13. hebasto commented at 5:27 PM on January 1, 2026: member

    It appears that sqlite3_open_v2 fails only when executed in the functional test context. However, I didn't find any filesystem permission violations.

  14. maflcko commented at 5:44 PM on January 1, 2026: member

    I wonder if the shutil.copytree(cache_node_dir, to_dir) changes any permissions.

    I tested this scenario, and it works as expected.

    Does it even pass when you run it with the datadir set to the datadir of the previously failing test. I.e. /tmp/bitcoin_func_test_3_be70q7.

    Does it pass when you set the datadir to the cache_node_dir manually?

  15. hebasto commented at 6:58 PM on January 1, 2026: member

    It appears that sqlite3_open_v2 fails only when executed in the functional test context. However, I didn't find any filesystem permission violations.

    When building sqlite from source (using the pre-1db74914706fcfafb22646288458604a4a7b6282 branch), the issue disappears, which makes me even more confused.

  16. hebasto commented at 9:46 PM on January 1, 2026: member

    I wonder if the shutil.copytree(cache_node_dir, to_dir) changes any permissions.

    I tested this scenario, and it works as expected.

    Does it even pass when you run it with the datadir set to the datadir of the previously failing test. I.e. /tmp/bitcoin_func_test_3_be70q7.

    It fails:

    $ ./build/bin/bitcoin-cli -regtest -datadir=/tmp/bitcoin_func_test_2ku20ra3/node0 createwallet default_wallet
    error code: -4
    error message:
    Wallet file verification failed. SQLiteDatabase: Failed to open database: unable to open database file
    
    $ ./build/bin/bitcoin-cli -regtest -datadir=/tmp/bitcoin_func_test_2ku20ra3/node0 createwallet default_wallet_2
    error code: -4
    error message:
    Wallet file verification failed. SQLiteDatabase: Failed to open database: unable to open database file
    
    

    Does it pass when you set the datadir to the cache_node_dir manually?

    It fails as well:

    $ ./build/bin/bitcoin-cli -regtest -datadir=/export/home/hebasto/dev/bitcoin/build/test/cache/node0 createwallet default_wallet
    error code: -4
    error message:
    Wallet file verification failed. SQLiteDatabase: Failed to open database: unable to open database file
    
    
  17. hebasto commented at 11:01 PM on January 1, 2026: member

    I wonder if you can reproduce this outside of the test framework:

    • Start once, to create a datadir
    • Delete empty wallets dir, similar to the test framework: os.rmdir(cache_path('wallets')) # Remove empty wallets dir
    • Start again, and create the wallet, similar to the test framework via the createwallet RPC.

    I tested this scenario, and it works as expected.

    I found the culprit: the -bind option.

    Below are the steps to reproduce the issue:

    $ mkdir $HOME/dd
    $ ./build/bin/bitcoind -regtest -datadir=$HOME/dd -bind=127.0.0.1 -daemon
    Bitcoin Core starting
    $ ./build/bin/bitcoin-cli -regtest -datadir=$HOME/dd stop
    Bitcoin Core stopping
    $ rm -rf $HOME/dd/regtest/wallets
    $ ./build/bin/bitcoind -regtest -datadir=$HOME/dd -bind=127.0.0.1 -daemon
    Bitcoin Core starting
    $ ./build/bin/bitcoin-cli -regtest -datadir=$HOME/dd createwallet default_wallet
    error code: -4
    error message:
    Wallet file verification failed. SQLiteDatabase: Failed to open database: unable to open database file
    
    $ ./build/bin/bitcoin-cli -regtest -datadir=$HOME/dd stop
    Bitcoin Core stopping
    

    The SQLite package installed on the system is database/sqlite-3@3.51.1-2025.0.0.0.

  18. hebasto added the label Upstream on Jan 6, 2026
  19. bitcoin deleted a comment on Jan 28, 2026
  20. fanquake commented at 2:59 PM on February 5, 2026: member

    If the determination is that this is an upstream issue, has anything been reported upstream, what are next steps here?

  21. hebasto commented at 3:05 PM on February 5, 2026: member

    If the determination is that this is an upstream issue, has anything been reported upstream, what are next steps here?

    Unfortunately, I failed to generate an MRE for the upstream issue report.

  22. fanquake commented at 12:40 PM on February 27, 2026: member

    What should we do here then? This seems to be an unreportable issue, for a platform that, as far as we know, we have no users for.

  23. hebasto closed this on Feb 27, 2026

  24. maflcko commented at 2:05 PM on February 27, 2026: member

    Maybe show a full strace log of the ./build/bin/bitcoin-cli -regtest -datadir=$HOME/dd createwallet default_wallet call? Once without the issue, and once with the issue?


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: 2026-04-16 03:12 UTC

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