fusion44 / blitz_api

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

API does not start when lightning is switched off #100

Closed rootzoll closed 2 years ago

rootzoll commented 2 years ago

I freshly setup a RaspiBlitz with no lightning implementation (Bitcoin only) from the SSH setup. On the SSH level all works out, but the API does not start. Seeing the following error in the logs:

Jun 04 14:53:31 raspberrypi python[40551]:     module = importlib.import_module(module_str)
Jun 04 14:53:31 raspberrypi python[40551]:   File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
Jun 04 14:53:31 raspberrypi python[40551]:     return _bootstrap._gcd_import(name[level:], package, level)
Jun 04 14:53:31 raspberrypi python[40551]:   File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
Jun 04 14:53:31 raspberrypi python[40551]:   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
Jun 04 14:53:31 raspberrypi python[40551]:   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
Jun 04 14:53:31 raspberrypi python[40551]:   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
Jun 04 14:53:31 raspberrypi python[40551]:   File "<frozen importlib._bootstrap_external>", line 790, in exec_module
Jun 04 14:53:31 raspberrypi python[40551]:   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
Jun 04 14:53:31 raspberrypi python[40551]:   File "./app/main.py", line 27, in <module>
Jun 04 14:53:31 raspberrypi python[40551]:     from app.repositories.bitcoin import (
Jun 04 14:53:31 raspberrypi python[40551]:   File "./app/repositories/bitcoin.py", line 19, in <module>
Jun 04 14:53:31 raspberrypi python[40551]:     from app.utils import SSE, bitcoin_config, bitcoin_rpc_async, send_sse_message
Jun 04 14:53:31 raspberrypi python[40551]:   File "./app/utils.py", line 30, in <module>
Jun 04 14:53:31 raspberrypi python[40551]:     raise ValueError(f"Unknown node type: {node_type}")
Jun 04 14:53:31 raspberrypi python[40551]: ValueError: Unknown node type:
Jun 04 14:53:31 raspberrypi systemd[1]: blitzapi.service: Main process exited, code=exited, status=1/FAILURE
Jun 04 14:53:31 raspberrypi systemd[1]: blitzapi.service: Failed with result 'exit-code'.
Jun 04 14:53:31 raspberrypi systemd[1]: blitzapi.service: Consumed 1.929s CPU time.
Jun 04 14:53:31 raspberrypi systemd[1]: blitzapi.service: Scheduled restart job, restart counter is at 215.
Jun 04 14:53:31 raspberrypi systemd[1]: Stopped BlitzBackendAPI.
Jun 04 14:53:31 raspberrypi systemd[1]: blitzapi.service: Consumed 1.929s CPU time.
Jun 04 14:53:31 raspberrypi systemd[1]: blitzapi.service: Start request repeated too quickly.
Jun 04 14:53:31 raspberrypi systemd[1]: blitzapi.service: Failed with result 'exit-code'.
Jun 04 14:53:31 raspberrypi systemd[1]: Failed to start BlitzBackendAPI.
rootzoll commented 2 years ago

In the .env config file (because its a bitcoin only setup) the ln_node value is empty:

# lnd_grpc, cln_grpc, none
# Please refer to the documentation for the install procedure
# for each implementation.
ln_node=