lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.67k stars 2.07k forks source link

Latest LND with Older Bitcoind (v0.18.1.0) #6430

Closed Ajeeshb closed 1 year ago

Ajeeshb commented 2 years ago

Background

After upgrading to the latest lnd version (from 0.11.1_beta to 0.14.2-Beta) My https url is not working (https://:10010)

Your environment

{"code":2,"message":"expected 1 macaroon, got 0","details":[]}

But the same worked fine with the lnd version 0.11.1-Beta

guggero commented 2 years ago

That error message has nothing to do with bitcoind. You need to send a macaroon when calling an lnd REST endpoint. Not sure why this worked before, how does your lnd config look like?

Ajeeshb commented 2 years ago

I am passing it as environment variables in docker-compose file.

NB: URL :: https://myip:16010/v1/getinfo is a self-signed SSL, There is no SSL provided.

services:
  lnd:
    image: lnd_image:0.14.2-Beta
    hostname: lnd
    restart: unless-stopped
    ports:
      - "$lnd_http:10010"
      - "$lnd_rpc:10009"
      - "$lnd_port:9735"
    volumes:
      - lnd-data:/root/.lnd/
    networks:
      - workspace
      - default
    environment:
      DEBUGLEVEL: debug
    command: lnd --maxpendingchannels=10 --alias=${project}_lnd_1 --tlsextradomain=mydomain.com --tlsextraip=mylocalIP --externalip=public_ip:$lnd_port --listen=0.0.0.0:9735 --tlscertpath=/root/.lnd/tls.cert  --adminmacaroonpath=/root/.lnd/admin.macaroon --readonlymacaroonpath=/root/.lnd/readonly.macaroon --invoicemacaroonpath=/root/.lnd/invoice.macaroon --rpclisten=0.0.0.0:10009 --restlisten=0.0.0.0:10010 --bitcoin.active --bitcoin.testnet --bitcoin.node=bitcoind --bitcoind.rpchost=bitcoin:18332 --bitcoind.rpcuser=user --bitcoind.rpcpass=pass --bitcoind.zmqpubrawblock=tcp://bitcoin:28332 --bitcoind.zmqpubrawtx=tcp://bitcoin:28333
networks:
guggero commented 2 years ago

As mentioned before, I don't know how this worked before without a macaroon. What's behind the port 16010? Is that some sort of proxy? Or is that the HTTP port directly? You need to add a custom header field with the macaroon, see https://github.com/lightningnetwork/lnd/blob/master/docs/macaroons.md#using-macaroons-with-grpc-clients. I don't think we changed anything with authentication between v0.11.x-beta and v0.14.x-beta. So this should also fail with the same error message on v0.11.x-beta. Or did you use the --no-macaroons flag before? (don't use that flag on mainnet, ever)

Ajeeshb commented 2 years ago

What's behind the port 16010? Is that some sort of proxy? Or is that the HTTP port directly?

HTTP port (10010) directly

Using an LND browser extension( Third-party) I am able to connect it before, where I can add my macaroon file.

Ajeeshb commented 2 years ago

Attached error for your reference.

Failed to connect to node
Request failed with the message "Internal Server Error"

If you're sure you've setup your node correctly, try clicking this link and making sure it loads correctly. If there are SSL errors, click "advanced" and proceed to accept the certificate.
Crypt-iQ commented 2 years ago

Maybe your deployment is specific to this later version of bitcoind, but I would highly recommend you upgrade to a more recent non-EOL version

Ajeeshb commented 2 years ago

@Crypt-iQ You mean the third-party browser extension deployment? Since I can log in into my LND container and execute "lnd getinfo" command working fine.

bash-5.1# lncli --macaroonpath=root/.lnd/admin.macaroon getinfo
{
    "version": "0.14.2-beta commit=v0.14.2-beta",
    "commit_hash": "1e5xxx9f",
    "identity_pubkey": "03a1xx6xx84",
    "alias": "six_lnd_1",
    "color": "#3399ff",
    "num_pending_channels": 0,
    "num_active_channels": 0,
    "num_inactive_channels": 0,
    "num_peers": 3,
    "block_height": 2196444,
    "block_hash": "00000xxxd31",
    "best_header_timestamp": "16xxx42011",
    "synced_to_chain": true,
    "synced_to_graph": true,
    "testnet": true,
    "chains": [
        {
            "chain": "bitcoin",
            "network": "testnet"
        }
    ],
    "uris": [
        "03a151xxxxx@ip:16735"
    ],