zenprotocol/zen-wallet

Discovery error with peer: NBitcoin.Protocol.NetworkAddress OperationCanceledException: The operation was canceled

gsdean opened this issue · 12 comments

following the instructions for OSX (https://www.zenprotocol.com/alpha).

Full Stack:
Network(E) Discovery error with peer: NBitcoin.Protocol.NetworkAddress OperationCanceledException: The operation was canceled. at System.Collections.Concurrent.BlockingCollection1[T].TryTakeWithNoTimeValidation (T& item, System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken, System.Threading.CancellationTokenSource combinedTokenSource) [0x0008e] in <5afdc70d980c4033b3878286f754d091>:0 at System.Collections.Concurrent.BlockingCollection1[T].TryTake (T& item, System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00006] in <5afdc70d980c4033b3878286f754d091>:0
at System.Collections.Concurrent.BlockingCollection1[T].Take (System.Threading.CancellationToken cancellationToken) [0x00000] in <5afdc70d980c4033b3878286f754d091>:0 at NBitcoin.Protocol.PollMessageListener1[T].ReceiveMessage (System.Threading.CancellationToken cancellationToken) [0x00006] in :0
at NBitcoin.Protocol.NodeListener.ReceivePayload[TPayload] (System.Threading.CancellationToken cancellationToken) [0x000d1] in :0
at NBitcoin.Protocol.Node.VersionHandshake (NBitcoin.Protocol.NodeRequirement requirements, System.Threading.CancellationToken cancellationToken) [0x00044] in :0
at NBitcoin.Protocol.Node.VersionHandshake (System.Threading.CancellationToken cancellationToken) [0x00000] in :0
at NBitcoin.Protocol.AddressManager+<>c__DisplayClass70_0.b__1 (NBitcoin.Protocol.NetworkAddress p) [0x00086] in :0

Thanks. We're overhauling the network code, which should fix this bug. We've restarted the seed peers so you should be able to connect in the mean time.

Douvi commented

got the same issue here

Douvi commented

The app started back to connect

got the same issue here

here is the same error

The app could connect to peer now, though it still generated an error msg beforehand:
Network(E) Error while OnMessageReceived event raised SocketException: Operation not supported at System.Net.IPAddress.get_Address () [0x00014] in :0
at NBitcoin.Protocol.AddressManager.ContainsAddress (System.Net.IPAddress address) [0x0001a] in :0
at NBitcoin.Protocol.AddressManager.Add (System.Collections.Generic.IEnumerable1[T] vAddr, System.Net.IPAddress source, System.TimeSpan nTimePenalty) [0x00037] in <bb37feab734942c999a26765ef4da255>:0 at NBitcoin.Protocol.AddressManager.Add (System.Collections.Generic.IEnumerable1[T] vAddr, System.Net.IPAddress source) [0x00011] in :0
at NBitcoin.Protocol.Behaviors.AddressManagerBehavior+<>c__DisplayClass16_0.<AttachedNode_MessageReceived>b__2 (NBitcoin.Protocol.AddrPayload addr) [0x00081] in :0
at NBitcoin.Protocol.Message.IfPayloadIs[T] (System.Action`1[T] action) [0x00019] in :0
at NBitcoin.Protocol.Behaviors.AddressManagerBehavior.AttachedNode_MessageReceived (NBitcoin.Protocol.Node node, NBitcoin.Protocol.IncomingMessage message) [0x0003b] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <4fdc5ed61a074cafb49fa42deb20d521>:0
I guess it might just be timing issue: the depended service didn't start the first time, then it started, and thus connection is ok...

Douvi commented
Network Information: 0 : Disconnection request 
Network Information: 0 : State changed from Connected to Disconnecting
Network Information: 0 : Need 1 more peers
Network Information: 0 : Stop sending
Network Information: 0 : State changed from Disconnecting to Offline
Network Information: 0 : Stop listening
Network Information: 0 : Remaining peer to get : 1
Network Information: 0 : State changed from Offline to Connected
Network Information: 0 : Outbound connection successfull
Network Information: 0 : Listening
Network Error: 0 : Discovery error with peer: NBitcoin.Protocol.NetworkAddress OperationCanceledException: The operation was canceled.  at System.Collections.Concurrent.BlockingCollection`1[T].TryTakeWithNoTimeValidation (T& item, System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken, System.Threading.CancellationTokenSource combinedTokenSource) [0x0008e] in <5afdc70d980c4033b3878286f754d091>:0 
  at System.Collections.Concurrent.BlockingCollection`1[T].TryTake (T& item, System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00006] in <5afdc70d980c4033b3878286f754d091>:0 
  at System.Collections.Concurrent.BlockingCollection`1[T].Take (System.Threading.CancellationToken cancellationToken) [0x00000] in <5afdc70d980c4033b3878286f754d091>:0 
  at NBitcoin.Protocol.PollMessageListener`1[T].ReceiveMessage (System.Threading.CancellationToken cancellationToken) [0x00006] in <c79239f051444075b68b7920aba1b848>:0 
  at NBitcoin.Protocol.NodeListener.ReceivePayload[TPayload] (System.Threading.CancellationToken cancellationToken) [0x000d1] in <c79239f051444075b68b7920aba1b848>:0 
  at NBitcoin.Protocol.Node.VersionHandshake (NBitcoin.Protocol.NodeRequirement requirements, System.Threading.CancellationToken cancellationToken) [0x00044] in <c79239f051444075b68b7920aba1b848>:0 
  at NBitcoin.Protocol.Node.VersionHandshake (System.Threading.CancellationToken cancellationToken) [0x00000] in <c79239f051444075b68b7920aba1b848>:0 
  at NBitcoin.Protocol.AddressManager+<>c__DisplayClass70_0.<DiscoverPeers>b__1 (NBitcoin.Protocol.NetworkAddress p) [0x00086] in <c79239f051444075b68b7920aba1b848>:0 

I notify when you open the app it's allwayse fail to get the connection. But after a time X it will successed connect

@pw96pw96pw96 - new binaries are available for download which should fix the issue you encountered

@Douvi this is not actually a bug or an error, it's just that the trace shouldn't be printing that. it's printed when a connection cant be established with a peer that's listed in the node's address list

@UrbanSharon - It will be helpful if instructions on how to build and run from source could be given. Anyway, thank you for fixing the issue.

@UrbanSharon I sent some Zen via the faucet into address 14eh93uk/Nfogl/NiyHVpwzxCXPz6Z8kv/CRMFVzaCr0=. But when I opened the wallet/portfolio, it says "Discovering peers: 0%" See screenshot. My node started via mono zen.exe -m is running fine.
screen shot 2017-11-20 at 3 42 22 pm

@UrbanSharon After leaving the wallet open for a long time, it can show the balance now. I guess it was because the wallet was downloading all the blocks. Issue resolved. Thx.