fusion44 / blitz_api

A management backend for the RaspiBlitz project written in Python / FastAPI
MIT License
19 stars 18 forks source link

LND Unlock Error #130

Closed rootzoll closed 2 years ago

rootzoll commented 2 years ago

On a test node with LND I am not able to unlock the wallet - debug locks say the following error:

Jun 30 20:11:47 raspberrypi python[835]: INFO:     127.0.0.1:47738 - "POST /lightning/unlock-wallet HTTP/1.0" 200 OK
Jun 30 20:11:47 raspberrypi python[835]: ERROR:asyncio:Task exception was never retrieved
Jun 30 20:11:47 raspberrypi python[835]: future: <Task finished name='Task-7' coro=<_initialize_lightning() done, defined at ./app/main.py:135> exception=AttributeError("'str' object has no attribute 'state'")>
Jun 30 20:11:47 raspberrypi python[835]: Traceback (most recent call last):
Jun 30 20:11:47 raspberrypi python[835]:   File "./app/main.py", line 144, in _initialize_lightning
Jun 30 20:11:47 raspberrypi python[835]:     async for u in initialize_ln_repo():
Jun 30 20:11:47 raspberrypi python[835]:   File "./app/repositories/lightning.py", line 56, in initialize_ln_repo
Jun 30 20:11:47 raspberrypi python[835]:     async for u in ln.initialize_impl():
Jun 30 20:11:47 raspberrypi python[835]:   File "./app/repositories/ln_impl/lnd_grpc.py", line 229, in initialize_impl
Jun 30 20:11:47 raspberrypi python[835]:     or res.state == LnInitState.BOOTSTRAPPING_AFTER_UNLOCK
Jun 30 20:11:47 raspberrypi python[835]: AttributeError: 'str' object has no attribute 'state'
rootzoll commented 2 years ago

Not sure if important - but it was on a non-fatpack node where I after the fact installed webAPI/webUI und then ran a recover again with a non-fatpack image build. So it could be an edge case - but @fusion44 the python code should maybe check if that state object is available.

fusion44 commented 2 years ago

Nothing serious, but more an annoyance. Anyway, should not happen anymore.