Getting an error when trying to save the invoice_key (which shouldn't even be required when one has the admin_key, right??) in the wallet attach screen:
failed to create test invoice: Unable to connect to http://lnbits-phoenixd-phoenixd-1:9740
My LNbits' funding source is configured to use a local dockerized phoenixd with container name lnbits-phoenixd-phoenixd-1, and for some reason SN is trying to access the local address when I press Save. It should use the Lnbits Create invoice POST api request... which I can confirm works just find with the Invoice key.
curl -X POST https://lnbits.mydomain.tld/api/v1/payments -d '{"out": false, "amount": 1000, "memo":"testtest"}' -H "X-Api-Key: <my_invoice_key>" -H "Content-type: application/json"
That’s the error lnbits is returning to us. There’s no way we would know the local host name
reply
but how come that the curl Create Invoice API call works just fine?
curl -X POST https://lnbits.mydomain.tld/api/v1/payments -d '{"out": false, "amount": 1000, "memo":"testtest"}' -H "X-Api-Key: <my_invoice_key>" -H "Content-type: application/json"
reply
0 sats \ 1 reply \ @ek 16 Aug
Does this error happen consistently with SN?
failed to create test invoice: Unable to connect to http://lnbits-phoenixd-phoenixd-1:9740
Afaict, we tried the domain you provided us (lnbits.mydomain.tld) but LNbits returned this error. Maybe it wasn't able to reach the container when it tried but it would work on retries?
reply

The container must have reachable as it is running next to the Lnbits container, and I tried the curl command literally a few secs later, successfully.

That said, I went through the process again just now - and it magically works now. I can save the incoice key, without error message. Weird. but at least it works
reply
Can you try specifying the amount in msats?
curl -X POST https://lnbits.mydomain.tld/api/v1/payments -d '{"out": false, "amount": 1000, "unit": "msat", "memo":"testtest"}' -H "X-Api-Key: <my_invoice_key>" -H "Content-type: application/json"
reply
It does work in the sense that it returns a proper BOLT11 invoice, But LNBits seems to convert msat -> sat incorrectly. 10000msat becomes a 100sat invoice amount (should be 10sats).
It's still not an explanation for the OP error message
reply
It appears that msat is not a valid unit for LNBits, but instead of throwing an error, they just divide amount by 100.
I raised this issue: https://github.com/lnbits/lnbits/issues/2642 Let's see what they respond.
reply
In the meantime we stopped using msats for lnbits if you want to give it a shot.
reply
0 sats \ 0 replies \ @ek 16 Aug
which shouldn't even be required when one has the admin_key, right??
Yes, but we store the admin key in your browser and the invoice key on the server since that's where we coordinate autowithdrawals and p2p zaps. We don't want to store spending permissions on the server so we need something restricted to receives for the server.
reply