-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Startup crash when Deploying to Heroku plus question connecting to Umbrel lnd with onion #25
Comments
thanks for reporting this! I am not very experienced with the Heroku tor setup, so this is super helpful! the easy one is question 2: YES, that's what the idea of LnMe is. can you go go into your dyno ( |
can you try this branch: https://github.com/bumi/lnme/tree/configurable-tor-path //cc @crc32 do you have an idea here? |
maybe we actually also should embed tor directly. (as mentioned here: https://github.com/cretz/bine#readme ) |
When I /bin/bash via the console I get this running log which I have to ctrl-c out of Oct 28 15:02:39.622 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning Once in the shell - doing which tor, I get nothing (meaning not in path?) as for ls -al "${HOME}/tor/bin drwx------ 2 u14020 dyno 4096 Oct 28 12:14 . So I think everything is there. It seems like there might be a typo in the scripts somewhere that prevents tor from being found. |
thanks! Just push that branch to your existing heroku app. (e.g. |
Will do later today! |
Almost there! Site is running, but fails on invoice request. Looks like I need to generate valid cert. See log below. Otherwise, everything else seems to be working. Advise on how to generate the TLS cert for the node would be great! 2021-10-28T16:10:52.432715+00:00 app[web.1]: 2021/10/28 16:10:52 Adding invoice: memo=Tim value=100 |
great! then you are missing the TLS certificate from your LND node OR (likely) you need to tell LND your onion address - somewhere in the config - I am not exactly sure where right now. |
was it |
Yeah, I need to find or generate something. That'll be the homework for tonight. The TLS cert is for 'umbrel.local' but i need one for lnd node which has it own onion address, not the web on for umbrel.local. It can be generated with openssl, but I need to understand how TLS fits into LND. I also need to understand the docker network to make nothing else is in the way. Otherwise everything else looks like it is working. |
ok, but you used the LND tls.cert file? (something like: ~/umbrel/lnd/tls.cert) |
I think that TLS cert is bound to 'umbrel.local' - when a request is coming from heroko - it is looking for a cert that is bound to the onion address. That is what I discern from the error messge below. So i think I need to generate a cert that is bound to the onion address then it will work. 2021/10/28 17:09:17 Error creating invoice: rpc error: code = Unavailable desc = connection error: desc = "transport: authentication handshake failed: x509: certificate is valid for localhost, umbrel.local, unix, unixpacket, bufconn, not gvcnwhe7p2xenumcusu7hv3eiunuc53krnglcy5ovmgm6oo5gdxglgyd.onion" |
LND will do that for you or do you have some proxy in front of LND? |
I had the same problem with path. This solution helped, thanks! But now I am getting a new error:
|
@vbrekher what did you set as the |
I am pretty sure it's a problem with the certificate. For fun, I tried to set at :9735 and I get this message: Error creating invoice: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing socks connect tcp 127.0.0.1:44930->gvcnwhe7p2xenumcusu7hv3eiunuc53krnglcy5ovmgm6oo5gdxglgyd.onion:9735: unknown error connection refused" Which is expected, because there is nothing going on at :9735 When set to :10009, I get this message 2021/10/29 11:28:08 Error creating invoice: rpc error: code = Unavailable desc = connection error: desc = "transport: authentication handshake failed: x509: certificate is valid for localhost, umbrel.local, unix, unixpacket, bufconn, not gvcnwhe7p2xenumcusu7hv3eiunuc53krnglcy5ovmgm6oo5gdxglgyd.onion" So, it llooks like heroku is communicating and the certiificate is being enaged on the umbrel node, but the handshake fails because the onion address is not in the certificate. (as it is only umbrel.local, unix, unixpacket, bufconn). We likely need to raise an issue with umbrel to see how we can add the grpc address as part of the certificate. I know I can communicate with my umbrel node because I can access the dashboard through onion no problem at all. Anyway, I am really keen to get this working, because I want to add this to my twitter profile, so any help is appreciated! |
that error is perfectly fine. And afaik means that you did not tell LND about your onion address ( Not sure if umbrel exposes the LND gRPC interface by default on the onion address. Maybe you can check that with umbrel? |
OK, I will try this, but will consult the umbrel experts first as it sounds dangerous. Do I need to restart my node to regenerate the TLS cert? In what file do I add the tlsextradomain? |
So I've tried on a test lnd node I have on another machine to regenerate the certs and it seems to work. So I will do on my umbrel when I feel comfortable, likely in the next day or so. The final question I have - can an onion address be a valid tlsextradomain? |
Yes, best is to ask in the Umbrel forum what's the best way to make the LND gRPC interface available. (because I think that actually should directly work. is that also the onion address that you seen when you go to connect wallet and select "lnd grpc" in umbrel? |
I looked at umbrel and you should be able to get the certificate also from the "Connect Wallet" -> "Other" -> "lndconnect grpc (tor)" entry. But there the certificate is base64 encoded and we need it hex encoded. (also the macaroon). that tor URL in that lndconnect string should actually already be properly configured in the lnd.conf - BUT it seems it is not? so is this maybe a umbrel bug? let me know what you hear from them. |
OK cool - we are getting there. A couple of fruitful avenues to investigate. Thanks! |
On second thought, could you add this an environment parameter in your app and parse accordingly? - If it is non-null use that info to do the connect^ More work on your app, but it saves me a lot of scary work on my side |
yep, that's a good idea. that should be possible. |
Sorry, just seeing this now. Looking through my Heroku config vars, I see that I did add Tor to the path: /usr/local/bin:/usr/bin:/bin:/app/bin:/app/tor/bin That may be the solution? I must have forgotten to add that to the instructions, very sorry. Another thing to take note of is how the SSL cert works. I use a proxy that handles it. |
Ok thanks - I will try to deploy the latest tonight to see if I can connect. If not successful, I will raise an issue for an enhancement request to see if it is possible to add a variable that takes the lndconnect gRPC from Umbrel and then you figure it out from there. Thanks again for your support - I am really excited to get this working! |
@crc32 ah yes, that would work, too. wondering why the buildpack actually does not do that. maybe we should make a PR there? @trbouma I tried it with an umbrel and I have the same issue. I also could not connect via Zeus. I am really wondering if that is an umbrel issue (or missing default config setting) - Sadly I don't know umbrel much. |
RE: Umbrel, not sure. I have it running on Raspiblitz (Zeus too). I do have Zeus connecting to Umbrel, but I do recall it was a bear to get it to work (and I have no idea what I did to get it working - it was awhile ago). |
Some good progress. I added the onion address to the lnd.conf with the tlsextradomain and regenerated the tls.cert and tls.key by restarting lnd. It looks like I am getting through but now there is some sort of timeout - deadline exceeded. Log entry below 2021-10-30T00:34:53.991544+00:00 app[web.1]: 2021/10/30 00:34:53 Error creating invoice: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing context deadline exceeded" So it might be something to do with latency in the onion network - is there a parameter that can be changed? for more context in the log see below: 2021-10-30T00:33:39.441066+00:00 heroku[router]: at=info method=GET path="/" host=lnme-yow3.herokuapp.com request_id=a6bf647a-7804-45d1-a0df-35eb451f1ef4 fwd="174.93.52.10" dyno=web.1 connect=0ms service=1ms status=200 bytes=7138 protocol=https |
it is now working for you, isn't it? |
Kinda. It is working, with the website, but the lightning address stopped working. I have to troubleshoot on my side, as my lnpay.ca cert stopped working inexplicably after a few days. It is also seems trbouma@lnme-yow3.herokuapp.com stopped working as well. |
I tested trbouma@lnme-yow3.herokuapp.com 3 days ago, and it is now not working. But the web app is fine. Tested a few minutes ago. |
for lnpay.ca I'd assume it is a DNS issue. |
I also just sent you a few sats to the trbouma@lnme-yow3.herokuapp.com. I tried with Breez wallet at first, but it failed. Ended up going through from my own node, so it could just be a LN liquidity issue. |
@crc32 looks like 10 sats from you came through ok. Not exactly sure what the issue is. I will continue to troubleshoot on my side and keep you posted. We should keep this issue open until we understand what's going on completely. |
Only 10? I sent 100 (at 12:48:31 MST). If you want me to send you the payment details, feel free to DM me on telegram (@arceris_btc), and I'll send them to you. It also could be useful to have those from me to help figure this out too. |
I stand corrected. 100 sats came through at 2:48pm ET |
Ahh, ok. Just got concerned for a sec! |
I got it all working again. My registrar is a bit goofy. I have to 'park the domain' so I can add the CNAME, let that take, do the heroku cert refresh, then switch to third-party hosting (which then I can no longer access CNAME). It seems to work as I just paid myself 11 sats with trbouma@lnpay.ca |
All good - just got anyname@lnpay.direct working as well! |
this can be closed, now? |
Yes, it can be closed @bumi . Thanks for all your help! |
I tried deploying to Heroku and connecting to my Umbrel node. I got my LND onion address from the file./home/umbrel/umbrel/tor/data/lnd-grpc/hostname
I also created the HEX cert and macaroon as per your instructions. To create the macaroon I had to go into the lnd contain - docker exec -it lnd /bin/bash and execute:
lncli bakemacaroon onchain:read address:read invoices:read address:write invoices:write
So I think I got all of the env variables correct...
But when I deploy to Heroku - everything builds ok, but crashes on startup - I get these messages in the log
panic: exec: "tor": executable file not found in $PATH
goroutine 1 [running]:
main.main()
/tmp/build_55ed8a5d/lnme.go:101 +0x1556
Process exited with status 2
State changed from starting to crashed
Build succeeded
The buildpack is installed ok (https://github.com/iamashks/heroku-buildpack-tor-proxy.git)
When I restart - same thing. I am using a free dyno (do I need a paid one?)
Do you know:
Thanks,
Tim
The text was updated successfully, but these errors were encountered: