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

Permissions error on some methods #60

Closed
vafanassieff opened this issue Aug 25, 2022 · 4 comments · Fixed by lightninglabs/lightning-terminal#413
Closed

Permissions error on some methods #60

vafanassieff opened this issue Aug 25, 2022 · 4 comments · Fixed by lightninglabs/lightning-terminal#413
Assignees

Comments

@vafanassieff
Copy link
Contributor

vafanassieff commented Aug 25, 2022

Hey ! Having issue with permissions ?

I did use an Admin session on LIT, some methods are working as intended (like lnc.lnd.lightning.sendPaymentSync) and other not like lnc.lnd.router.sendPaymentV2 or lnc.lnd.signer.signMessage

All of this on my dev setup, bitcoin is on regtest.

Framework: vue3@latest
Bundler: vite@latest
LNC version : 0.1.11-alpha.1
LND version 0.15.0-beta
LIT version 0.7.1-alpha

    await lnc.lnd.router.sendPaymentV2(
      { paymentRequest },
      (event) => console.log(event),
      (error) => console.error(error)
    )

Browser logs

2022-08-25 17:59:34.674 [INF] WASM: Calling 'routerrpc.Router.SendPaymentV2' on RPC with request {"paymentRequest":"lnbcrt1m1p3s08rxpp5p5ccyxfw86ws87cwvvwllq0uyqprvflq3drm3he3cl5lfe823gcsdqaf38zqntpwf4k2arnypzx2ur0wd5hgcqzpgxqzz6rzjqwyq6zjle9mq9myzr4lupcm75f3552qe7xygq6nk7hn57cmqy4w3gqqpjgqqqqgqqqqqqfcsqqqqqqgq9qsp5kjww4wahx6fcqq7qtqx0wwuguxd8n2t9h0g6gfxwvmlzs64cnmyq9qyyssqwem9mkkapvt8cvjwmeum4ee6utt60qvg4hfvqckue6zrmyzypqsnkwxadmysyrfpj4n5qdeau0gj7yarmmwrys84v066va00ldpc0gcqs7r356"} [index.js:2:928](/node_modules/.pnpm/registry.npmjs.org+@[email protected]/node_modules/@lightninglabs/lnc-web/dist/index.js)
Error: rpc error: code = Unknown desc = /routerrpc.Router/SendPaymentV2: unknown permissions required for method
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:3428
    valueInvoke index.js:2
    _resume index.js:2
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:295
    valueCall index.js:2
    _resume index.js:2
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:295
    valueCall index.js:2
    _resume index.js:2
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:295
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:3384
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:3297
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:3306
    a2 index.js:2
    promise callback*s2 index.js:2
    a2 index.js:2
    promise callback*s2 index.js:2
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:3244
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:3223
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:3373
    login index.js:66
    loginWithLnc lightning-node-connect.vue:84
    1 lightning-node-connect.vue:12

Browser logs (lnc.lnd.signer.signMessage)

2022-08-25 18:07:27.999 [INF] WASM: Calling 'signrpc.Signer.SignMessage' on RPC with request {"msg":"dG90bw=="} [index.js:2:928](/node_modules/.pnpm/registry.npmjs.org+@[email protected]/node_modules/@lightninglabs/lnc-web/dist/index.js)
Error: rpc error: code = Unknown desc = /signrpc.Signer/SignMessage: unknown permissions required for method
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:3415
    valueInvoke index.js:2
    _resume index.js:2
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:295
    valueCall index.js:2
    _resume index.js:2
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:295
    valueCall index.js:2
    _resume index.js:2
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:295
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:3384
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:3297
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:3306
    a2 index.js:2
    promise callback*s2 index.js:2
    a2 index.js:2
    promise callback*s2 index.js:2
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:3244
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:3223
    ../../node_modules/.pnpm/registry.npmjs.org+ @lightninglabs_lnc-web.js:3373
    login index.js:66
    loginWithLnc lightning-node-connect.vue:84
    1 lightning-node-connect.vue:12
)
@vafanassieff vafanassieff changed the title Error on some method Permissions error on some methods Aug 25, 2022
@kaloudis
Copy link
Contributor

Was able to recreate on mainnet

@kaloudis
Copy link
Contributor

kaloudis commented Aug 25, 2022

Hitting the same issue with /routerrpc.Router/GetMissionControlConfig - might be an issue with all router and signer routes

Update: invoices routes seem to be affected too

Error: rpc error: code = Unknown desc = /invoicesrpc.Invoices/AddHoldInvoice: unknown permissions required for method

@vafanassieff
Copy link
Contributor Author

So far, I'm using without issue :

  • lnd.lightning.sendPaymentSync
  • lnd.lightning.addInvoice
  • lnd.lightning.getInfo
  • lnd.lightning.signMessage

@ellemouton
Copy link
Member

cool yeah. looks like currently only LND's main server perms are added to the macaroon. Will need to make a change in LND to export those perms and then add them to the baked macaroon on the Litd side. Will start on this tomorrow 👍

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

Successfully merging a pull request may close this issue.

3 participants