fusion44 / blitz_api

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

CLN Pay invoice fails #129

Closed openoms closed 2 years ago

openoms commented 2 years ago

Again the node is used with all payments deleted to avoid #126

image

Logs:

Jun 30 18:11:00 z420 python[1992807]: Traceback (most recent call last):
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/uvicorn/protocols/http/h11_impl.py", line 366, in run_asgi
Jun 30 18:11:00 z420 python[1992807]:     result = await app(self.scope, self.receive, self.send)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
Jun 30 18:11:00 z420 python[1992807]:     return await self.app(scope, receive, send)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/applications.py", line 269, in __call__
Jun 30 18:11:00 z420 python[1992807]:     await super().__call__(scope, receive, send)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/applications.py", line 124, in __call__
Jun 30 18:11:00 z420 python[1992807]:     await self.middleware_stack(scope, receive, send)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 184, in __call__
Jun 30 18:11:00 z420 python[1992807]:     raise exc
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 162, in __call__
Jun 30 18:11:00 z420 python[1992807]:     await self.app(scope, receive, _send)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/cors.py", line 84, in __call__
Jun 30 18:11:00 z420 python[1992807]:     await self.app(scope, receive, send)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 93, in __call__
Jun 30 18:11:00 z420 python[1992807]:     raise exc
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 82, in __call__
Jun 30 18:11:00 z420 python[1992807]:     await self.app(scope, receive, sender)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
Jun 30 18:11:00 z420 python[1992807]:     raise e
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
Jun 30 18:11:00 z420 python[1992807]:     await self.app(scope, receive, send)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 670, in __call__
Jun 30 18:11:00 z420 python[1992807]:     await route.handle(scope, receive, send)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 418, in handle
Jun 30 18:11:00 z420 python[1992807]:     await self.app(scope, receive, send)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/applications.py", line 269, in __call__
Jun 30 18:11:00 z420 python[1992807]:     await super().__call__(scope, receive, send)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/applications.py", line 124, in __call__
Jun 30 18:11:00 z420 python[1992807]:     await self.middleware_stack(scope, receive, send)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 184, in __call__
Jun 30 18:11:00 z420 python[1992807]:     raise exc
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 162, in __call__
Jun 30 18:11:00 z420 python[1992807]:     await self.app(scope, receive, _send)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 93, in __call__
Jun 30 18:11:00 z420 python[1992807]:     raise exc
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 82, in __call__
Jun 30 18:11:00 z420 python[1992807]:     await self.app(scope, receive, sender)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
Jun 30 18:11:00 z420 python[1992807]:     raise e
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
Jun 30 18:11:00 z420 python[1992807]:     await self.app(scope, receive, send)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 670, in __call__
Jun 30 18:11:00 z420 python[1992807]:     await route.handle(scope, receive, send)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 266, in handle
Jun 30 18:11:00 z420 python[1992807]:     await self.app(scope, receive, send)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 65, in app
Jun 30 18:11:00 z420 python[1992807]:     response = await func(request)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 227, in app
Jun 30 18:11:00 z420 python[1992807]:     raw_response = await run_endpoint_function(
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 160, in run_endpoint_function
Jun 30 18:11:00 z420 python[1992807]:     return await dependant.call(**values)
Jun 30 18:11:00 z420 python[1992807]:   File "./app/routers/lightning.py", line 442, in get_decode_pay_request
Jun 30 18:11:00 z420 python[1992807]:     return await decode_pay_request(pay_req)
Jun 30 18:11:00 z420 python[1992807]:   File "./app/repositories/lightning.py", line 105, in decode_pay_request
Jun 30 18:11:00 z420 python[1992807]:     return await ln.decode_pay_request_impl(pay_req)
Jun 30 18:11:00 z420 python[1992807]:   File "./app/repositories/ln_impl/cln_grpc.py", line 426, in decode_pay_request_impl
Jun 30 18:11:00 z420 python[1992807]:     return PaymentRequest.from_cln_json(json.loads(decoded))
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
Jun 30 18:11:00 z420 python[1992807]:     return _default_decoder.decode(s)
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
Jun 30 18:11:00 z420 python[1992807]:     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
Jun 30 18:11:00 z420 python[1992807]:   File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
Jun 30 18:11:00 z420 python[1992807]:     raise JSONDecodeError("Expecting value", s, err.value) from None
Jun 30 18:11:00 z420 python[1992807]: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Jun 30 18:11:43 z420 python[1992807]: INFO:     127.0.0.1:49800 - "GET /lightning/list-all-tx?reversed=true HTTP/1.0" 200 OK
Jun 30 18:11:43 z420 python[1992807]: INFO:     127.0.0.1:49806 - "GET /lightning/list-all-tx?reversed=true HTTP/1.0" 200 OK
openoms commented 2 years ago

now there is an issue with decoding the time: image

₿ cl decode lnbc52u1p3tlkulpp5pcc6r7xqeuwmn5thpr8pz8zwukfe296de6zg54ljw0qym22gupmsdqqcqzpuxqyz5vqsp58c2cclrctq0sswdujsgj5zd6kvve3ekj9x4kn9a6aque388wn5qs9qyyssqe9mf2w3w05unjedzhqegav8h0u8f8l3cs5wmuftjd8y87h68cfrh86x3jwl6vhnl0hynnlmh6pypg0656phjjv6nh8pqy98ynx3rr8spwef0wf
{
   "type": "bolt11 invoice",
   "currency": "bc",
   "created_at": 1656740767,
   "expiry": 86400,
   "payee": "02fcc5bfc48e83f06c04483a2985e1c390cb0f35058baa875ad2053858b8e80dbd",
   "msatoshi": 5200000,
   "amount_msat": "5200000msat",
   "description": "",
   "min_final_cltv_expiry": 60,
   "payment_secret": "3e158c7c78581f0839bc94112a09bab31998e6d229ab6997bae839989cee9d01",
   "features": "024200",
   "payment_hash": "0e31a1f8c0cf1db9d17708ce111c4ee59395174dce848a57f273c04da948e077",
   "signature": "3045022100c976953a2e7d393965a2b8328eb0f77f0e93fe38851dbe257269c87f5f47c247022073e8d193bfa65e7f7dc939ff77d048143f54d06f293353b9c20214e499a2319e",
   "valid": true
}

During decode and after confirm an error re. hop hints:

Jul 02 06:47:33 raspberrypi python[39459]:     return PaymentRequest.from_cln_json(json.loads(decoded))
Jul 02 06:47:33 raspberrypi python[39459]:   File "./app/models/lightning.py", line 1503, in from_cln_json
Jul 02 06:47:33 raspberrypi python[39459]:     routes = [RouteHint.from_cln_json(rh) for rh in r["routes"]]
Jul 02 06:47:33 raspberrypi python[39459]:   File "./app/models/lightning.py", line 1503, in <listcomp>
Jul 02 06:47:33 raspberrypi python[39459]:     routes = [RouteHint.from_cln_json(rh) for rh in r["routes"]]
Jul 02 06:47:33 raspberrypi python[39459]:   File "./app/models/lightning.py", line 386, in from_cln_json
Jul 02 06:47:33 raspberrypi python[39459]:     hop_hints = [HopHint.from_cln_json(hh) for hh in h.hop_hints]
Jul 02 06:47:33 raspberrypi python[39459]: AttributeError: 'list' object has no attribute 'hop_hints'
Jul 02 06:47:34 raspberrypi python[39459]: INFO:     127.0.0.1:42494 - "GET /lightning/decode-pay-req?pay_req=lnbc52u1p3tlkulpp5pcc6r7xqeuwmn5thpr8pz8zwukfe296de6zg54ljw0qym22gupmsdqqcqzpuxqyz5vqsp58c2cclrctq0sswdujsgj5zd6kvve3ekj9x4kn9a6aque388wn5qs9qyyssqe9mf2w3w05unjedzhqegav8h0u8f8l3cs5wmuftjd8y87h68cfrh86x3jwl6vhnl0hynnlmh6pypg0656phjjv6nh8pqy98ynx3rr8spwef0wf HTTP/1.0" 200 OK

Still doesn't pay unfortunately.

cstenglein commented 2 years ago

Could be that it's an issue with the webui.

I'm using Date.now() to check the expiry of the invoice.

"created_at": 1656740767, is the timestamp in seconds

Current Date.now() delivers 1656838838500, which is the timestamp in milliseconds.

LND responds with milliseconds & CLN in seconds, that could be an additional issue.

Created https://github.com/cstenglein/raspiblitz-web/issues/373 for that

EDIT: was a different issue, but is fixed now

cstenglein commented 2 years ago

@openoms decoding should now work with current master of raspiblitz-web.

openoms commented 2 years ago

The date issue is fixed on latest, but got a new error when paying:

Jul 04 11:05:08 raspberrypi python[3056]: >
Jul 04 11:05:08 raspberrypi python[3056]: ERROR:uvicorn.error:Exception in ASGI application
Jul 04 11:05:08 raspberrypi python[3056]: Traceback (most recent call last):
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/uvicorn/protocols/http/h11_impl.py", line 366, in run_asgi
Jul 04 11:05:08 raspberrypi python[3056]:     result = await app(self.scope, self.receive, self.send)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     return await self.app(scope, receive, send)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/applications.py", line 269, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     await super().__call__(scope, receive, send)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/applications.py", line 124, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     await self.middleware_stack(scope, receive, send)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 184, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     raise exc
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 162, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     await self.app(scope, receive, _send)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/cors.py", line 92, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     await self.simple_response(scope, receive, send, request_headers=headers)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/cors.py", line 147, in simple_response
Jul 04 11:05:08 raspberrypi python[3056]:     await self.app(scope, receive, send)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 93, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     raise exc
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 82, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     await self.app(scope, receive, sender)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     raise e
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     await self.app(scope, receive, send)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 670, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     await route.handle(scope, receive, send)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 418, in handle
Jul 04 11:05:08 raspberrypi python[3056]:     await self.app(scope, receive, send)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/applications.py", line 269, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     await super().__call__(scope, receive, send)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/applications.py", line 124, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     await self.middleware_stack(scope, receive, send)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 184, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     raise exc
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 162, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     await self.app(scope, receive, _send)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 93, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     raise exc
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 82, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     await self.app(scope, receive, sender)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     raise e
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     await self.app(scope, receive, send)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 670, in __call__
Jul 04 11:05:08 raspberrypi python[3056]:     await route.handle(scope, receive, send)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 266, in handle
Jul 04 11:05:08 raspberrypi python[3056]:     await self.app(scope, receive, send)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 65, in app
Jul 04 11:05:08 raspberrypi python[3056]:     response = await func(request)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 227, in app
Jul 04 11:05:08 raspberrypi python[3056]:     raw_response = await run_endpoint_function(
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 160, in run_endpoint_function
Jul 04 11:05:08 raspberrypi python[3056]:     return await dependant.call(**values)
Jul 04 11:05:08 raspberrypi python[3056]:   File "./app/routers/lightning.py", line 386, in sendpayment
Jul 04 11:05:08 raspberrypi python[3056]:     return await send_payment(pay_req, timeout_seconds, fee_limit_msat, amount_msat)
Jul 04 11:05:08 raspberrypi python[3056]:   File "./app/repositories/lightning.py", line 124, in send_payment
Jul 04 11:05:08 raspberrypi python[3056]:     res = await ln.send_payment_impl(
Jul 04 11:05:08 raspberrypi python[3056]:   File "./app/repositories/ln_impl/cln_grpc.py", line 565, in send_payment_impl
Jul 04 11:05:08 raspberrypi python[3056]:     res = await _cln_stub.Pay(req)
Jul 04 11:05:08 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/grpc/aio/_call.py", line 290, in __await__
Jul 04 11:05:08 raspberrypi python[3056]:     raise _create_rpc_error(self._cython_call._initial_metadata,
Jul 04 11:05:08 raspberrypi python[3056]: grpc.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:
Jul 04 11:05:08 raspberrypi python[3056]:         status = StatusCode.UNKNOWN
Jul 04 11:05:08 raspberrypi python[3056]:         details = "Error calling method Pay: RpcError { code: Some(-32602), message: "msatoshi parameter unnecessary" }"
Jul 04 11:05:08 raspberrypi python[3056]:         debug_error_string = "{"created":"@1656929108.783191862","description":"Error received from peer ipv4:127.0.0.1:4772","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Error calling method Pay: RpcError { code: Some(-32602), message: "msatoshi parameter unnecessary" }","grpc_status":2}"
Jul 04 11:05:08 raspberrypi python[3056]: >
openoms commented 2 years ago

Also got another error if the invoice has a hop hint eg. from Muun: LNBC1350N1P3V9W3XPP5WJKWDSDHM9YD6MDXYER4NLS7GVGQXJ3Z7JUC6VHK6Z6ETDZA6QMQDQQCQZZGXQYZ5VQRZJQWNVUC0U4TXN35CAFC7W94GXVQ5P3CU9DD95F7HLRH0FVS46WPVHDS5NGYXNGDWJYGQQQQRYQQQQTHQQPYRZJQW8C7YFUTQQY3KZ8662FXUTJVEF7Q2UJSXTT45CSU0K688LKZU3LDS5NGYXNGDWJYGQQQQRYQQQQTHQQPYSP5NHH0Q0U2KZTTQPQY0EEFW7P5UG3ZLNSSJYSCD80HRCMRDUEDAADQ9QYPQSQWNY6Y0J9W6VCFR0QUTH6TF77974DC8N35TPQA9346VH6WGGR6G94VFEWGKV0R3XNS553NAJ2VK9Y4LYJ7TEURJ6J82H6NUC5KWULUUSQTEC90M

Jul 04 11:01:04 raspberrypi python[3056]: ERROR:uvicorn.error:Exception in ASGI application
Jul 04 11:01:04 raspberrypi python[3056]: Traceback (most recent call last):
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/uvicorn/protocols/http/h11_impl.py", line 366, in run_asgi
Jul 04 11:01:04 raspberrypi python[3056]:     result = await app(self.scope, self.receive, self.send)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     return await self.app(scope, receive, send)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/applications.py", line 269, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     await super().__call__(scope, receive, send)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/applications.py", line 124, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     await self.middleware_stack(scope, receive, send)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 184, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     raise exc
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 162, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     await self.app(scope, receive, _send)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/cors.py", line 84, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     await self.app(scope, receive, send)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 93, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     raise exc
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 82, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     await self.app(scope, receive, sender)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     raise e
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     await self.app(scope, receive, send)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 670, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     await route.handle(scope, receive, send)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 418, in handle
Jul 04 11:01:04 raspberrypi python[3056]:     await self.app(scope, receive, send)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/applications.py", line 269, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     await super().__call__(scope, receive, send)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/applications.py", line 124, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     await self.middleware_stack(scope, receive, send)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 184, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     raise exc
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 162, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     await self.app(scope, receive, _send)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 93, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     raise exc
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 82, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     await self.app(scope, receive, sender)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     raise e
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     await self.app(scope, receive, send)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 670, in __call__
Jul 04 11:01:04 raspberrypi python[3056]:     await route.handle(scope, receive, send)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 266, in handle
Jul 04 11:01:04 raspberrypi python[3056]:     await self.app(scope, receive, send)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 65, in app
Jul 04 11:01:04 raspberrypi python[3056]:     response = await func(request)
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 227, in app
Jul 04 11:01:04 raspberrypi python[3056]:     raw_response = await run_endpoint_function(
Jul 04 11:01:04 raspberrypi python[3056]:   File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 160, in run_endpoint_function
Jul 04 11:01:04 raspberrypi python[3056]:     return await dependant.call(**values)
Jul 04 11:01:04 raspberrypi python[3056]:   File "./app/routers/lightning.py", line 151, in list_all_tx_path
Jul 04 11:01:04 raspberrypi python[3056]:     return await list_all_tx(successful_only, index_offset, max_tx, reversed)
Jul 04 11:01:04 raspberrypi python[3056]:   File "./app/repositories/lightning.py", line 72, in list_all_tx
Jul 04 11:01:04 raspberrypi python[3056]:     return await ln.list_all_tx_impl(successful_only, index_offset, max_tx, reversed)
Jul 04 11:01:04 raspberrypi python[3056]:   File "./app/repositories/ln_impl/cln_grpc.py", line 229, in list_all_tx_impl
Jul 04 11:01:04 raspberrypi python[3056]:     pr = await decode_pay_request_impl(pay.bolt11)
Jul 04 11:01:04 raspberrypi python[3056]:   File "./app/repositories/ln_impl/cln_grpc.py", line 428, in decode_pay_request_impl
Jul 04 11:01:04 raspberrypi python[3056]:     return PaymentRequest.from_cln_json(json.loads(decoded))
Jul 04 11:01:04 raspberrypi python[3056]:   File "./app/models/lightning.py", line 1503, in from_cln_json
Jul 04 11:01:04 raspberrypi python[3056]:     routes = [RouteHint.from_cln_json(rh) for rh in r["routes"]]
Jul 04 11:01:04 raspberrypi python[3056]:   File "./app/models/lightning.py", line 1503, in <listcomp>
Jul 04 11:01:04 raspberrypi python[3056]:     routes = [RouteHint.from_cln_json(rh) for rh in r["routes"]]
Jul 04 11:01:04 raspberrypi python[3056]:   File "./app/models/lightning.py", line 386, in from_cln_json
Jul 04 11:01:04 raspberrypi python[3056]:     hop_hints = [HopHint.from_cln_json(hh) for hh in h.hop_hints]
Jul 04 11:01:04 raspberrypi python[3056]: AttributeError: 'list' object has no attribute 'hop_hints'
fusion44 commented 2 years ago

@openoms both issues should be fixed.

openoms commented 2 years ago

Good news! Was able to pay from the webUI, but the logs are still not very reassuring:

Jul 05 07:47:59 raspberrypi python[2450317]: ERROR:asyncio:Task exception was never retrieved                                                                                                                                                                                                                                                                              
Jul 05 07:47:59 raspberrypi python[2450317]: future: <Task finished name='Task-93' coro=<_handle_invoice_listener() done, defined at ./app/repositories/lightning.py:223> exception=<AioRpcError of RPC that terminated with:                                                                                                                                              
Jul 05 07:47:59 raspberrypi python[2450317]:         status = StatusCode.UNAVAILABLE                                                                                                                                                                                                                                                                                       
Jul 05 07:47:59 raspberrypi python[2450317]:         details = "Socket closed"            
Jul 05 07:47:59 raspberrypi python[2450317]:         debug_error_string = "{"created":"@1657003672.119296627","description":"Error received from peer ipv4:127.0.0.1:4772","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Socket closed","grpc_status":14}"                                                                                         
Jul 05 07:47:59 raspberrypi python[2450317]: >>                                           
Jul 05 07:47:59 raspberrypi python[2450317]: Traceback (most recent call last):                                                                                                      
Jul 05 07:47:59 raspberrypi python[2450317]:   File "./app/repositories/lightning.py", line 224, in _handle_invoice_listener                                                         
Jul 05 07:47:59 raspberrypi python[2450317]:     async for i in ln.listen_invoices():                                                                                                
Jul 05 07:47:59 raspberrypi python[2450317]:   File "./app/repositories/ln_impl/cln_grpc.py", line 629, in listen_invoices                                                           
Jul 05 07:47:59 raspberrypi python[2450317]:     i = await _cln_stub.WaitAnyInvoice(req)                                                                                             
Jul 05 07:47:59 raspberrypi python[2450317]:   File "/usr/local/lib/python3.9/dist-packages/grpc/aio/_call.py", line 290, in __await__                                               
Jul 05 07:47:59 raspberrypi python[2450317]:     raise _create_rpc_error(self._cython_call._initial_metadata,                                                                        
Jul 05 07:47:59 raspberrypi python[2450317]: grpc.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:                                                                   
Jul 05 07:47:59 raspberrypi python[2450317]:         status = StatusCode.UNAVAILABLE                                                                                                 
Jul 05 07:47:59 raspberrypi python[2450317]:         details = "Socket closed"            
Jul 05 07:47:59 raspberrypi python[2450317]:         debug_error_string = "{"created":"@1657003672.119296627","description":"Error received from peer ipv4:127.0.0.1:4772","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Socket closed","grpc_status":14}"                                                                                         
Jul 05 07:47:59 raspberrypi python[2450317]: >                                            
Jul 05 07:47:59 raspberrypi python[2450317]: INFO:     127.0.0.1:57866 - "POST /lightning/send-payment?pay_req=lnbc1p3v8hn5pp5ag56vn07t5puh775vyrl8xvq420jzffanw08re7hkf6mqcx5m9yqdqqcqzpuxqyz5vqsp5g5n5pkjgnmutcyjrgydm3vd2aa98wdy8rpajyy0yzde886nljl0s9qyyssq204yuhzdle45gpx0mjaaye285sld8pqhvrkpaj4u46mz08apav8k2qucnprp0grlxtaramn6ts88j2qfpndfwcy6uvp04svymvcsdhgq7857qn&amount_msat=10 HTTP/1.0" 500 Internal Server Error                                     
Jul 05 07:47:59 raspberrypi python[2450317]: INFO:     127.0.0.1:57868 - "POST /lightning/send-payment?pay_req=lnbc1p3v8hn5pp5ag56vn07t5puh775vyrl8xvq420jzffanw08re7hkf6mqcx5m9yqdqqcqzpuxqyz5vqsp5g5n5pkjgnmutcyjrgydm3vd2aa98wdy8rpajyy0yzde886nljl0s9qyyssq204yuhzdle45gpx0mjaaye285sld8pqhvrkpaj4u46mz08apav8k2qucnprp0grlxtaramn6ts88j2qfpndfwcy6uvp04svymvcsdhgq7857qn&amount_msat=10 HTTP/1.0" 500 Internal Server Error                                     
Jul 05 07:47:59 raspberrypi python[2450317]: INFO:     127.0.0.1:57870 - "POST /lightning/send-payment?pay_req=lnbc1p3v8hn5pp5ag56vn07t5puh775vyrl8xvq420jzffanw08re7hkf6mqcx5m9yqdqqcqzpuxqyz5vqsp5g5n5pkjgnmutcyjrgydm3vd2aa98wdy8rpajyy0yzde886nljl0s9qyyssq204yuhzdle45gpx0mjaaye285sld8pqhvrkpaj4u46mz08apav8k2qucnprp0grlxtaramn6ts88j2qfpndfwcy6uvp04svymvcsdhgq7857qn&amount_msat=10 HTTP/1.0" 500 Internal Server Error                                     
Jul 05 07:47:59 raspberrypi python[2450317]: ERROR:asyncio:Task exception was never retrieved                                                                                        
Jul 05 07:47:59 raspberrypi python[2450317]: future: <Task finished name='Task-94' coro=<_handle_forward_event_listener() done, defined at ./app/repositories/lightning.py:233> exception=<AioRpcError of RPC that terminated with:                                                                                                                                        
Jul 05 07:47:59 raspberrypi python[2450317]:         status = StatusCode.UNAVAILABLE                                                                                                 
Jul 05 07:47:59 raspberrypi python[2450317]:         details = "Socket closed"            
Jul 05 07:47:59 raspberrypi python[2450317]:         debug_error_string = "{"created":"@1657003672.119519089","description":"Error received from peer ipv4:127.0.0.1:4772","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Socket closed","grpc_status":14}"                                                                                         
Jul 05 07:47:59 raspberrypi python[2450317]: >>                                           
Jul 05 07:47:59 raspberrypi python[2450317]: Traceback (most recent call last):                                                                                                      
Jul 05 07:47:59 raspberrypi python[2450317]:   File "./app/repositories/lightning.py", line 253, in _handle_forward_event_listener                                                   
Jul 05 07:47:59 raspberrypi python[2450317]:     async for i in ln.listen_forward_events():                                                                                          
Jul 05 07:47:59 raspberrypi python[2450317]:   File "./app/repositories/ln_impl/cln_grpc.py", line 650, in listen_forward_events                                                     
Jul 05 07:47:59 raspberrypi python[2450317]:     res = await _cln_stub.ListForwards(req)                                                                                             
Jul 05 07:47:59 raspberrypi python[2450317]:   File "/usr/local/lib/python3.9/dist-packages/grpc/aio/_call.py", line 290, in __await__                                               
Jul 05 07:47:59 raspberrypi python[2450317]:     raise _create_rpc_error(self._cython_call._initial_metadata,                                                                        
Jul 05 07:47:59 raspberrypi python[2450317]: grpc.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:                                                                   
Jul 05 07:47:59 raspberrypi python[2450317]:         status = StatusCode.UNAVAILABLE                                                                                                 
Jul 05 07:47:59 raspberrypi python[2450317]:         details = "Socket closed"            
Jul 05 07:47:59 raspberrypi python[2450317]:         debug_error_string = "{"created":"@1657003672.119519089","description":"Error received from peer ipv4:127.0.0.1:4772","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Socket closed","grpc_status":14}"                                                                                         
Jul 05 07:47:59 raspberrypi python[2450317]: >                                            
Jul 05 07:47:59 raspberrypi python[2450317]: INFO:     127.0.0.1:57874 - "POST /lightning/send-payment?pay_req=lnbc1p3v8hn5pp5ag56vn07t5puh775vyrl8xvq420jzffanw08re7hkf6mqcx5m9yqdqqcqzpuxqyz5vqsp5g5n5pkjgnmutcyjrgydm3vd2aa98wdy8rpajyy0yzde886nljl0s9qyyssq204yuhzdle45gpx0mjaaye285sld8pqhvrkpaj4u46mz08apav8k2qucnprp0grlxtaramn6ts88j2qfpndfwcy6uvp04svymvcsdhgq7857qn&amount_msat=10 HTTP/1.0" 500 Internal Server Error                                     
Jul 05 07:47:59 raspberrypi python[2450317]: ERROR:asyncio:Task exception was never retrieved                                                                                        
Jul 05 07:47:59 raspberrypi python[2450317]: future: <Task finished name='Task-92' coro=<_handle_info_listener() done, defined at ./app/repositories/lightning.py:204> exception=<AioRpcError of RPC that terminated with:                                                                                                                                                 
Jul 05 07:47:59 raspberrypi python[2450317]:         status = StatusCode.UNAVAILABLE                                                                                                 
Jul 05 07:47:59 raspberrypi python[2450317]:         details = "Socket closed"            
Jul 05 07:47:59 raspberrypi python[2450317]:         debug_error_string = "{"created":"@1657003672.119549237","description":"Error received from peer ipv4:127.0.0.1:4772","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Socket closed","grpc_status":14}"                                                                                         
Jul 05 07:47:59 raspberrypi python[2450317]: >>                                           
Jul 05 07:47:59 raspberrypi python[2450317]: Traceback (most recent call last):                                                                                                      
Jul 05 07:47:59 raspberrypi python[2450317]:   File "./app/repositories/lightning.py", line 208, in _handle_info_listener                                                            
Jul 05 07:47:59 raspberrypi python[2450317]:     info = await ln.get_ln_info_impl()                                                                                                  
Jul 05 07:47:59 raspberrypi python[2450317]:   File "./app/repositories/ln_impl/cln_grpc.py", line 600, in get_ln_info_impl                                                          
Jul 05 07:47:59 raspberrypi python[2450317]:     res = await _cln_stub.Getinfo(req)                                                                                                  
Jul 05 07:47:59 raspberrypi python[2450317]:   File "/usr/local/lib/python3.9/dist-packages/grpc/aio/_call.py", line 290, in __await__                                               
Jul 05 07:47:59 raspberrypi python[2450317]:     raise _create_rpc_error(self._cython_call._initial_metadata,                                                                        
Jul 05 07:47:59 raspberrypi python[2450317]: grpc.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:                                                                   
Jul 05 07:47:59 raspberrypi python[2450317]:         status = StatusCode.UNAVAILABLE                                                                                                 
Jul 05 07:47:59 raspberrypi python[2450317]:         details = "Socket closed"            
Jul 05 07:47:59 raspberrypi python[2450317]:         debug_error_string = "{"created":"@1657003672.119549237","description":"Error received from peer ipv4:127.0.0.1:4772","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Socket closed","grpc_status":14}"                                                                                         
Jul 05 07:47:59 raspberrypi python[2450317]: >                                            
Jul 05 07:47:59 raspberrypi python[2450317]: INFO:     127.0.0.1:57872 - "GET /lightning/list-all-tx?reversed=true HTTP/1.0" 500 Internal Server Error 

EDIT: this was probably the result of clicking the Send button multiple times and did not occur with the next attempt. Will likely be solved with #125

openoms commented 2 years ago

Was early to say. If I create a $0.01 invoice on https://ln.bitcoinbeach.com/openoms?amount=0.01&currency=USD it fails to pay failing to decode the description (same as in https://github.com/fusion44/blitz_api/issues/125#issuecomment-1174680062):

Jul 05 08:47:09 raspberrypi python[2450317]:   File "./app/repositories/ln_impl/cln_grpc.py", line 229, in list_all_tx_impl
Jul 05 08:47:09 raspberrypi python[2450317]:     pr = await decode_pay_request_impl(pay.bolt11)
Jul 05 08:47:09 raspberrypi python[2450317]:   File "./app/repositories/ln_impl/cln_grpc.py", line 428, in decode_pay_request_impl
Jul 05 08:47:09 raspberrypi python[2450317]:     return PaymentRequest.from_cln_json(json.loads(decoded))
Jul 05 08:47:09 raspberrypi python[2450317]:   File "./app/models/lightning.py", line 1523, in from_cln_json
Jul 05 08:47:09 raspberrypi python[2450317]:     description=r["description"],
Jul 05 08:47:09 raspberrypi python[2450317]: KeyError: 'description'

Testnet: https://pay.staging.galoy.io/test?amount=0.01&currency=USD

openoms commented 2 years ago

ok, decoding and paying an invoice is successful now on my v0.12.0 CLN node