Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lnd grpc api remains in undefined state on given invalid macaroon path #220

Open
fusion44 opened this issue Jul 9, 2023 · 0 comments
Open
Labels
bug Something isn't working LND Issues concerning LND only v0.7.0-beta
Milestone

Comments

@fusion44
Copy link
Owner

fusion44 commented Jul 9, 2023

When LND is started with an invalid macaroon path the lightning parts will be in an undefined state. The algorithm should test the paths existence for some time and stop if unsuccessful after x amount of tries. If the Api is started at the same time as with the lightning node the required files might not be available yet.

2023-07-09 07:01:17 | ❌ | events.py:80 | An error has been caught in function '_run', process 'MainProcess' (1), thread 'MainThread' (140323440888704):
Traceback (most recent call last):

  File "/usr/local/bin/uvicorn", line 8, in <module>
    sys.exit(main())
    │   │    └ <Command main>
    │   └ <built-in function exit>
    └ <module 'sys' (built-in)>
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           │    │     │       └ {}
           │    │     └ ()
           │    └ <function BaseCommand.main at 0x7f9f97fd80d0>
           └ <Command main>
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         │    │      └ <click.core.Context object at 0x7f9f98b51be0>
         │    └ <function Command.invoke at 0x7f9f97fd8b80>
         └ <Command main>
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           │   │      │    │           │   └ {'host': '0.0.0.0', 'port': 80, 'app': 'app.main:app', 'uds': None, 'fd': None, 'reload': False, 'reload_dirs': (), 'reload_i...
           │   │      │    │           └ <click.core.Context object at 0x7f9f98b51be0>
           │   │      │    └ <function main at 0x7f9f97dfa310>
           │   │      └ <Command main>
           │   └ <function Context.invoke at 0x7f9f97fd5940>
           └ <click.core.Context object at 0x7f9f98b51be0>
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
                       │       └ {'host': '0.0.0.0', 'port': 80, 'app': 'app.main:app', 'uds': None, 'fd': None, 'reload': False, 'reload_dirs': (), 'reload_i...
                       └ ()
  File "/usr/local/lib/python3.9/site-packages/uvicorn/main.py", line 404, in main
    run(
    └ <function run at 0x7f9f97e731f0>
  File "/usr/local/lib/python3.9/site-packages/uvicorn/main.py", line 569, in run
    server.run()
    │      └ <function Server.run at 0x7f9f97e72ca0>
    └ <uvicorn.server.Server object at 0x7f9f97e393a0>
  File "/usr/local/lib/python3.9/site-packages/uvicorn/server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
           │       │   │    │             └ None
           │       │   │    └ <function Server.serve at 0x7f9f97e72d30>
           │       │   └ <uvicorn.server.Server object at 0x7f9f97e393a0>
           │       └ <function run at 0x7f9f98ac3280>
           └ <module 'asyncio' from '/usr/local/lib/python3.9/asyncio/__init__.py'>
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
           │    │                  └ <coroutine object Server.serve at 0x7f9f97ed80c0>
           │    └ <function BaseEventLoop.run_until_complete at 0x7f9f98202670>
           └ <_UnixSelectorEventLoop running=True closed=False debug=False>
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 634, in run_until_complete
    self.run_forever()
    │    └ <function BaseEventLoop.run_forever at 0x7f9f982025e0>
    └ <_UnixSelectorEventLoop running=True closed=False debug=False>
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 601, in run_forever
    self._run_once()
    │    └ <function BaseEventLoop._run_once at 0x7f9f98205160>
    └ <_UnixSelectorEventLoop running=True closed=False debug=False>
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1905, in _run_once
    handle._run()
    │      └ <function Handle._run at 0x7f9f982b3b80>
    └ <Handle <TaskStepMethWrapper object at 0x7f9f945f23a0>()>
> File "/usr/local/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
    │    │            │    │           │    └ <member '_args' of 'Handle' objects>
    │    │            │    │           └ <Handle <TaskStepMethWrapper object at 0x7f9f945f23a0>()>
    │    │            │    └ <member '_callback' of 'Handle' objects>
    │    │            └ <Handle <TaskStepMethWrapper object at 0x7f9f945f23a0>()>
    │    └ <member '_context' of 'Handle' objects>
    └ <Handle <TaskStepMethWrapper object at 0x7f9f945f23a0>()>

  File "/code/./app/main.py", line 152, in _initialize_lightning
    async for u in initialize_ln_repo():
                   └ <function initialize_ln_repo at 0x7f9f955ebf70>

  File "/code/./app/lightning/service.py", line 72, in initialize_ln_repo
    async for u in ln.initialize():
                   │  └ <function LnNodeLNDgRPC.initialize at 0x7f9f94da1e50>
                   └ <app.lightning.impl.lnd_grpc.LnNodeLNDgRPC object at 0x7f9f9558e430>

  File "/code/./app/lightning/impl/lnd_grpc.py", line 214, in initialize
    lnd_macaroon = config_get_hex_str(dconfig("lnd_macaroon"), name="lnd_macaroon")
                   │                  └ <decouple.AutoConfig object at 0x7f9f97de2f40>
                   └ <function config_get_hex_str at 0x7f9f96edfd30>

  File "/code/./app/api/utils.py", line 189, in config_get_hex_str
    raise ValueError(f"{name} is not a valid path")

ValueError: lnd_macaroon is not a valid path
@fusion44 fusion44 added bug Something isn't working LND Issues concerning LND only v0.7.0-beta labels Jul 9, 2023
@fusion44 fusion44 added this to the v0.7.0-beta milestone Jul 9, 2023
@fusion44 fusion44 changed the title bug: lnd grpc api remains in undefined state on given invalid macaroon path lnd grpc api remains in undefined state on given invalid macaroon path Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LND Issues concerning LND only v0.7.0-beta
Projects
None yet
Development

No branches or pull requests

1 participant