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

LNURLp issue with Phoenixd backend by bitcarrot #2478

Open
Funman2 opened this issue May 8, 2024 · 8 comments
Open

LNURLp issue with Phoenixd backend by bitcarrot #2478

Funman2 opened this issue May 8, 2024 · 8 comments

Comments

@Funman2
Copy link

Funman2 commented May 8, 2024

When using the new lnbits integration by bitcarrot https://github.com/bitkarrot/lnbits-phoenixd the Lnurlp extension in lnbits does not work. I guess this is due to phoenixd inability to process Lnurl strings or could it be something else?

Alby for instance opens the pay string, but when trying to pay i get an error message:
grafik

@DoktorShift
Copy link

I can sign this.

I tested a few extensions with my phoenixd backed lnbits. LNURLp seems to be not working. See here.

bitkarrot/lnbits-phoenixd#1

@Funman2
Copy link
Author

Funman2 commented May 8, 2024

here are my error messages from container logs:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in call

await self.app(scope, receive, _send)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 191, in call

response = await self.dispatch_func(request, call_next)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/slowapi/middleware.py", line 136, in dispatch

response = await call_next(request)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 165, in call_next

raise app_exc

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 151, in coro

await self.app(scope, receive_or_disconnect, send_no_error)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 191, in call

response = await self.dispatch_func(request, call_next)

File "/app/lnbits/middleware.py", line 215, in block_allow_ip_middleware

return await call_next(request)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 165, in call_next

raise app_exc

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 151, in coro

await self.app(scope, receive_or_disconnect, send_no_error)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 191, in call

response = await self.dispatch_func(request, call_next)

File "/app/lnbits/middleware.py", line 215, in block_allow_ip_middleware

return await call_next(request)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 165, in call_next

raise app_exc

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 151, in coro

await self.app(scope, receive_or_disconnect, send_no_error)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 191, in call

response = await self.dispatch_func(request, call_next)

File "/app/lnbits/middleware.py", line 230, in first_install_middleware

return await call_next(request)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 165, in call_next

raise app_exc

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 151, in coro

await self.app(scope, receive_or_disconnect, send_no_error)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 191, in call

response = await self.dispatch_func(request, call_next)

File "/app/lnbits/middleware.py", line 230, in first_install_middleware

return await call_next(request)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 165, in call_next

raise app_exc

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 151, in coro

await self.app(scope, receive_or_disconnect, send_no_error)

File "/app/lnbits/middleware.py", line 125, in call

await self.app(scope, receive, send)

File "/app/lnbits/middleware.py", line 61, in call

await self.app(scope, receive, send)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/sessions.py", line 83, in call

await self.app(scope, receive, send_wrapper)

File "/app/lnbits/middleware.py", line 104, in call

await super().__call__(scope, receive, send)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 24, in call

await responder(scope, receive, send)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 44, in call

await self.app(scope, receive, self.send_with_gzip)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/cors.py", line 83, in call

await self.app(scope, receive, send)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 62, in call

await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app

raise exc

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app

await app(scope, receive, sender)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 758, in call

await self.middleware_stack(scope, receive, send)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 778, in app

await route.handle(scope, receive, send)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 299, in handle

await self.app(scope, receive, send)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 79, in app

await wrap_app_handling_exceptions(app, request)(scope, receive, send)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app

raise exc

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app

await app(scope, receive, sender)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 74, in app

response = await func(request)

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/fastapi/routing.py", line 299, in app

raise e

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/fastapi/routing.py", line 294, in app

raw_response = await run_endpoint_function(

File "/root/.cache/pypoetry/virtualenvs/lnbits-9TtSrW0h-py3.10/lib/python3.10/site-packages/fastapi/routing.py", line 191, in run_endpoint_function

return await dependant.call(**values)

File "/app/lnbits/extensions/lnurlp/lnurl.py", line 91, in api_lnurl_callback

payment_hash, payment_request = await create_invoice(

File "/app/lnbits/core/services.py", line 154, in create_invoice

) = await funding_source.create_invoice(

File "/app/lnbits/wallets/phoenixd.py", line 91, in create_invoice

raise UnsupportedError("description_hash")

lnbits.wallets.base.UnsupportedError: description_hash

2024-05-08 07:34:04.81 | ERROR | Exception: description_hash

2024-05-08 07:34:04.81 | INFO | 31.19.129.130:0 - "GET /lnurlp/api/v1/lnurl/cb/nzdP83?amount=1000&comment=test HTTP/1.1" 500

2024-05-08 07:34:04.81 | ERROR | Exception in ASGI application

2024-05-08 07:34:06.16 | INFO | 31.19.129.130:0 - "GET /lnurlp/api/v1/links?all_wallets=true HTTP/1.1" 200

2024-05-08 07:34:26.12 | INFO | 31.19.129.130:0 - "GET /lnurlp/api/v1/links?all_wallets=true HTTP/1.1" 200

@Bashy
Copy link
Contributor

Bashy commented May 11, 2024

in lnbits/wallets/phoenixd.py

        if description_hash or unhashed_description:
            raise UnsupportedError("description_hash")

Commenting those 2 lines seems to solve the problem, but this might need further tests.

@bitkarrot
Copy link
Contributor

ACINQ/phoenixd#47

@bitkarrot
Copy link
Contributor

ACINQ/phoenixd#50

@Funman2
Copy link
Author

Funman2 commented May 14, 2024

Thanks. Great to see progress is beeing made!

@Funman2
Copy link
Author

Funman2 commented May 16, 2024

bitkarrot/lnbits-phoenixd#1 (comment)

still this Error is logs:
File "/app/lnbits/wallets/phoenixd.py", line 91, in create_invoice

raise UnsupportedError("description_hash")

lnbits.wallets.base.UnsupportedError: description_hash

2024-05-16 19:10:37.48 | ERROR | Exception: description_hash

2024-05-16 19:10:37.48 | INFO | 31.19.129.130:0 - "GET /lnurlp/api/v1/lnurl/cb/6h9JAb?amount=21000&comment= HTTP/1.1" 500

2024-05-16 19:10:37.48 | ERROR | Exception in ASGI application

2024-05-16 19:10:41.80 | INFO | 31.19.129.130:0 - "GET /lnurlp/api/v1/links?all_wallets=true HTTP/1.1" 200

2024-05-16 19:11:01.81 | INFO | 31.19.129.130:0 - "GET /lnurlp/api/v1/links?all_wallets=true HTTP/1.1" 200

@Funman2
Copy link
Author

Funman2 commented May 17, 2024

Can solve the issue when replacing phoenix.py in lnbits/wallets with this file:

https://github.com/lnbits/lnbits/blob/11ba5955792fc9dce71387f67c6d9ae45d1d2832/lnbits/wallets/phoenixd.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants