lightninglabs / lightning-terminal

Lightning Terminal: Your Home for Lightning Liquidity
MIT License
488 stars 82 forks source link

DockerContainer :8443 only shows Whitescreen, please help #706

Closed weltitob closed 5 months ago

weltitob commented 5 months ago

Hello, I'm currently trying to develop an app using some of the capabilities of lightning terminal, but I encountered some issues trying to setup Dockercontainers

The console output on :8443 I encounter: image

Other than that I can only see a whitescreen. But when I inspect the error logs further and click on one of the urls I can see a html dom looking like this:

<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8"/>
        <link rel="icon" href="/lit/icons/favicon-32x32.png"/>
        <meta name="theme-color" content="#000000"/>
        <link rel="apple-touch-icon" sizes="48x48" href="/lit/icons/icon-48x48.png"/>
        <link rel="apple-touch-icon" sizes="72x72" href="/lit/icons/icon-72x72.png"/>
        <link rel="apple-touch-icon" sizes="96x96" href="/lit/icons/icon-96x96.png"/>
        <link rel="apple-touch-icon" sizes="144x144" href="/lit/icons/icon-144x144.png"/>
        <link rel="apple-touch-icon" sizes="192x192" href="/lit/icons/icon-192x192.png"/>
        <link rel="apple-touch-icon" sizes="256x256" href="/lit/icons/icon-256x256.png"/>
        <link rel="apple-touch-icon" sizes="384x384" href="/lit/icons/icon-384x384.png"/>
        <link rel="apple-touch-icon" sizes="512x512" href="/lit/icons/icon-512x512.png"/>
        <link rel="manifest" href="/lit/manifest.json"/>
        <title>Lightning Terminal</title>
        <script defer="defer" src="/lit/static/js/main.309413a5.js"></script>
        <link href="/lit/static/css/main.9b54e640.css" rel="stylesheet">
    </head>
    <body>
        <noscript>You need to enable JavaScript to run this app.</noscript>
        <div id="root"></div>
    </body>
</html>

As you can see it seems to be an issue related to javascript. I also seem to miss the lnd folder. Do I need to import it myself into the docker containers or smth?

My current Docker Setup: I run the newest Dockerversion: lightninglabs/lightning-terminal:v0.12.2-alpha-path-prefix

Enabled Portforwarding for 8443, 10002, 9735

Docker Container has a wallet_password file and a preconfigured litd.conf looking like this:

httpslisten=0.0.0.0:8443
uipassword=i__hate..passwords!!
tlscertpath=~/.lit/tls.cert
tlskeypath=~/.lit/tls.key
lnd-mode=integrated
network=mainnet

lnd.lnddir=~/.lnd
lnd.alias=BitNet
lnd.rpclisten=0.0.0.0:10009
lnd.listen=0.0.0.0:9735
#lnd.debuglevel=debug

lnd.bitcoin.node=neutrino
lnd.feeurl = https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json

lnd.wallet-unlock-allow-create=true
lnd.wallet-unlock-password-file=~/.lit/wallet_password

lnd.bitcoind.rpchost=localhost
lnd.bitcoind.rpcuser=testnetuser
lnd.bitcoind.rpcpass=testnetpw
lnd.bitcoind.zmqpubrawblock=localhost:28332
lnd.bitcoind.zmqpubrawtx=localhost:28333

loop.loopoutmaxparts=5

pool.newnodesonly=true

faraday.min_monitored=48h

faraday.connect_bitcoin=true
faraday.bitcoin.host=localhost
faraday.bitcoin.user=testnetuser
faraday.bitcoin.password=testnetpw

I did also already use lncli create to create a wallet.

All litcli status shows running for all services. Other than that I didnt preconfigure anything for my docker container do I need to add some sort of lnd file or does anybody know what might be going on here?

ViktorTigerstrom commented 5 months ago

Hi @weltitob!

Thanks for reaching out and for the issue report!

Which browser are you using, and have you ensured that Javascript is enabled in the browser settings?

ViktorTigerstrom commented 5 months ago

Moving a comment from #707 over to this issue to keep the conversation under the same issue, see https://github.com/lightninglabs/lightning-terminal/issues/707#issue-2082746055.

My Code:


import base64, codecs, json, requests
import sys

REST_HOST = 'localhost:8443' #8443
MACAROON_PATH = './pythonfunctions/admin.macaroon'
TLS_PATH = './pythonfunctions/taproot_tls.cert'

url = f'https://{REST_HOST}/v1/taproot-assets/getinfo'
macaroon = codecs.encode(open(MACAROON_PATH, 'rb').read(), 'hex')
headers = {'Grpc-Metadata-macaroon': macaroon}
response = requests.get(url, headers=headers, verify=TLS_PATH)

if response.status_code == 200:
    try:
        data = response.json()
        print(data)  # Print the parsed JSON data
        # process data
    except json.JSONDecodeError:
        # Handle JSON decode error
        print("Response is not in JSON format:", response.text)
else:
    # Handle HTTP error
    print("Error:", response.status_code, response.text)

My Error message: Response is not in JSON format: <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/icons/favicon-32x32.png"/><meta name="theme-color" content="#000000"/><link rel="apple-touch-icon" sizes="48x48" href="/icons/icon-48x48.png"/><link rel="apple-touch-icon" sizes="72x72" href="/icons/icon-72x72.png"/><link rel="apple-touch-icon" sizes="96x96" href="/icons/icon-96x96.png"/><link rel="apple-touch-icon" sizes="144x144" href="/icons/icon-144x144.png"/><link rel="apple-touch-icon" sizes="192x192" href="/icons/icon-192x192.png"/><link rel="apple-touch-icon" sizes="256x256" href="/icons/icon-256x256.png"/><link rel="apple-touch-icon" sizes="384x384" href="/icons/icon-384x384.png"/><link rel="apple-touch-icon" sizes="512x512" href="/icons/icon-512x512.png"/><link rel="manifest" href="/manifest.json"/><title>Lightning Terminal</title><script defer="defer" src="/static/js/main.49cc9a87.js"></script><link href="/static/css/main.488ab95f.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

I dont know how to activate Javascript, am I doing something wrong, do I need to include soem sort of other information on API request or what am I missing?

weltitob commented 5 months ago

Hi @weltitob!

Thanks for reaching out and for the issue report!

Which browser are you using, and have you ensured that Javascript is enabled in the browser settings?

For the whitescreen issue I'm using Chrome and when running Litd manually outside of the docker I have experienced zero issues with the same Chrome Browser. It seems to come down to whats happening inside of the docker. What Browser do I use inside the docker, idk, none i guess.

jamaljsr commented 5 months ago

My current Docker Setup: I run the newest Dockerversion: lightninglabs/lightning-terminal:v0.12.2-alpha-path-prefix

You are using the path-prefix image which sets the url path of the frontend UI to be /lit. You should use the lightninglabs/lightning-terminal:v0.12.2-alpha docker image instead which hosts the frontend app at the rool url path /

I believe this should also fix your second issue as well.

weltitob commented 5 months ago

My current Docker Setup: I run the newest Dockerversion: lightninglabs/lightning-terminal:v0.12.2-alpha-path-prefix

You are using the path-prefix image which sets the url path of the frontend UI to be /lit. You should use the lightninglabs/lightning-terminal:v0.12.2-alpha docker image instead which hosts the frontend app at the rool url path /

I believe this should also fix your second issue as well.

Hi, this actually fixed my whitescreen issue, but not my other issue. Now that I can properly try to call the API even with my docker instances aswell I got the same issue as for my personal node.

Thats why I seperated the two issues it now might get confusing now haha.

So basically I still have the API Error with this message once I try calling the API:

c:/Users/tobia/OneDrive/Desktop/BitNet/authentication/pythonfunctions/taproot_assets/listassets.py
Response is not in JSON format: <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/icons/favicon-32x32.png"/><meta name="theme-color" content="#000000"/><link rel="apple-touch-icon" sizes="48x48" href="/icons/icon-48x48.png"/><link rel="apple-touch-icon" sizes="72x72" href="/icons/icon-72x72.png"/><link rel="apple-touch-icon" sizes="96x96" href="/icons/icon-96x96.png"/><link rel="apple-touch-icon" sizes="144x144" href="/icons/icon-144x144.png"/><link rel="apple-touch-icon" sizes="192x192" href="/icons/icon-192x192.png"/><link rel="apple-touch-icon" sizes="256x256" href="/icons/icon-256x256.png"/><link rel="apple-touch-icon" sizes="384x384" href="/icons/icon-384x384.png"/><link rel="apple-touch-icon" sizes="512x512" href="/icons/icon-512x512.png"/><link rel="manifest" href="/manifest.json"/><title>Lightning Terminal</title><script defer="defer" src="/static/js/main.d6295b33.js"></script><link href="/static/css/main.488ab95f.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

My docker whitescreen issue is fixed tho.

This is unrelated to the docker stuff as I got this issue even before on one instance where the ui of the terminal was working (my personal node which is not dockerized)

Should I reopen the seperate issue for this? @ViktorTigerstrom

Even if not everything is fixed thanks a lot @jamaljsr 👍 💯

jamaljsr commented 5 months ago

So basically I still have the API Error with this message once I try calling the API:

c:/Users/tobia/OneDrive/Desktop/BitNet/authentication/pythonfunctions/taproot_assets/listassets.py
Response is not in JSON format: <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/icons/favicon-32x32.png"/><meta name="theme-color" content="#000000"/><link rel="apple-touch-icon" sizes="48x48" href="/icons/icon-48x48.png"/><link rel="apple-touch-icon" sizes="72x72" href="/icons/icon-72x72.png"/><link rel="apple-touch-icon" sizes="96x96" href="/icons/icon-96x96.png"/><link rel="apple-touch-icon" sizes="144x144" href="/icons/icon-144x144.png"/><link rel="apple-touch-icon" sizes="192x192" href="/icons/icon-192x192.png"/><link rel="apple-touch-icon" sizes="256x256" href="/icons/icon-256x256.png"/><link rel="apple-touch-icon" sizes="384x384" href="/icons/icon-384x384.png"/><link rel="apple-touch-icon" sizes="512x512" href="/icons/icon-512x512.png"/><link rel="manifest" href="/manifest.json"/><title>Lightning Terminal</title><script defer="defer" src="/static/js/main.d6295b33.js"></script><link href="/static/css/main.488ab95f.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Ah, I also thought these two issues were for the same server. For this remaining issue, are you starting litd with the --enablerest config option? Without that, the frontend app server will respond to the HTTP requests instead of the sub-servers.

weltitob commented 5 months ago

So basically I still have the API Error with this message once I try calling the API:

c:/Users/tobia/OneDrive/Desktop/BitNet/authentication/pythonfunctions/taproot_assets/listassets.py
Response is not in JSON format: <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/icons/favicon-32x32.png"/><meta name="theme-color" content="#000000"/><link rel="apple-touch-icon" sizes="48x48" href="/icons/icon-48x48.png"/><link rel="apple-touch-icon" sizes="72x72" href="/icons/icon-72x72.png"/><link rel="apple-touch-icon" sizes="96x96" href="/icons/icon-96x96.png"/><link rel="apple-touch-icon" sizes="144x144" href="/icons/icon-144x144.png"/><link rel="apple-touch-icon" sizes="192x192" href="/icons/icon-192x192.png"/><link rel="apple-touch-icon" sizes="256x256" href="/icons/icon-256x256.png"/><link rel="apple-touch-icon" sizes="384x384" href="/icons/icon-384x384.png"/><link rel="apple-touch-icon" sizes="512x512" href="/icons/icon-512x512.png"/><link rel="manifest" href="/manifest.json"/><title>Lightning Terminal</title><script defer="defer" src="/static/js/main.d6295b33.js"></script><link href="/static/css/main.488ab95f.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Ah, I also thought these two issues were for the same server. For this remaining issue, are you starting litd with the --enablerest config option? Without that, the frontend app server will respond to the HTTP requests instead of the sub-servers.

Nah you're just amazing man, it worked out like that, will close the ticket now. Thanks a lot haha <3