Ride-The-Lightning / RTL

Ride The Lightning - A full function web browser app for LND, C-Lightning and Eclair
MIT License
740 stars 159 forks source link

LND Config - Fetch Config Failed! #405

Closed danielhw2 closed 4 years ago

danielhw2 commented 4 years ago

Describe the bug

When I go to "Settings -> LND Config" I receive the following message:

Fetch Config Failed! Error Code 500 Error Message Unknown Error API URL ./api/conf/config/ln

To Reproduce Steps to reproduce the behavior:

  1. Open the RTL page;
  2. Click on Settings;
  3. Click on LND Config

MY ENVIRONMENT

My lnd.conf file

**My RTL-config.json file**
ShahanaFarooqui commented 4 years ago

@danielhw2 please share your RTL-config.json after masking sensitive information.

ShahanaFarooqui commented 4 years ago

The config looks fine and RTL should be able to fetch the file as long as:

Can you please check RTL logs for more information about the error?

danielhw2 commented 4 years ago

The config looks fine and RTL should be able to fetch the file as long as:

  • It is on the same machine where RTL server is running.
  • The file exists on the provided path.

Can you please check RTL logs for more information about the error?

Thank you very much for the reply... I'm running the browser in a different machine, I guess this is the problem then. However, It would be nice to edit the config file from anywhere...

Thanks for the help. =)

ShahanaFarooqui commented 4 years ago

Glad to be able to help. Also, we show local lnd/bitcoind config in ‘read only’ mode. We cannot allow layer 1 & 2 configurations to be updated from the UI for security purposes.

worthwhileindustries commented 1 year ago

I'm having the same issue after updating btcpay server 1.4 to 1.9 RTL - 0.13.6-beta when I go to node info and click config info tab...

Fetch Config Failed! Error Code 500 Error Message Reading Config Error API URL ./api/conf/config/ln

// logs

[4/16/2023, 1:02:02 AM] ERROR: RTLConf => Reading Config Error: {"statusCode":500,"message":"Reading Config Error","error":{"errno":-2,"code":"ENOENT","syscall":"open","path":"/root/.lnd/lnd.conf"}}
# cat /var/lib/docker/volumes/generated_lnd_bitcoin_rtl_datadir/_data/RTL-Config.json
{
  "multiPass": "password",
  "port": "3000",
  "defaultNodeIndex": 1,
  "SSO": {
    "rtlSSO": 0,
    "rtlCookiePath": "",
    "logoutRedirectLink": ""
  },
  "nodes": [
    {
      "index": 1,
      "lnNode": "Node 1",
      "lnImplementation": "LND",
      "Authentication": {
        "macaroonPath": "/root/.lnd/data/chain/bitcoin/mainnet",
        "configPath": "/root/.lnd/lnd.conf"
      },
      "Settings": {
        "userPersona": "MERCHANT",
        "themeMode": "DAY",
        "themeColor": "PURPLE",
        "channelBackupPath": "/root/backup/node-1",
        "lnServerUrl": "https://localhost:8080",
        "fiatConversion": false,
        "logLevel": "ERROR"
      }
    }
  ]
}
ShahanaFarooqui commented 1 year ago

The error ENOENT means "Error NO ENTity." It occurs when a program attempts to access a file or directory that does not exist. Can you confirm if a valid lnd.conf file exists at the location /root/.lnd?

worthwhileindustries commented 1 year ago

@ShahanaFarooqui Maybe something do do with docker-compose config not sharing the right dirs or something. It's here a the below path but, I'm not sure how they have the pathing configured here.

I get the same problem when I try to go to loop

Loop Not Connected Error Code 503 Error Message Unable to Connect to Loop Server API URL ./api/loop/swaps

// logs

[4/16/2023, 1:34:47 AM] ERROR: Loop => List Swaps Error: {"name":"RequestError","message":"Error: connect ECONNREFUSED 172.18.0.7:8081","cause":{"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"172.18.0.7","port":8081},"error":{"errno":-111,"code":"ECONNREFUSED","syscall":"connect","address":"172.18.0.7","port":8081},"options":{"url":"https://lnd_bitcoin:8081/v1/loop/swaps","rejectUnauthorized":false,"json":true,"headers":{},"simple":true,"resolveWithFullResponse":false,"transform2xxOnly":false}}
# ls -al /var/lib/docker/volumes/generated_lnd_bitcoin_datadir/_data/
total 44
drwxr-xr-x 5 root root 4096 Oct 11  2022 .
drwxr-xr-x 3 root root 4096 Mar 31  2021 ..
-rw------- 1 root root  280 Apr  6  2021 admin.macaroon
drwx------ 5 root root 4096 Feb  6  2022 data
-rw-r--r-- 1 root root  132 Apr  6  2021 invoice.macaroon
drwx------ 2 root root 4096 Feb  6  2022 letsencrypt
-rw-r--r-- 1 root root  813 Apr 15 23:23 lnd.conf
drwx------ 3 root root 4096 Apr  6  2021 logs
-rw-r--r-- 1 root root  199 Apr  6  2021 readonly.macaroon
-rw-r--r-- 1 root root  822 Oct 11  2022 tls.cert
-rw------- 1 root root  227 Oct 11  2022 tls.key
worthwhileindustries commented 1 year ago

@ShahanaFarooqui assuming it should show up here inside the container?

# docker exec -it generated_bitcoin_rtl_1 sh
/RTL # ls -al /root/
total 24
drwx------    1 root     root          4096 Apr 16 01:37 .
drwxr-xr-x    1 root     root          4096 Apr 15 22:31 ..
-rw-------    1 root     root            75 Apr 16 01:38 .ash_history
drwx------    4 root     root          4096 Feb 21 22:13 .gnupg
drwxr-xr-x    3 root     root          4096 Feb 21 22:13 .npm
drwxr-xr-x    3 root     root          4096 Apr 15 22:31 backup
worthwhileindustries commented 1 year ago

@ShahanaFarooqui dug a little deeper and looks like maybe it's btc server's config that is wrong?

I went here and it looks like maybe the paths aren't lined up

https://github.com/btcpayserver/btcpayserver-docker/blob/master/docker-compose-generator/docker-fragments/bitcoin-lnd.yml#L48

in the container I found the config here

/RTL # ls -al /etc/lnd
total 44
drwxr-xr-x    5 root     root          4096 Oct 11  2022 .
drwxr-xr-x    1 root     root          4096 Apr 15 22:31 ..
-rw-------    1 root     root           280 Apr  6  2021 admin.macaroon
drwx------    5 root     root          4096 Feb  6  2022 data
-rw-r--r--    1 root     root           132 Apr  6  2021 invoice.macaroon
drwx------    2 root     root          4096 Feb  6  2022 letsencrypt
-rw-r--r--    1 root     root           813 Apr 15 23:23 lnd.conf
drwx------    3 root     root          4096 Apr  6  2021 logs
-rw-r--r--    1 root     root           199 Apr  6  2021 readonly.macaroon
-rw-r--r--    1 root     root           822 Oct 11  2022 tls.cert
-rw-------    1 root     root           227 Oct 11  2022 tls.key
worthwhileindustries commented 1 year ago

@ShahanaFarooqui looks like maybe BTCPayServer updated the config but, then didn't have it update an existing config maybe... here the config shows /etc

https://github.com/btcpayserver/btcpayserver-doc/blob/b1432054e147836d7286e1bae2f98e62f2752363/docs/Deployment/ManualDeploymentExtended.md