Skip to content

pyln-test: Bitcoin RPC return No wallet is loaded with Bitcoin 0.21.* #4516

@vincenzopalazzo

Description

@vincenzopalazzo

Issue and Steps to Reproduce

As discuss on IRC I report this error of the bitcoin RPC when I ran the test in my env machine, I receive this error.

I can look more in deep and propose a solution to this problem, I just post here as a reminder 😄

tests/test_closing.py::test_closing ERROR                                  [  8%]

====================================== ERRORS =======================================
____________________________ ERROR at setup of test_init ____________________________

pytestconfig = <_pytest.config.Config object at 0x7fddab5ca610>

    @pytest.fixture()  # type: ignore
    def runner(pytestconfig: Any) -> Any:
        parts = pytestconfig.getoption("runner").rpartition('.')
>       return importlib.import_module(parts[0]).__dict__[parts[2]](pytestconfig)

tests/conftest.py:17: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
lnprototest/clightning/clightning.py:96: in __init__
    self.bitcoind.start()
lnprototest/clightning/clightning.py:63: in start
    self.rpc.generatetoaddress(100, self.rpc.getnewaddress())
../../contrib/pyln-testing/pyln/testing/utils.py:336: in f
    res = proxy._call(name, *args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <bitcoin.rpc.RawProxy object at 0x7fdda90e24f0>
service_name = 'getnewaddress', args = ()
postdata = '{"version": "1.1", "method": "getnewaddress", "params": [], "id": 1}'
headers = {'Authorization': b'Basic cnBjdXNlcjpycGNwYXNz', 'Content-type': 'application/json', 'Host': 'localhost', 'User-Agent': 'AuthServiceProxy/0.1'}
response = {'error': {'code': -18, 'message': 'No wallet is loaded. Load a wallet using loadwallet or create a new one with createwallet. (Note: A default wallet is no longer automatically created)'}, 'id': 1, 'result': None}

    def _call(self, service_name, *args):
        self.__id_count += 1
    
        postdata = json.dumps({'version': '1.1',
                               'method': service_name,
                               'params': args,
                               'id': self.__id_count})
    
        headers = {
            'Host': self.__url.hostname,
            'User-Agent': DEFAULT_USER_AGENT,
            'Content-type': 'application/json',
        }
    
        if self.__auth_header is not None:
            headers['Authorization'] = self.__auth_header
    
        self.__conn.request('POST', self.__url.path, postdata, headers)
    
        response = self._get_response()
        err = response.get('error')
        if err is not None:
            if isinstance(err, dict):
>               raise JSONRPCError(
                    {'code': err.get('code', -345),
                     'message': err.get('message', 'error message not specified')})
E               bitcoin.rpc.JSONRPCError: {'code': -18, 'message': 'No wallet is loaded. Load a wallet using loadwallet or create a new one with createwallet. (Note: A default wallet is no longer automatically created)'}

../../../../.local/lib/python3.8/site-packages/bitcoin/rpc.py:237: JSONRPCError
------------------------------- Captured stdout setup -------------------------------
Port is 39661, dir is /tmp/lnprototest-clightning-4qfel5oz/bitcoind
============================== short test summary info ==============================
ERROR tests/test_bolt1-01-init.py::test_init - bitcoin.rpc.JSONRPCError: {'code': ...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================= 1 error in 0.72s ==================================

getinfo output

c-lightning commit 9825f32
Bitcoin version: Bitcoin Core RPC client version v0.21.

Command used

make -j$(nproc) check DEVELOPER=1 VALGRIND=0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions