Connection unexpectedly failed: Unexpected exception while connecting to socket
See original GitHub issueSince yesterday (apparently at block height 774627), I’m getting the same error as in #170, but with the problem and solution therein definitely not applying to my setup.
I had been running NBXplorer for BTCPayServer for years now, and when this exception first appeared it was on version 2.2.20
. So the first thing I tried was upgrading to 2.3.58
, and subsequently upgrading bitcoind from 23.0
to 24.0.1
. However, the exception persists and it’s unable keep a connection open to bitcoind apparently. The full log looks like this:
info: Configuration: BTC: Full node version detected: 240001
info: Configuration: BTC: Node banlist loaded
info: Configuration: BTC: Loading chain from cache...
info: Configuration: BTC: Height: 774835
info: Configuration: BTC: Trying to connect via the P2P protocol to trusted node (127.0.0.1:8333)...
info: Explorer: BTC: TCP Connection succeed, handshaking...
info: Explorer: BTC: Handshaked
info: Configuration: BTC: Loading chain from node
info: Explorer: BTC: Loading chain...
info: Explorer: BTC: Chain loaded
info: Explorer: BTC: NBXplorer is correctly whitelisted by the node
info: Configuration: BTC: Height: 774836
info: Configuration: BTC: Saving chain to cache...
info: Configuration: BTC: Chain cached
info: Explorer: BTC: Handshaked node
info: Explorer: BTC: Starting scan at block 774627
info: Events: BTC: Node state changed: NotStarted => NBXplorerSynching
fail: Explorer: BTC: Connection unexpectedly failed: Unexpected exception while connecting to socket
info: Events: BTC: Node state changed: NBXplorerSynching => NotStarted
info: Configuration: BTC: Testing RPC connection to http://127.0.0.1:8332/
fail: Explorer: BTC: Unhandled error in IndexBlockLoop
fail: Explorer: System.OperationCanceledException: The peer has been disconnected
at NBXplorer.BlockDownloader.DownloadBlocks(BlockLocator fork, CancellationToken cancellationToken)+MoveNext() in /opt/nbxplorer/NBXplorer/BlockDownloader.cs:line 57
at NBXplorer.BlockDownloader.DownloadBlocks(BlockLocator fork, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
at NBXplorer.ExplorerBehavior.IndexBlockLoop(Node node, CancellationToken cancellationToken) in /opt/nbxplorer/NBXplorer/ExplorerBehavior.cs:line 319
at NBXplorer.ExplorerBehavior.IndexBlockLoop(Node node, CancellationToken cancellationToken) in /opt/nbxplorer/NBXplorer/ExplorerBehavior.cs:line 319
info: Configuration: BTC: RPC connection successful
info: Configuration: BTC: Full node version detected: 240001
info: Configuration: BTC: Loading chain from cache...
Issue Analytics
- State:
- Created 8 months ago
- Reactions:5
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Unexpected exception while connecting to socket · Issue ...
Describe the problem/bug. Connection unexpectedly failed: Unexpected exception while connecting to socket in NBXplorer logs
Read more >Why do my TCP clients fail to connect to my server with a ...
"No connection could be made because the target machine actively refused it" - the server can hold only so many clients in its...
Read more >Troubleshooting connection issues
IO client will always try to reconnect, unless specifically told otherwise. Let's review how you can troubleshoot a connection failure.
Read more >PostgreSQL Error: server closed the connection ...
I get the same error when I try connecting from psql . I have got this error 2 days ago but after restarting...
Read more >DataDirect What does a "socket closed" error mean with an ...
A "socket closed" error means that the connection has been terminated, however, no specific reason was provided/returned.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
2.3.60
didn’t fix it for me. But migrating to Postgres worked.Thanks. 🙏
Also you can try
v2.3.60
that I just pushed, that may solve your issue on the old backend. But once again, I advise you to use a postgres backend.To migrate, use env variables: (you can keep them after migrating without issue)
If you run btcpay with you get more feature using the new backend: