fusion44 / blitz_api

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

CLN Create invoice fails #128

Closed openoms closed 2 years ago

openoms commented 2 years ago

This is when I deleted all payments so the transaction list works.

Logs:

Jun 30 17:22:07 z420 python[483552]: ERROR:uvicorn.error:Exception in ASGI application
Jun 30 17:22:07 z420 python[483552]: Traceback (most recent call last):
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/uvicorn/protocols/http/h11_impl.py", line 366, in run_asgi
Jun 30 17:22:07 z420 python[483552]:     result = await app(self.scope, self.receive, self.send)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
Jun 30 17:22:07 z420 python[483552]:     return await self.app(scope, receive, send)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/applications.py", line 269, in __call__
Jun 30 17:22:07 z420 python[483552]:     await super().__call__(scope, receive, send)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/applications.py", line 124, in __call__
Jun 30 17:22:07 z420 python[483552]:     await self.middleware_stack(scope, receive, send)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 184, in __call__
Jun 30 17:22:07 z420 python[483552]:     raise exc
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 162, in __call__
Jun 30 17:22:07 z420 python[483552]:     await self.app(scope, receive, _send)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/cors.py", line 92, in __call__
Jun 30 17:22:07 z420 python[483552]:     await self.simple_response(scope, receive, send, request_headers=headers)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/cors.py", line 147, in simple_response
Jun 30 17:22:07 z420 python[483552]:     await self.app(scope, receive, send)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 93, in __call__
Jun 30 17:22:07 z420 python[483552]:     raise exc
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 82, in __call__
Jun 30 17:22:07 z420 python[483552]:     await self.app(scope, receive, sender)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
Jun 30 17:22:07 z420 python[483552]:     raise e
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
Jun 30 17:22:07 z420 python[483552]:     await self.app(scope, receive, send)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 670, in __call__
Jun 30 17:22:07 z420 python[483552]:     await route.handle(scope, receive, send)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 418, in handle
Jun 30 17:22:07 z420 python[483552]:     await self.app(scope, receive, send)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/applications.py", line 269, in __call__
Jun 30 17:22:07 z420 python[483552]:     await super().__call__(scope, receive, send)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/applications.py", line 124, in __call__
Jun 30 17:22:07 z420 python[483552]:     await self.middleware_stack(scope, receive, send)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 184, in __call__
Jun 30 17:22:07 z420 python[483552]:     raise exc
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 162, in __call__
Jun 30 17:22:07 z420 python[483552]:     await self.app(scope, receive, _send)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 93, in __call__
Jun 30 17:22:07 z420 python[483552]:     raise exc
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 82, in __call__
Jun 30 17:22:07 z420 python[483552]:     await self.app(scope, receive, sender)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
Jun 30 17:22:07 z420 python[483552]:     raise e
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
Jun 30 17:22:07 z420 python[483552]:     await self.app(scope, receive, send)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 670, in __call__
Jun 30 17:22:07 z420 python[483552]:     await route.handle(scope, receive, send)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 266, in handle
Jun 30 17:22:07 z420 python[483552]:     await self.app(scope, receive, send)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 65, in app
Jun 30 17:22:07 z420 python[483552]:     response = await func(request)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 227, in app
Jun 30 17:22:07 z420 python[483552]:     raw_response = await run_endpoint_function(
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 160, in run_endpoint_function
Jun 30 17:22:07 z420 python[483552]:     return await dependant.call(**values)
Jun 30 17:22:07 z420 python[483552]:   File "./app/routers/lightning.py", line 75, in addinvoice
Jun 30 17:22:07 z420 python[483552]:     return await add_invoice(memo, value_msat, expiry, is_keysend)
Jun 30 17:22:07 z420 python[483552]:   File "./app/repositories/lightning.py", line 101, in add_invoice
Jun 30 17:22:07 z420 python[483552]:     return await ln.add_invoice_impl(memo, value_msat, expiry, is_keysend)
Jun 30 17:22:07 z420 python[483552]:   File "./app/repositories/ln_impl/cln_grpc.py", line 390, in add_invoice_impl
Jun 30 17:22:07 z420 python[483552]:     res = await _cln_stub.Invoice(req)
Jun 30 17:22:07 z420 python[483552]:   File "/usr/local/lib/python3.9/dist-packages/grpc/aio/_call.py", line 290, in __await__
Jun 30 17:22:07 z420 python[483552]:     raise _create_rpc_error(self._cython_call._initial_metadata,
Jun 30 17:22:07 z420 python[483552]: grpc.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:
Jun 30 17:22:07 z420 python[483552]:         status = StatusCode.CANCELLED
Jun 30 17:22:07 z420 python[483552]:         details = "Received RST_STREAM with error code 8"
Jun 30 17:22:07 z420 python[483552]:         debug_error_string = "{"created":"@1656606127.128679593","description":"Error received from peer ipv4:127.0.0.1:4772","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Received RST_STREAM with error code 8","grpc_status":1}"
Jun 30 17:22:07 z420 python[483552]: >
fusion44 commented 2 years ago

@openoms can you check if the CLN log shows any errors? As far as I can see Received RST_STREAM with error code 8 usually means that an error on the server occured.

openoms commented 2 years ago

Create Invoice now successful, but still takes a couple of seconds.

openoms commented 2 years ago

To test the issue with route hints have at least one private channel open and create invoice.

fusion44 commented 2 years ago

This should be fixed in main.

openoms commented 2 years ago

Creating invoice is now successful with my v0.12.0 CLN node with a private channels (so route hint added) as well