Title: Lnd.exe error: 'loadConfig: Failed to create lnd directory: mkdir ...' Post by: nefIndustries on December 02, 2018, 08:26:52 AM Bitcoin Client Software and Version Number: /Satoshi/ 0.17.0.1/ & Lnd 0.5.0-beta (Also happened on 0.5.1-beta)
Operating System: Windows 10 System Hardware Specs: Ryzen 7 1700 CPU, 16GB RAM, 3TB HDD, GTX 960 Description of Problem: I have two separate errors. I believe error 2 must be dealt with before moving onto error 1. So the story goes I was doing fine running an LND Node v 0.5.0-beta through Windows Powershell. Everything was working as expected. Before funding a channel I decided to use Tor to hide my IP address. (I have never used Tor before) I downloaded the Tor Browser, set up my Bitcoin Core Full node through Run using these flags: Code: "C:\Program Files\Bitcoin\bitcoin-qt.exe" -txindex=1 -zmqpubrawblock=tcp://127.0.0.1:18503 -zmqpubrawtx=tcp://127.0.0.1:18504 -rpcuser=ezra -rpcpassword=Bignoodles -server=1 -rpcallowip=127.0.0.1 I added additional flags in my Bitcoin Core Config file: Code: proxy=127.0.0.1:9150 Additionally I went into C:\Users\Ezra\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc and add the following flags: Code: Controlport 9051 Now, in a Windows Powershell Console, I would launch lnd.exe with these commands/flags: Code: .\lnd.exe --bitcoin.active --bitcoin.mainnet --bitcoin.node=bitcoind --bitcoind.rpchost=127.0.0.1 --bitcoind.rpcuser=ezra --bitcoind.rpcpass=Bignoodles --bitcoind.zmqpubrawblock=tcp://127.0.0.1:18503 --bitcoind.zmqpubrawtx=tcp://127.0.0.1:18504 --debuglevel=info --tor.active --tor.streamisolation --tor.v3 listen=localhost Here is error 1: Upon unlocking wallet using a separate powershell instance with the command Code: .\lndcli unlock Code: 2018-12-01 19:49:27.376 [INF] LNWL: Opened wallet I waited a while and tried again under the same commands/flags Code: 2018-12-01 20:25:14.209 [WRN] LTND: open C:\Users\Ezra\AppData\Local\Lnd\lnd.conf: The system cannot find the file specified. My Tor Browser is saved under 'C:\Users\Ezra\Desktop\Tor Browser' The file path LND was looking for 'C:\\Users\\Ezra\\Desktop\\Tor' doesn't exist. I tried to rename the folder 'Tor Browser' to 'Tor' and to nobody's surprise that didn't work ::) Is there a way for me to manually redirect it to the correct folder? I'm kind of at a loss on this one, however it's not the most pressing issue I am having. If we are able to resolve Error #2, the next step would be fixing Error #1 I had been doing lots of closing and opening Lnd.exe & the Full Node so I decided to restart the PC.. Same issue continues. Next I decided to delete both lnd.exe & lncli.exe from my computer, and install the newest version (0.5.1-beta) Here is error 2: I decide to delete my Lnd folder from the %localappdata% (saved to recycle bin) & delete all my tor flags, now running these commands for: Bitcoin Core Full Node, launched through run Code: "C:\Program Files\Bitcoin\bitcoin-qt.exe" -txindex=1 -zmqpubrawblock=tcp://127.0.0.1:18503 -zmqpubrawtx=tcp://127.0.0.1:18504 -rpcuser=ezra -rpcpassword=Bignoodles -server=1 -rpcallowip=127.0.0.1 Commands/flags for Lnd.exe, launched through PowerShell Code: .\lnd.exe --bitcoin.active --bitcoin.mainnet --bitcoin.node=bitcoind --bitcoind.rpchost=127.0.0.1 --bitcoind.rpcuser=ezra --bitcoind.rpcpass=Bignoodles --bitcoind.zmqpubrawblock=tcp://127.0.0.1:18503 --bitcoind.zmqpubrawtx=tcp://127.0.0.1:18504 --debuglevel=info -listen=localhost The only message I get after pressing enter is: https://imgur.com/a/zed0TvP Code: loadConfig: Failed to create lnd directory: mkdir C:\Users\Ezra\AppData\Local\Lnd: Access is denied (Bug info less detailed because it is not being written to the log file) This issue is my main concern. Suddenly my PowerShell lost privileges to create/access directories? It had this privilege when I first created a node weeks ago, and it had these privileges about 30 minutes ago, before I started setting this stuff up using Tor Next I tried running PowerShell as Administer, giving me a whole new error: https://imgur.com/a/NYNuNo6 Finally, I moved my Lnd folder back into %localappdata% and tried to launch lnd.exe through PowerShell (non-administrator) using all the same commands/flags as before, resulting in this error message: https://imgur.com/a/0gTgXrj Code: failed to create file rotator: open C:\Users\Ezra\AppData\Local\Lnd\logs\bitcoin\mainnet\lnd.log: Access is denied So yeah, I'm kind of at a loss. I haven't used much PowerShell before trying to run an Lnd node, haven't used Tor before. Spent too much time learning about and experimenting with Lnd to give up now, I'm very willing to work with anyone who can steer me in the right direction!!! Thank you to anybody who took the time to go through this!!!!! Title: Re: Lnd.exe error: 'loadConfig: Failed to create lnd directory: mkdir ...' Post by: Rath_ on December 02, 2018, 11:54:25 AM I haven't used Tor with Bitcoin Core and LND but I will try to help you. Take a look at this document (https://github.com/lightningnetwork/lnd/blob/master/docs/configuring_tor.md) which describes how to configure Tor for LND. Are you running Tor as a Windows service (https://dephekt.net/blog/running-tor-as-a-windows-service-with-the-tor-browser-bundle/)? As for the error number two, I would check what's going on in that directory (trying to create lnd.log manually and checking the permissions of the mainnet folder).
Title: Re: Lnd.exe error: 'loadConfig: Failed to create lnd directory: mkdir ...' Post by: bob123 on December 02, 2018, 01:10:23 PM Are you running the commands with an administrator account?
The only message I get after pressing enter is: https://imgur.com/a/zed0TvP Access denied means you don't have enough privileges to create that folder. Next I tried running PowerShell as Administer, giving me a whole new error: https://imgur.com/a/NYNuNo6 It can't find lnd.exe because it is not in the current directory. Navigate to the directory where the .exe is placed (seems to be C:\Users\Ezra\), then try it again. Finally, I moved my Lnd folder back into %localappdata% and tried to launch lnd.exe through PowerShell (non-administrator) using all the same commands/flags as before, resulting in this error message: https://imgur.com/a/0gTgXrj Same as the first, Access denied. You seem to not have enough privileges (which is quite weird). Are you on a 'guest' account? Or an administrator account? Title: Re: Lnd.exe error: 'loadConfig: Failed to create lnd directory: mkdir ...' Post by: nefIndustries on December 02, 2018, 10:27:54 PM Are you running Tor as a Windows service (https://dephekt.net/blog/running-tor-as-a-windows-service-with-the-tor-browser-bundle/)? I was not, I have been using the browser meaning the browser had to be open for traffic to be routed, which is not recommended according to @cellard from this post (6th reply) (https://bitcointalk.org/index.php?topic=3058841) So, you are trying to use the bundled Tor from Tor Browser rather than a dedicated Tor daemon? This is not recommended. IIRC, the default TCP port for Tor Browser’s Tor’s SOCKSPort is 127.0.0.1:9150, which explains why Bitcoin could not connect to port 9050. On Linux, at least, recent versions of Tor Browser may even use a UNIX domain socket rather than a TCP socket. But I’m not even sure what it does by default, since I use Tor Browser with an external Tor daemon on a network-isolating gateway. I would need to search—I recommend that you do so, if you really want to use Tor Browser’s Tor. If you want to add another SOCKSPort to Tor Browser, look for Browser/TorBrowser/Data/Tor/torrc. See the Tor manual page for documentation of SOCKSPort. Be aware that this will probably (?) be wiped out when you upgrade Tor Browser. It is strongly recommended that you set up a separate Tor daemon for your Bitcoin. I recommend doing so on a gateway which isolates the internal network; this affirmatively prevents all leaks of your “real” IP address, whether malicious or accidental. Many applications leak horribly, doing direct DNS lookups even when they purport to accept SOCKS proxy settings. You can set up a Tor gateway on a cheap computer with two Ethernet ports, or using VMs within the same physical machine. On FreeBSD, the jail subsystem provides a lightweight means to achieve this. N.b. that if you use a separate Tor daemon with Tor Browser, it requires some muttered incantations to disable Tor Browser’s bundled Tor; and you must do this to avoid “Tor-over-Tor”, which will harm your anonymity as well as killing performance. I followed the guide you linked, and my method was a little bit different than in the guide. I had to open up command prompt as administrator, and change directory to my Tor file Code: cd C:\Users\Ezra\Desktop\Tor Browser\Browser\TorBrowser\Tor and THEN I was able to create the tor service Code: tor.exe -install service For me it did not work unless I was running cmd as administrator Don't forget to actually run tor.exe before launching the Full Node Thank you for the link, that helped me solve a problem I would eventually run into. Are you running the commands with an administrator account? It can't find lnd.exe because it is not in the current directory. Navigate to the directory where the .exe is placed (seems to be C:\Users\Ezra\), then try it again. Lol, duh. Thank you :) Helped me fix that pretty quickly. Running Powershell as admin, and going to the correct directory got rid of all the mkdir issues I was getting. New Errors So it seems my initial two errors are fixed. Now I have one error and a warning that I am worried about Currently I am hung up on this error (https://imgur.com/a/KPiIHsW) My lnd.exe command with flags: Code: .\lnd.exe --bitcoin.active --bitcoin.mainnet --bitcoin.node=bitcoind --bitcoind.rpchost=127.0.0.1 --bitcoind.rpcuser=ezra --bitcoind.rpcpass=Bignoodles --bitcoind.zmqpubrawblock=tcp://127.0.0.1:18503 --bitcoind.zmqpubrawtx=tcp://127.0.0.1:18504 --debuglevel=info --listen=localhost --tor.active --tor.streamisolation --tor.v3 listen=localhost It catches up to the block hashes fine, but when (what I assume is) getting Lightning Network channel information, it gets hung up with the error message: Code: 2018-12-02 16:50:39.861 [ERR] SRVR: unable to start server: unable to connect to Tor server: dial tcp 127.0.0.1:9051: connectex: No connection could be made because the target machine actively refused it. I haven't looked into it too much, I will start googling after this post, just wanna update with the progress you guys are helping with. The warning message happens in the lnd.exe console right after I press Enter using these flags: Code: .\lnd.exe --bitcoin.active --bitcoin.mainnet --bitcoin.node=bitcoind --bitcoind.rpchost=127.0.0.1 --bitcoind.rpcuser=ezra --bitcoind.rpcpass=Bignoodles --bitcoind.zmqpubrawblock=tcp://127.0.0.1:18503 --bitcoind.zmqpubrawtx=tcp://127.0.0.1:18504 --debuglevel=info --listen=localhost --tor.active --tor.streamisolation --tor.v3 listen=localhost The warning message is: Code: 2018-12-02 16:46:16.575 [WRN] LTND: open C:\Users\Ezra\AppData\Local\Lnd\lnd.conf: The system cannot find the file specified. I went into that directory and created a new txt file named 'lnd.conf', But I believe the computer saves it as lnd.conf.txt, resulting in this warning. Unfortunate because it would be great to have a log of all this crap ;D I'm off to try and find a solution, when I find one I will update the thread :) Title: Re: Lnd.exe error: 'loadConfig: Failed to create lnd directory: mkdir ...' Post by: Rath_ on December 02, 2018, 10:50:59 PM I went into that directory and created a new txt file named 'lnd.conf', But I believe the computer saves it as lnd.conf.txt, resulting in this warning. Download Notepad++ or Sublime Text 3 if you don't want to change the visibility of known extensions in the explorer settings (https://www.howtohaven.com/system/show-file-extensions-in-windows-explorer.shtml) (renaming the file to lnd.conf from lnd.conf.txt will do the trick once you change that setting). As for the Tor connection error, try disabling Windows firewall for a moment. If it works, you will have to add proper exceptions. Title: Re: Lnd.exe error: 'loadConfig: Failed to create lnd directory: mkdir ...' Post by: nefIndustries on December 02, 2018, 11:18:29 PM As for the Tor connection error, try disabling Windows firewall for a moment. If it works, you will have to add proper exceptions. I disabled my Firewall, still the same result Code: 2018-12-02 18:14:38.450 [ERR] SRVR: unable to start server: unable to connect to Tor server: dial tcp 127.0.0.1:9051: connectex: No connection could be made because the target machine actively refused it. I am continuing my search now Title: Re: Lnd.exe error: 'loadConfig: Failed to create lnd directory: mkdir ...' Post by: bob123 on December 03, 2018, 04:23:37 PM Code: 2018-12-02 18:14:38.450 [ERR] SRVR: unable to start server: unable to connect to Tor server: dial tcp 127.0.0.1:9051: connectex: No connection could be made because the target machine actively refused it. Your machine refuses the connection at port 9051. Can you verify that the tor service is running at this port ? I believe the standard port for tor is 9001 and 9051. But this can be freely changed. It is just important that you connect to the same port where tor is listening. Title: Re: Lnd.exe error: 'loadConfig: Failed to create lnd directory: mkdir ...' Post by: nefIndustries on December 03, 2018, 11:16:52 PM (renaming the file to lnd.conf from lnd.conf.txt will do the trick once you change that setting) This worked great, got rid of the warning! Thanks! Your machine refuses the connection at port 9051. Can you verify that the tor service is running at this port ? I believe the standard port for tor is 9001 and 9051. But this can be freely changed. It is just important that you connect to the same port where tor is listening. I got it working! Here is what I did in case anybody in the future runs into the same issues that I do ;D I was able to confirm my tor service was running by launching run and typing 'services.msc'. I then scrolled down to confirm that 'Tor Win32 Service' was running. Tor is running. Is my port open? Let's see! I launched cmd as Administrator and ran the command Code: netstat -anb I confirmed the port was open by scrolling up to my desired port number (127.0.0.1:9051) and ensuring the port's state was set to 'LISTENING' So I confirmed the port was listening properly, so why was I still getting this error? Code: 2018-12-02 18:14:38.452 [INF] LTND: Shutdown complete I launched my Bitcoin Core Full Node launch using run with the commands/flags: "C:\Program Files\Bitcoin\bitcoin-qt.exe" -txindex=1 -zmqpubrawblock=tcp://127.0.0.1:9051 -zmqpubrawtx=tcp://127.0.0.1:18504 -rpcuser=ezra -rpcpassword=Bignoodles -server=1 -rpcallowip=127.0.0.1 I then launched Powershell as administrator and started lnd.exe using this command with flags: .\lnd.exe --bitcoin.active --bitcoin.mainnet --bitcoin.node=bitcoind --bitcoind.rpchost=127.0.0.1 --bitcoind.rpcuser=ezra --bitcoind.rpcpass=Bignoodles --bitcoind.zmqpubrawblock=tcp://127.0.0.1:9051 --bitcoind.zmqpubrawtx=tcp://127.0.0.1:18504 --debuglevel=info --rpclisten=localhost:10012 I can now connect to the Lightning Network & connect to peers! However, lncli freezes when I try to open a channel with a peer. I believe this is due to the fact that I didn't receive a 'Uris' ID (https://imgur.com/a/29mYY6Y) To fix this, I went into %localappdata% and found my lnd.conf, and added the flag: Code: externalip=7p70tghbgasedo0.onion MyIP is the same as my Bitcoin Core Full Node's IP address (https://imgur.com/a/xGIjae4) Unfortunately at this point my lncli through Powershell would not be able to open a channel and would freeze every time I attempted. I went over to the LND dev Slack, and they let me know I should be using Command Line instead of Powershell, and guess what! It WORKS! I started this journey to a Lightning Node on November 24th, and now have a fully working Lnd Node running over the Tor network! I had never used Tor before. Because of Lightning and the Bitcoin Core Full Node I learned so much about my computer (I thought I knew so much, I now know how much I have to learn :o) Thank you to @bob123 & @BitCryptex for helping me out, you are great! Also couldn't have done it without the LND Slack (https://lightningcommunity.slack.com/messages/C6BKD3RKR/) or Pierre Rochard on Twitter (https://twitter.com/pierre_rochard) Title: Re: Lnd.exe error: 'loadConfig: Failed to create lnd directory: mkdir ...' Post by: Rath_ on December 04, 2018, 06:03:10 PM I started this journey to a Lightning Node on November 24th, and now have a fully working Lnd Node running over the Tor network! I had never used Tor before. It would be great if you could share your experience of running a Lightning Network node after 1 month in this thread (https://bitcointalk.org/index.php?topic=4638321.msg41920502#msg41920502). Nobody has shared statistics of a node which is hidden behind the Tor network, yet. Would you mind if ask you a few questions regarding the setup of such node? I would like to write a tutorial so that other people could easily setup their LN node which would connect through the Tor network on Windows. Title: Re: Lnd.exe error: 'loadConfig: Failed to create lnd directory: mkdir ...' Post by: nefIndustries on December 04, 2018, 08:24:05 PM It would be great if you could share your experience of running a Lightning Network node after 1 month in this thread (https://bitcointalk.org/index.php?topic=4638321.msg41920502#msg41920502). Nobody has shared statistics of a node which is hidden behind the Tor network, yet. Would you mind if ask you a few questions regarding the setup of such node? I would like to write a tutorial so that other people could easily setup their LN node which would connect through the Tor network on Windows. Absolutely! Let's talk! |