Skip to content
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

Bitcoin Knots won't start if datadir in Wasabi ends with \ #12580

Closed
Szpoti opened this issue Feb 29, 2024 · 3 comments · Fixed by #12688
Closed

Bitcoin Knots won't start if datadir in Wasabi ends with \ #12580

Szpoti opened this issue Feb 29, 2024 · 3 comments · Fixed by #12688
Assignees

Comments

@Szpoti
Copy link
Collaborator

Szpoti commented Feb 29, 2024

General Description

When turning "Run Bitcoin Knots on startup" ON, you can set a custom data folder, which I believe many people does, as not everyone has enough space on C: (or any default storage on any OS), or simply want it on a specific hard drive.

But if you set the data folder wrong, Bitcoin Knots won't start, won't even make logs, and the exception doesn't tell you neither that the problem is with the data folder's path. If you have a \ at the end of the path - or any other symbol basically - it won't work.

But what's extra intresting, is if you look for bitcoind.exe, and start it manually from the terminal, with either -datadir=E:\Bitcoin\ or -datadir=E:\Bitcoin, both will work and bitcoind.exe starts without a problem. It looks like this only happens when we try to start it from Wasabi/dotnet?

How To Reproduce?

I use Windows 11.

  1. Go to Settings, and Bitcoin
  2. Turn ON (EXPERIMENTAL) Run Bitcoin Knots on startup
  3. Bitcoin Core/Knots Data Folder input appears. Whatever is in it, put a \ character at the end of the path.
  4. Restart Wasabi
  5. Hovering over the status icon on the bottom right, see BitcoinKnots - Full node is unresponsive
  6. See the ERROR in the logs

Screenshots

This is working:
image
This isn't:
image
image

Logs

2024-02-29 15:18:24.488 [11] ERROR      Global.StartLocalBitcoinNodeAsync (363) WalletWasabi.BitcoinCore.Processes.BitcoindException: Failed to start daemon, location: 'E:\WalletWasabi\WalletWasabi.Fluent.Desktop\bin\Debug\net8.0\Microservices\Binaries\win64\bitcoind.exe -regtest=0 -testnet=0 -datadir="E:\BitcoinDataMain\" -printtoconsole=0'
 ---> System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it. (127.0.0.1:8332)
 ---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(QueueItem queueItem)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.HttpConnectionWaiter`1.WaitForConnectionWithTelemetryAsync(HttpRequestMessage request, HttpConnectionPool pool, Boolean async, CancellationToken requestCancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at NBitcoin.RPC.RPCClient.SendCommandAsync(RPCRequest request, CancellationToken cancellationToken)
   at NBitcoin.RPC.RPCClient.UptimeAsync(CancellationToken cancellationToken)
   at WalletWasabi.BitcoinCore.Rpc.RpcClientBase.UptimeAsync(CancellationToken cancellationToken) in WalletWasabi\BitcoinCore\Rpc\RpcClientBase.cs:line 131
   at WalletWasabi.BitcoinCore.Processes.BitcoindRpcProcessBridge.StartAsync(CancellationToken cancel) in WalletWasabi\BitcoinCore\Processes\BitcoindRpcProcessBridge.cs:line 71
   --- End of inner exception stack trace ---
   at WalletWasabi.BitcoinCore.Processes.BitcoindRpcProcessBridge.StartAsync(CancellationToken cancel) in WalletWasabi\BitcoinCore\Processes\BitcoindRpcProcessBridge.cs:line 91
   at WalletWasabi.BitcoinCore.CoreNode.CreateAsync(CoreNodeParams coreNodeParams, CancellationToken cancel) in WalletWasabi\BitcoinCore\CoreNode.cs:line 251
   at WalletWasabi.Daemon.Global.StartLocalBitcoinNodeAsync(CancellationToken cancel) in WalletWasabi.Daemon\Global.cs:line 355
@collins-okafor
Copy link
Contributor

@Szpoti could this be OS based? Can't reproduce on my pc (MacOs)

Screenshot 2024-03-01 at 3 22 42 AM Screenshot 2024-03-01 at 3 23 40 AM

@Szpoti
Copy link
Collaborator Author

Szpoti commented Mar 1, 2024

Hmm maybe it is. I did my testing on Win 11.

@MarnixCroes
Copy link
Collaborator

cannot repro on Ubuntu 22.04 LTS.
/home/username/.bitcoin/ & /home/username/.bitcoin both work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants