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

HttpMessageHelper: Change exception being thrown #8810

Merged

Conversation

kiminuo
Copy link
Collaborator

@kiminuo kiminuo commented Jul 28, 2022

Related to #6215

This PR changes the exception being thrown in HttpMessageHelper from NotSupportedException (denoting unexpected failure) to TorConnectionReadException (denoting failure that is expected to happen from time to time).

The reason for this change is this (combined) log:

Jul 28 09:23:00.824 [info] circuit_launch_by_extend_info(): Cannibalizing circ 2258840194 (id: 249) for purpose 9 (Hidden service client: Establishing rendezvous point)
Jul 28 09:23:00.852 [info] connection_ap_handshake_attach_circuit(): Intro 3003528868 (id: 256) and rend circuit 2258840194 (id: 249) circuits are not both ready. Stalling conn. (0 sec old)
Jul 28 09:23:01.957 [info] connection_ap_handshake_attach_circuit(): Intro 3003528868 (id: 256) and rend circuit 2258840194 (id: 249) circuits are not both ready. Stalling conn. (1 sec old)
Jul 28 09:23:02.816 [info] connection_ap_handshake_attach_circuit(): Intro 3003528868 (id: 256) and rend circuit 2258840194 (id: 249) circuits are not both ready. Stalling conn. (2 sec old)
Jul 28 09:23:03.383 [info] connection_ap_handshake_attach_circuit(): ready rend circ 2258840194 (id: 249) already here. Nointro-ack yet on intro 3003528868 (id: 256). (stream 3 sec old)
Jul 28 09:23:03.383 [info] connection_ap_handshake_attach_circuit(): Found open intro circ 3003528868 (id: 256). Rend circuit 2258840194 (id: 249); Sending introduction. (stream 3 sec old)
Jul 28 09:23:03.837 [info] connection_ap_handshake_attach_circuit(): pending-join circ 2258840194 (id: 249) already here, with intro ack. Stalling. (stream 3 sec old)
Jul 28 09:23:04.127 [info] connection_ap_handshake_attach_circuit(): pending-join circ 2258840194 (id: 249) already here, with intro ack. Stalling. (stream 4 sec old)
Jul 28 09:23:04.173 [info] connection_ap_handshake_attach_circuit(): pending-join circ 2258840194 (id: 249) already here, with intro ack. Stalling. (stream 4 sec old)
Jul 28 09:23:05.219 [info] connection_ap_handshake_attach_circuit(): rend joined circ 2258840194 (id: 249) already here. Attaching. (stream 5 sec old)

Jul 28 09:27:51.836 [info] circuit_mark_for_close_(): Circuit 0 (id: 249) marked for close at circuitlist.c:1668 (orig reason: 520, new reason: 0)
Jul 28 09:27:51.836 [info] circuit_free_(): Circuit 0 (id: 249) has been freed.

2022-07-28 09:27:51.859 [86] TRACE	PipeReaderLineReaderExtension.ReadLineAsync (61)	Read message: '650 CIRC 249 CLOSED $EB71BDDA9686108C48C21F9A48403B2B0F793231~relay05V6Rocks,$D08660B6D70B6249A57D89BB7A8F2EA2C952BD35~SNTor,$0A592CE8A53AECDF9130D37245C6460B238728DF~Sturmvogel BUILD_FLAGS=IS_INTERNAL,NEED_CAPACITY,NEED_UPTIME PURPOSE=HS_CLIENT_REND HS_STATE=HSCR_JOINED REND_QUERY=wasabiukrxmkdgve5kynjztuovbg43uxcbcxn6y2okcrsg7gb6jdmbad TIME_CREATED=2022-07-28T07:21:36.244723 SOCKS_USERNAME="H22AO0HUO0D61YES8MQZO" SOCKS_PASSWORD="H22AO0HUO0D61YES8MQZO" REASON=DESTROYED REMOTE_REASON=CHANNEL_CLOSED'
2022-07-28 09:27:51.860 [23] TRACE	TorHttpPool.ReportCircuitStatus (444)	Tor circuit was closed: #249 ('[PersonCircuit: H22AO0HUO0D61YES8MQZO]').

2022-07-28 09:27:51.891 [88] TRACE	TorHttpPool.SendAsync (195)	['PC#0004#H22AO0HUO0'] Could not get/read an HTTP response from Tor. Exception: WalletWasabi.Tor.Socks5.Exceptions.TorConnectionReadException: Could not read HTTP response.
 ---> System.NotSupportedException: Incomplete message. Expected length: 2275. Actual: 1987.
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.ReadBytesTillLengthAsync(Stream stream, Int64 length, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 459
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.GetDecodedChunkedContentBytesAsync(Stream stream, HttpRequestContentHeaders requestHeaders, HttpResponseContentHeaders responseHeaders, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 291
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.GetDecodedChunkedContentBytesAsync(Stream stream, HttpResponseContentHeaders headerStruct, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 240
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.GetContentBytesAsync(Stream stream, HttpResponseContentHeaders headerStruct, HttpMethod requestMethod, StatusLine statusLine, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 203
   at WalletWasabi.Tor.Http.Extensions.HttpResponseMessageExtensions.CreateNewAsync(Stream responseStream, HttpMethod requestMethod, CancellationToken cancellationToken) in WalletWasabi\Tor\Http\Extensions\HttpResponseMessageExtensions.cs:line 50
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendCoreAsync(TorTcpConnection connection, HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 403
   --- End of inner exception stack trace ---
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendCoreAsync(TorTcpConnection connection, HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 407
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 169

Basically, some Tor circuit 249 was closed due to some network issue (was the relay terminated? or disconnected somehow? IDK) and as such we did not get all data back.

Expected behavior is that TorHttpPool will catch the new TorConnectionReadException exception and repeat the request again.

Resources

cc @yahiheb (because he seemed to experience #6215 the most)

Copy link
Contributor

@nopara73 nopara73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK, code LGTM

@kiminuo kiminuo marked this pull request as ready for review July 29, 2022 10:54
@yahiheb
Copy link
Collaborator

yahiheb commented Jul 30, 2022

1- When I do the following:

  • Delete all the files under the WalletWasabi\Client\BitcoinStore\TestNet\IndexStore folder.
  • Start Wasabi (fluent)
  • Close Wasabi while it is downloading the filters

I get:

Click to expand and to see the logs!
2022-07-30 01:22:42.276 [25] INFO       FilterProcessor.ProcessAsync (59)       Downloaded filters for blocks from 888576 to 898575.
2022-07-30 01:22:47.619 [5] INFO        FilterProcessor.ProcessAsync (59)       Downloaded filters for blocks from 898576 to 908575.
2022-07-30 01:22:48.001 [1] DEBUG       TerminateService.Terminate (102)        Start shutting down the application.
2022-07-30 01:22:48.005 [22] INFO       Program.TerminateApplicationAsync (202) Wasabi GUI stopped gracefully (a3dfe5a0-71e5-4ca0-a0a3-c3b54ce746a0).
2022-07-30 01:22:48.009 [22] INFO       CoinJoinManager.WaitAndHandleResultOfTasksAsync (535)   Task 'walletsMonitoringTask' finished successfully by cancellation.
2022-07-30 01:22:48.011 [22] WARNING    Global.DisposeAsync (318)       Process is exiting.
2022-07-30 01:22:48.011 [10] INFO       CoinJoinManager.WaitAndHandleResultOfTasksAsync (535)   Task 'commandsHandlingTask' finished successfully by cancellation.
2022-07-30 01:22:48.012 [23] DEBUG      TorMonitor.MonitorEventsAsync (188)     Tor Monitor is stopping.
2022-07-30 01:22:48.012 [7] DEBUG       TorProcessManager.RestartingLoopAsync (159)     User canceled operation.
2022-07-30 01:22:48.013 [10] INFO       CoinJoinManager.WaitAndHandleResultOfTasksAsync (535)   Task 'monitorCoinJoinTask' finished successfully by cancellation.
2022-07-30 01:22:48.014 [10] INFO       CoinJoinManager.WaitAndHandleResultOfTasksAsync (531)   Task 'monitorAndHandleCoinjoinsTask' finished successfully.
2022-07-30 01:22:48.013 [22] INFO       Global.DisposeAsync (326)       WalletManager is stopped.
2022-07-30 01:22:48.016 [22] INFO       Global.DisposeAsync (337)       RpcServer is stopped.
2022-07-30 01:22:48.017 [22] INFO       Global.DisposeAsync (343)       CoinJoinProcessor is disposed.
2022-07-30 01:22:48.017 [22] INFO       Global.DisposeAsync (349)       Disposed LegalChecker.
2022-07-30 01:22:48.019 [10] INFO       HostedServices.StopAllAsync (88)        Stopped Software Update Checker.
2022-07-30 01:22:48.019 [22] DEBUG      TorMonitor.StopAsync (326)      Wait until Tor bootstrap monitor finishes.
2022-07-30 01:22:48.020 [10] INFO       HostedServices.StopAllAsync (88)        Stopped TorMonitor.
2022-07-30 01:22:48.020 [7] INFO        HostedServices.StopAllAsync (88)        Stopped Tor Network Checker.
2022-07-30 01:22:48.046 [22] INFO       P2pNetwork.StopAsync (173)      AddressManager is saved to `C:\Users\chihe\AppData\Roaming\WalletWasabi\Client\BitcoinP2pNetwork\AddressManagerTestNet.dat`.
2022-07-30 01:22:48.048 [10] INFO       HostedServices.StopAllAsync (88)        Stopped Blockstream.info Fee Provider.
2022-07-30 01:22:48.048 [7] INFO        HostedServices.StopAllAsync (88)        Stopped Bitcoin P2P Network.
2022-07-30 01:22:48.049 [7] INFO        HostedServices.StopAllAsync (88)        Stopped Third Party Fee Provider.
2022-07-30 01:22:48.050 [10] INFO       HostedServices.StopAllAsync (88)        Stopped Hybrid Fee Provider.
2022-07-30 01:22:48.050 [7] INFO        HostedServices.StopAllAsync (88)        Stopped Round info updater.
2022-07-30 01:22:48.050 [23] INFO       HostedServices.StopAllAsync (88)        Stopped Sleep Inhibitor.
2022-07-30 01:22:48.050 [9] INFO        HostedServices.StopAllAsync (88)        Stopped CoinJoin Manager.
2022-07-30 01:22:48.052 [9] INFO        HostedServices.Dispose (147)    Disposed Software Update Checker.
2022-07-30 01:22:48.053 [9] INFO        HostedServices.Dispose (147)    Disposed TorMonitor.
2022-07-30 01:22:48.053 [9] INFO        HostedServices.Dispose (147)    Disposed Tor Network Checker.
2022-07-30 01:22:48.054 [9] INFO        HostedServices.Dispose (147)    Disposed Bitcoin P2P Network.
2022-07-30 01:22:48.054 [9] INFO        HostedServices.Dispose (147)    Disposed Blockstream.info Fee Provider.
2022-07-30 01:22:48.055 [9] INFO        HostedServices.Dispose (147)    Disposed Third Party Fee Provider.
2022-07-30 01:22:48.055 [9] INFO        HostedServices.Dispose (147)    Disposed Round info updater.
2022-07-30 01:22:48.055 [9] INFO        HostedServices.Dispose (147)    Disposed CoinJoin Manager.
2022-07-30 01:22:48.056 [9] INFO        HostedServices.Dispose (147)    Disposed Sleep Inhibitor.
2022-07-30 01:22:48.056 [9] INFO        Global.DisposeAsync (357)       Stopped background services.
2022-07-30 01:22:48.057 [9] INFO        Global.DisposeAsync (361)       Disposed RoundStateUpdaterCircuit.
2022-07-30 01:22:48.077 [5] ERROR       WasabiSynchronizer.Start (247)  System.Net.Http.HttpRequestException: Failed to get/read an HTTP response from Tor.
 ---> WalletWasabi.Tor.Socks5.Exceptions.TorConnectionReadException: Could not read HTTP response.
 ---> WalletWasabi.Tor.Socks5.Exceptions.TorConnectionReadException: HTTP start-line is incomplete. Tor circuit probably died.
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.ReadStartLineAsync(Stream stream, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 43
   at WalletWasabi.Tor.Http.Extensions.HttpResponseMessageExtensions.CreateNewAsync(Stream responseStream, HttpMethod requestMethod, CancellationToken cancellationToken) in WalletWasabi\Tor\Http\Extensions\HttpResponseMessageExtensions.cs:line 39
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendCoreAsync(TorTcpConnection connection, HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 339
   --- End of inner exception stack trace ---
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendCoreAsync(TorTcpConnection connection, HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 343
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 126
   --- End of inner exception stack trace ---
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 154
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 86
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpMethod method, String relativeUri, HttpContent content, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 68
   at WalletWasabi.WebClients.Wasabi.WasabiClient.GetSynchronizeAsync(uint256 bestKnownBlockHash, Int32 count, Nullable`1 estimateMode, CancellationToken cancel) in WalletWasabi\WebClients\Wasabi\WasabiClient.cs:line 47
   at WalletWasabi.Services.WasabiSynchronizer.<>c__DisplayClass62_0.<<Start>b__0>d.MoveNext() in WalletWasabi\Services\WasabiSynchronizer.cs:line 143
2022-07-30 01:22:48.078 [5] DEBUG       WasabiSynchronizer.Start (269)  Synchronizer is fully stopped now.
2022-07-30 01:22:48.118 [9] INFO        Global.DisposeAsync (366)       Synchronizer is stopped.
2022-07-30 01:22:48.123 [9] INFO        Global.DisposeAsync (372)       HttpClientFactory is disposed.
2022-07-30 01:22:48.124 [9] INFO        Global.DisposeAsync (390)       TorStatusChecker is stopped.
2022-07-30 01:22:48.127 [9] INFO        Global.DisposeAsync (396)       TorManager is stopped.
2022-07-30 01:22:48.127 [9] INFO        Global.DisposeAsync (402)       Cache is disposed.

2- I get this error when I do the following:

  • Delete all the files under the WalletWasabi\Client\BitcoinStore\TestNet\IndexStore folder.
  • Start Wasabi (fluent)
  • Disconnecting my internet while it is downloading the filters
Click to expand and to see the logs!
2022-07-30 01:26:30.577 [30] INFO       FilterProcessor.ProcessAsync (59)       Downloaded filters for blocks from 908576 to 918575.
2022-07-30 01:26:52.464 [19] INFO       FilterProcessor.ProcessAsync (59)       Downloaded filters for blocks from 918576 to 928575.
2022-07-30 01:28:31.091 [36] ERROR      WasabiSynchronizer.Start (247)  System.Net.Http.HttpRequestException: Failed to get/read an HTTP response from Tor.
 ---> WalletWasabi.Tor.Socks5.Exceptions.TorConnectionReadException: Could not read HTTP response.
 ---> WalletWasabi.Tor.Socks5.Exceptions.TorConnectionReadException: Incomplete message. A Tor circuit probably died. Expected length: 2167. Actual: 1677.
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.ReadBytesTillLengthAsync(Stream stream, Int64 contentLength, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 448
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.GetDecodedChunkedContentBytesAsync(Stream stream, HttpRequestContentHeaders requestHeaders, HttpResponseContentHeaders responseHeaders, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 291
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.GetDecodedChunkedContentBytesAsync(Stream stream, HttpResponseContentHeaders headerStruct, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 240
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.GetContentBytesAsync(Stream stream, HttpResponseContentHeaders headerStruct, HttpMethod requestMethod, StatusLine statusLine, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 203
   at WalletWasabi.Tor.Http.Extensions.HttpResponseMessageExtensions.CreateNewAsync(Stream responseStream, HttpMethod requestMethod, CancellationToken cancellationToken) in WalletWasabi\Tor\Http\Extensions\HttpResponseMessageExtensions.cs:line 50
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendCoreAsync(TorTcpConnection connection, HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 339
   --- End of inner exception stack trace ---
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendCoreAsync(TorTcpConnection connection, HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 343
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 126
   --- End of inner exception stack trace ---
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 154
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 86
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpMethod method, String relativeUri, HttpContent content, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 68
   at WalletWasabi.WebClients.Wasabi.WasabiClient.GetSynchronizeAsync(uint256 bestKnownBlockHash, Int32 count, Nullable`1 estimateMode, CancellationToken cancel) in WalletWasabi\WebClients\Wasabi\WasabiClient.cs:line 47
   at WalletWasabi.Services.WasabiSynchronizer.<>c__DisplayClass62_0.<<Start>b__0>d.MoveNext() in WalletWasabi\Services\WasabiSynchronizer.cs:line 143
2022-07-30 01:28:31.095 [36] ERROR      WasabiSynchronizer.Start (247)  System.Net.Http.HttpRequestException: Failed to get/read an HTTP response from Tor.
 ---> WalletWasabi.Tor.Socks5.Exceptions.TorConnectionReadException: Could not read HTTP response.
 ---> System.IO.IOException: Unable to read data from the transport connection: An established connection was aborted by the software in your host machine..
 ---> System.Net.Sockets.SocketException (10053): An established connection was aborted by the software in your host machine.
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.CreateException(SocketError error, Boolean forAsyncThrow)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ReceiveAsync(Socket socket, CancellationToken cancellationToken)
   at System.Net.Sockets.NetworkStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
   at WalletWasabi.Extensions.StreamExtensions.ReadByteAsync(Stream stream, CancellationToken cancellationToken) in WalletWasabi\Extensions\StreamExtensions.cs:line 23
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at WalletWasabi.Extensions.StreamExtensions.ReadByteAsync(Stream stream, CancellationToken cancellationToken)
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.ReadStartLineAsync(Stream stream, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 37
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.ReadStartLineAsync(Stream stream, CancellationToken ctsToken)
   at WalletWasabi.Tor.Http.Extensions.HttpResponseMessageExtensions.CreateNewAsync(Stream responseStream, HttpMethod requestMethod, CancellationToken cancellationToken) in WalletWasabi\Tor\Http\Extensions\HttpResponseMessageExtensions.cs:line 39
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at WalletWasabi.Tor.Http.Extensions.HttpResponseMessageExtensions.CreateNewAsync(Stream responseStream, HttpMethod requestMethod, CancellationToken cancellationToken)
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendCoreAsync(TorTcpConnection connection, HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 339
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendCoreAsync(TorTcpConnection connection, HttpRequestMessage request, CancellationToken token)
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 126
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken)
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 86
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpRequestMessage request, CancellationToken token)
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpMethod method, String relativeUri, HttpContent content, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 68
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpMethod method, String relativeUri, HttpContent content, CancellationToken token)
   at WalletWasabi.WebClients.Wasabi.WasabiClient.GetSynchronizeAsync(uint256 bestKnownBlockHash, Int32 count, Nullable`1 estimateMode, CancellationToken cancel) in WalletWasabi\WebClients\Wasabi\WasabiClient.cs:line 47
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at WalletWasabi.WebClients.Wasabi.WasabiClient.GetSynchronizeAsync(uint256 bestKnownBlockHash, Int32 count, Nullable`1 estimateMode, CancellationToken cancel)
   at WalletWasabi.Services.WasabiSynchronizer.<>c__DisplayClass62_0.<<Start>b__0>d.MoveNext() in WalletWasabi\Services\WasabiSynchronizer.cs:line 143
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
   at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
   at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute)
   at System.Threading.Tasks.Task.TrySetException(Object exceptionObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception, Task`1& taskField)
   at WalletWasabi.WebClients.Wasabi.WasabiClient.GetSynchronizeAsync(uint256 bestKnownBlockHash, Int32 count, Nullable`1 estimateMode, CancellationToken cancel) in WalletWasabi\WebClients\Wasabi\WasabiClient.cs:line 47
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
   at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
   at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute)
   at System.Threading.Tasks.Task.TrySetException(Object exceptionObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception, Task`1& taskField)
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpMethod method, String relativeUri, HttpContent content, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 68
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
   at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
   at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute)
   at System.Threading.Tasks.Task.TrySetException(Object exceptionObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception, Task`1& taskField)
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 86
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
   at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
   at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute)
   at System.Threading.Tasks.Task.TrySetException(Object exceptionObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception, Task`1& taskField)
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 126
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
   at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
   at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute)
   at System.Threading.Tasks.Task.TrySetException(Object exceptionObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception, Task`1& taskField)
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendCoreAsync(TorTcpConnection connection, HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 339
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
   at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
   at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute)
   at System.Threading.Tasks.Task.TrySetException(Object exceptionObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception, Task`1& taskField)
   at WalletWasabi.Tor.Http.Extensions.HttpResponseMessageExtensions.CreateNewAsync(Stream responseStream, HttpMethod requestMethod, CancellationToken cancellationToken) in WalletWasabi\Tor\Http\Extensions\HttpResponseMessageExtensions.cs:line 50
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
   at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
   at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute)
   at System.Threading.Tasks.Task.TrySetException(Object exceptionObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception, Task`1& taskField)
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.GetContentBytesAsync(Stream stream, HttpResponseContentHeaders headerStruct, HttpMethod requestMethod, StatusLine statusLine, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 203
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
   at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
   at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute)
   at System.Threading.Tasks.Task.TrySetException(Object exceptionObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception, Task`1& taskField)
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.GetDecodedChunkedContentBytesAsync(Stream stream, HttpResponseContentHeaders headerStruct, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 240
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
   at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
   at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute)
   at System.Threading.Tasks.Task.TrySetException(Object exceptionObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception, Task`1& taskField)
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.GetDecodedChunkedContentBytesAsync(Stream stream, HttpRequestContentHeaders requestHeaders, HttpResponseContentHeaders responseHeaders, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 291
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
   at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
   at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute)
   at System.Threading.Tasks.Task.TrySetException(Object exceptionObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception, Task`1& taskField)
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.ReadBytesTillLengthAsync(Stream stream, Int64 contentLength, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 448
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
   at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetExistingTaskResult(Task`1 task, TResult result)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetResult(TResult result)
   at WalletWasabi.Extensions.StreamExtensions.ReadBlockAsync(Stream stream, Byte[] buffer, Int32 count, CancellationToken cancellationToken) in WalletWasabi\Extensions\StreamExtensions.cs:line 72
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.InvokeContinuation(Action`1 continuation, Object state, Boolean forceAsync, Boolean requiresExecutionContextFlow)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs _)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pNativeOverlapped)
--- End of stack trace from previous location ---

   --- End of inner exception stack trace ---
   at WalletWasabi.Extensions.StreamExtensions.ReadByteAsync(Stream stream, CancellationToken cancellationToken) in WalletWasabi\Extensions\StreamExtensions.cs:line 23
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.ReadStartLineAsync(Stream stream, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 37
   at WalletWasabi.Tor.Http.Extensions.HttpResponseMessageExtensions.CreateNewAsync(Stream responseStream, HttpMethod requestMethod, CancellationToken cancellationToken) in WalletWasabi\Tor\Http\Extensions\HttpResponseMessageExtensions.cs:line 39
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendCoreAsync(TorTcpConnection connection, HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 339
   --- End of inner exception stack trace ---
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendCoreAsync(TorTcpConnection connection, HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 343
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 126
   --- End of inner exception stack trace ---
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 154
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 86
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpMethod method, String relativeUri, HttpContent content, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 68
   at WalletWasabi.WebClients.Wasabi.WasabiClient.GetSynchronizeAsync(uint256 bestKnownBlockHash, Int32 count, Nullable`1 estimateMode, CancellationToken cancel) in WalletWasabi\WebClients\Wasabi\WasabiClient.cs:line 47
   at WalletWasabi.Services.WasabiSynchronizer.<>c__DisplayClass62_0.<<Start>b__0>d.MoveNext() in WalletWasabi\Services\WasabiSynchronizer.cs:line 143
2022-07-30 01:28:36.268 [1] DEBUG       TerminateService.Terminate (102)        Start shutting down the application.
2022-07-30 01:28:36.271 [35] INFO       Program.TerminateApplicationAsync (202) Wasabi GUI stopped gracefully (2c4e271e-cdd0-4dac-9da1-52c774cfb8b1).
2022-07-30 01:28:36.274 [35] INFO       CoinJoinManager.WaitAndHandleResultOfTasksAsync (535)   Task 'walletsMonitoringTask' finished successfully by cancellation.
2022-07-30 01:28:36.274 [35] WARNING    Global.DisposeAsync (318)       Process is exiting.
2022-07-30 01:28:36.274 [3] INFO        CoinJoinManager.WaitAndHandleResultOfTasksAsync (535)   Task 'commandsHandlingTask' finished successfully by cancellation.
2022-07-30 01:28:36.275 [33] DEBUG      TorMonitor.MonitorEventsAsync (188)     Tor Monitor is stopping.
2022-07-30 01:28:36.275 [18] DEBUG      TorProcessManager.RestartingLoopAsync (159)     User canceled operation.
2022-07-30 01:28:36.275 [3] INFO        CoinJoinManager.WaitAndHandleResultOfTasksAsync (535)   Task 'monitorCoinJoinTask' finished successfully by cancellation.
2022-07-30 01:28:36.277 [3] INFO        CoinJoinManager.WaitAndHandleResultOfTasksAsync (531)   Task 'monitorAndHandleCoinjoinsTask' finished successfully.
2022-07-30 01:28:36.276 [35] INFO       Global.DisposeAsync (326)       WalletManager is stopped.
2022-07-30 01:28:36.279 [39] ERROR      PeriodicRunner.ExecuteAsync (99)        System.AggregateException: One or more errors occurred. (Failed to get/read an HTTP response from Tor.) (The operation was canceled.) (A task was canceled.)
 ---> System.Net.Http.HttpRequestException: Failed to get/read an HTTP response from Tor.
 ---> WalletWasabi.Tor.Socks5.Exceptions.TorConnectionReadException: Could not read HTTP response.
 ---> WalletWasabi.Tor.Socks5.Exceptions.TorConnectionReadException: HTTP start-line is incomplete. Tor circuit probably died.
   at WalletWasabi.Tor.Http.Helpers.HttpMessageHelper.ReadStartLineAsync(Stream stream, CancellationToken ctsToken) in WalletWasabi\Tor\Http\Helpers\HttpMessageHelper.cs:line 43
   at WalletWasabi.Tor.Http.Extensions.HttpResponseMessageExtensions.CreateNewAsync(Stream responseStream, HttpMethod requestMethod, CancellationToken cancellationToken) in WalletWasabi\Tor\Http\Extensions\HttpResponseMessageExtensions.cs:line 39
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendCoreAsync(TorTcpConnection connection, HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 339
   --- End of inner exception stack trace ---
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendCoreAsync(TorTcpConnection connection, HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 343
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 126
   --- End of inner exception stack trace ---
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 154
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 86
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpMethod method, String relativeUri, HttpContent content, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 68
   at WalletWasabi.WabiSabi.Client.WabiSabiHttpApiClient.SendWithRetriesAsync(RemoteAction action, String jsonString, CancellationToken cancellationToken) in WalletWasabi\WabiSabi\Client\WabiSabiHttpApiClient.cs:line 81
   --- End of inner exception stack trace ---
   at WalletWasabi.WabiSabi.Client.WabiSabiHttpApiClient.SendWithRetriesAsync(RemoteAction action, String jsonString, CancellationToken cancellationToken) in WalletWasabi\WabiSabi\Client\WabiSabiHttpApiClient.cs:line 145
   at WalletWasabi.WabiSabi.Client.WabiSabiHttpApiClient.SendWithRetriesAsync[TRequest](RemoteAction action, TRequest request, CancellationToken cancellationToken) in WalletWasabi\WabiSabi\Client\WabiSabiHttpApiClient.cs:line 165
   at WalletWasabi.WabiSabi.Client.WabiSabiHttpApiClient.SendAndReceiveAsync[TRequest,TResponse](RemoteAction action, TRequest request, CancellationToken cancellationToken) in WalletWasabi\WabiSabi\Client\WabiSabiHttpApiClient.cs:line 182
   at WalletWasabi.WabiSabi.Client.RoundStateAwaiters.RoundStateUpdater.ActionAsync(CancellationToken cancellationToken) in WalletWasabi\WabiSabi\Client\RoundStateAwaiters\RoundStateUpdater.cs:line 36
   at WalletWasabi.Bases.PeriodicRunner.ExecuteAsync(CancellationToken stoppingToken) in WalletWasabi\Bases\PeriodicRunner.cs:line 75
 ---> (Inner Exception #1) System.OperationCanceledException: The operation was canceled.
   at System.Threading.CancellationToken.ThrowOperationCanceledException()
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
   at WalletWasabi.Extensions.StreamExtensions.ReadByteAsync(Stream stream, CancellationToken cancellationToken) in WalletWasabi\Extensions\StreamExtensions.cs:line 23
   at WalletWasabi.Tor.Socks5.TorTcpConnectionFactory.ReadRequestResponseAsync(NetworkStream stream, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\TorTcpConnectionFactory.cs:line 350
   at WalletWasabi.Tor.Socks5.TorTcpConnectionFactory.SendRequestAsync(TcpClient tcpClient, ByteArraySerializableBase request, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\TorTcpConnectionFactory.cs:line 320
   at WalletWasabi.Tor.Socks5.TorTcpConnectionFactory.ConnectToDestinationAsync(TcpClient tcpClient, String host, Int32 port, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\TorTcpConnectionFactory.cs:line 251
   at WalletWasabi.Tor.Socks5.TorTcpConnectionFactory.ConnectAsync(String host, Int32 port, Boolean useSsl, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\TorTcpConnectionFactory.cs:line 97
   at WalletWasabi.Tor.Socks5.TorTcpConnectionFactory.ConnectAsync(Uri requestUri, ICircuit circuit, CancellationToken token) in WalletWasabi\Tor\Socks5\TorTcpConnectionFactory.cs:line 57
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.CreateNewConnectionAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 288
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.ObtainFreeConnectionAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken token) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 261
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 122
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 86
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpMethod method, String relativeUri, HttpContent content, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 68
   at WalletWasabi.WabiSabi.Client.WabiSabiHttpApiClient.SendWithRetriesAsync(RemoteAction action, String jsonString, CancellationToken cancellationToken) in WalletWasabi\WabiSabi\Client\WabiSabiHttpApiClient.cs:line 81<---

 ---> (Inner Exception #2) System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at WalletWasabi.WabiSabi.Client.WabiSabiHttpApiClient.SendWithRetriesAsync(RemoteAction action, String jsonString, CancellationToken cancellationToken) in WalletWasabi\WabiSabi\Client\WabiSabiHttpApiClient.cs:line 134<---
2022-07-30 01:28:36.279 [35] INFO       Global.DisposeAsync (337)       RpcServer is stopped.
2022-07-30 01:28:36.281 [35] INFO       Global.DisposeAsync (343)       CoinJoinProcessor is disposed.
2022-07-30 01:28:36.281 [35] INFO       Global.DisposeAsync (349)       Disposed LegalChecker.
2022-07-30 01:28:36.283 [3] INFO        HostedServices.StopAllAsync (88)        Stopped Software Update Checker.
2022-07-30 01:28:36.283 [35] DEBUG      TorMonitor.StopAsync (326)      Wait until Tor bootstrap monitor finishes.
2022-07-30 01:28:36.284 [18] INFO       HostedServices.StopAllAsync (88)        Stopped TorMonitor.
2022-07-30 01:28:36.284 [33] INFO       HostedServices.StopAllAsync (88)        Stopped Tor Network Checker.
2022-07-30 01:28:36.299 [39] DEBUG      TorHttpPool.CreateNewConnectionAsync (293)      ['http://testwnp3fugjln6vh5vpj7mvq3lkqqwjj3c2aafyu7laxz42kgwh2rad.onion/api/v4/btc/batch/synchronize?bestKnownBlockHash=00000000000000554b32283c107179b8f5263e9798d2a7dd943f18c7d2624559&maxNumberOfFilters=10000&estimateSmartFeeMode=Conservative'][ERROR] Failed to create a new pool connection. Exception: WalletWasabi.Tor.Socks5.Exceptions.TorConnectionException: Failed to read first four bytes from the SOCKS5 response.
   at WalletWasabi.Tor.Socks5.TorTcpConnectionFactory.ReadRequestResponseAsync(NetworkStream stream, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\TorTcpConnectionFactory.cs:line 354
   at WalletWasabi.Tor.Socks5.TorTcpConnectionFactory.SendRequestAsync(TcpClient tcpClient, ByteArraySerializableBase request, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\TorTcpConnectionFactory.cs:line 320
   at WalletWasabi.Tor.Socks5.TorTcpConnectionFactory.ConnectToDestinationAsync(TcpClient tcpClient, String host, Int32 port, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\TorTcpConnectionFactory.cs:line 251
   at WalletWasabi.Tor.Socks5.TorTcpConnectionFactory.ConnectAsync(String host, Int32 port, Boolean useSsl, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\TorTcpConnectionFactory.cs:line 97
   at WalletWasabi.Tor.Socks5.TorTcpConnectionFactory.ConnectAsync(Uri requestUri, ICircuit circuit, CancellationToken token) in WalletWasabi\Tor\Socks5\TorTcpConnectionFactory.cs:line 57
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.CreateNewConnectionAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 288
2022-07-30 01:28:36.302 [39] ERROR      WasabiSynchronizer.Start (231)  WalletWasabi.Tor.Socks5.Exceptions.TorConnectionException: Failed to read first four bytes from the SOCKS5 response.
   at WalletWasabi.Tor.Socks5.TorTcpConnectionFactory.ReadRequestResponseAsync(NetworkStream stream, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\TorTcpConnectionFactory.cs:line 354
   at WalletWasabi.Tor.Socks5.TorTcpConnectionFactory.SendRequestAsync(TcpClient tcpClient, ByteArraySerializableBase request, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\TorTcpConnectionFactory.cs:line 320
   at WalletWasabi.Tor.Socks5.TorTcpConnectionFactory.ConnectToDestinationAsync(TcpClient tcpClient, String host, Int32 port, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\TorTcpConnectionFactory.cs:line 251
   at WalletWasabi.Tor.Socks5.TorTcpConnectionFactory.ConnectAsync(String host, Int32 port, Boolean useSsl, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\TorTcpConnectionFactory.cs:line 97
   at WalletWasabi.Tor.Socks5.TorTcpConnectionFactory.ConnectAsync(Uri requestUri, ICircuit circuit, CancellationToken token) in WalletWasabi\Tor\Socks5\TorTcpConnectionFactory.cs:line 57
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.CreateNewConnectionAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 288
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.ObtainFreeConnectionAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken token) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 261
   at WalletWasabi.Tor.Socks5.Pool.TorHttpPool.SendAsync(HttpRequestMessage request, ICircuit circuit, CancellationToken cancellationToken) in WalletWasabi\Tor\Socks5\Pool\TorHttpPool.cs:line 122
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpRequestMessage request, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 86
   at WalletWasabi.Tor.Http.TorHttpClient.SendAsync(HttpMethod method, String relativeUri, HttpContent content, CancellationToken token) in WalletWasabi\Tor\Http\TorHttpClient.cs:line 68
   at WalletWasabi.WebClients.Wasabi.WasabiClient.GetSynchronizeAsync(uint256 bestKnownBlockHash, Int32 count, Nullable`1 estimateMode, CancellationToken cancel) in WalletWasabi\WebClients\Wasabi\WasabiClient.cs:line 47
   at WalletWasabi.Services.WasabiSynchronizer.<>c__DisplayClass62_0.<<Start>b__0>d.MoveNext() in WalletWasabi\Services\WasabiSynchronizer.cs:line 143
2022-07-30 01:28:36.308 [35] INFO       P2pNetwork.StopAsync (173)      AddressManager is saved to `C:\Users\chihe\AppData\Roaming\WalletWasabi\Client\BitcoinP2pNetwork\AddressManagerTestNet.dat`.
2022-07-30 01:28:36.310 [41] INFO       HostedServices.StopAllAsync (88)        Stopped Bitcoin P2P Network.
2022-07-30 01:28:36.310 [22] INFO       HostedServices.StopAllAsync (88)        Stopped Blockstream.info Fee Provider.
2022-07-30 01:28:36.312 [22] INFO       HostedServices.StopAllAsync (88)        Stopped Third Party Fee Provider.
2022-07-30 01:28:36.313 [41] INFO       HostedServices.StopAllAsync (88)        Stopped Hybrid Fee Provider.
2022-07-30 01:28:36.313 [22] INFO       HostedServices.StopAllAsync (88)        Stopped Round info updater.
2022-07-30 01:28:36.313 [18] INFO       HostedServices.StopAllAsync (88)        Stopped CoinJoin Manager.
2022-07-30 01:28:36.313 [33] INFO       HostedServices.StopAllAsync (88)        Stopped Sleep Inhibitor.
2022-07-30 01:28:36.315 [33] INFO       HostedServices.Dispose (147)    Disposed Software Update Checker.
2022-07-30 01:28:36.317 [33] INFO       HostedServices.Dispose (147)    Disposed TorMonitor.
2022-07-30 01:28:36.318 [33] INFO       HostedServices.Dispose (147)    Disposed Tor Network Checker.
2022-07-30 01:28:36.318 [2] DEBUG       Program.TaskScheduler_UnobservedTaskException (218)     System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (The I/O operation has been aborted because of either a thread exit or an application request.)
 ---> System.Net.HttpListenerException (995): The I/O operation has been aborted because of either a thread exit or an application request.
   at System.Net.HttpListener.EndGetContext(IAsyncResult asyncResult)
   at System.Net.HttpListener.<>c.<GetContextAsync>b__44_1(IAsyncResult iar)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
   --- End of inner exception stack trace ---
2022-07-30 01:28:36.319 [33] INFO       HostedServices.Dispose (147)    Disposed Bitcoin P2P Network.
2022-07-30 01:28:36.320 [33] INFO       HostedServices.Dispose (147)    Disposed Blockstream.info Fee Provider.
2022-07-30 01:28:36.321 [33] INFO       HostedServices.Dispose (147)    Disposed Third Party Fee Provider.
2022-07-30 01:28:36.321 [33] INFO       HostedServices.Dispose (147)    Disposed Round info updater.
2022-07-30 01:28:36.321 [33] INFO       HostedServices.Dispose (147)    Disposed CoinJoin Manager.
2022-07-30 01:28:36.322 [33] INFO       HostedServices.Dispose (147)    Disposed Sleep Inhibitor.
2022-07-30 01:28:36.322 [33] INFO       Global.DisposeAsync (357)       Stopped background services.
2022-07-30 01:28:36.322 [33] INFO       Global.DisposeAsync (361)       Disposed RoundStateUpdaterCircuit.
2022-07-30 01:28:36.323 [33] DEBUG      WasabiSynchronizer.Start (269)  Synchronizer is fully stopped now.
2022-07-30 01:28:36.324 [33] INFO       Global.DisposeAsync (366)       Synchronizer is stopped.
2022-07-30 01:28:36.325 [33] INFO       Global.DisposeAsync (372)       HttpClientFactory is disposed.
2022-07-30 01:28:36.325 [33] INFO       Global.DisposeAsync (390)       TorStatusChecker is stopped.
2022-07-30 01:28:36.326 [33] INFO       Global.DisposeAsync (396)       TorManager is stopped.
2022-07-30 01:28:36.327 [33] INFO       Global.DisposeAsync (402)       Cache is disposed.
2022-07-30 01:28:36.327 [33] INFO       Global.DisposeAsync (408)       IndexStore is disposed.

{
TorDoesntWorkSince = DateTimeOffset.UtcNow;
}
TorDoesntWorkSince ??= DateTimeOffset.UtcNow;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: fixes an analyzer error

Copy link
Collaborator

@molnard molnard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@molnard molnard merged commit d8804dc into zkSNACKs:master Aug 1, 2022
@kiminuo kiminuo deleted the feature/2022-07-28-HttpMessageHelper-Fix branch August 1, 2022 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants