ArchiSteamFarm: FATAL errors on websocket hiccups

https://github.com/SteamRE/SteamKit/issues/426

2017-08-12 23:21:23|ArchiSteamFarm-9707|FATAL|ASF|OnUnobservedTaskException() 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 remote party closed the WebSocket connection without completing the close handshake.) ---> System.Net.WebSockets.WebSocketException: The remote party closed the WebSocket connection without completing the close handshake. ---> System.IO.IOException: Unable to transfer data on the transport connection: Broken pipe. ---> System.Net.Sockets.SocketException: Broken pipe
   --- End of inner exception stack trace ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Net.Security.SslStreamInternal.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslStreamInternal.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, LazyAsyncResult asyncResult)
   at System.Net.Security.SslStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback asyncCallback, Object asyncState)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMethod, Func`3 endMethod)
   at System.IO.Stream.BeginEndWriteAsync(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
   at System.Net.WebSockets.ManagedWebSocket.SendFrameLockAcquiredNonCancelableAsync(MessageOpcode opcode, Boolean endOfMessage, ArraySegment`1 payloadBuffer)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake. ---> System.IO.IOException: Unable to transfer data on the transport connection: Broken pipe. ---> System.Net.Sockets.SocketException: Broken pipe
   --- End of inner exception stack trace ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Net.Security.SslStreamInternal.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslStreamInternal.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, LazyAsyncResult asyncResult)
   at System.Net.Security.SslStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback asyncCallback, Object asyncState)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncTrim[TInstance,TArgs](TInstance thisRef, TArgs args, Func`5 beginMethod, Func`3 endMethod)
   at System.IO.Stream.BeginEndWriteAsync(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.Stream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
   at System.Net.WebSockets.ManagedWebSocket.SendFrameLockAcquiredNonCancelableAsync(MessageOpcode opcode, Boolean endOfMessage, ArraySegment`1 payloadBuffer)<---

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 39 (21 by maintainers)

Most upvoted comments

sorry.i understand. you mean is that I need to wait for the dotnet core team to update the runtime to fix this problem

This issue should be fixed since ASF V3.0.2.0 onwards (which implementes alpha7 version of SK2 2.0). If you want to help, please ensure that you’re using ASF V3.0.2.0 and your SteamProtocols setting in ASF.json is set to 4 (websocket). If you spot any unhandled exceptions related to networking or websockets, especially similar to above, please let me know. Thanks!

“SteamProtocols”: 1, but:

2018-02-05 08:40:16|ArchiSteamFarm-7725|FATAL|ASF|OnUnobservedTaskException() 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 remote party closed the WebSocket connection without completing the close handshake.) ---> System.Net.WebSockets.WebSocketException: The remote party closed the WebSocket connection without completing the close handshake. ---> System.IO.IOException: Unable to write data to the transport connection: The lazily-initialized type does not have a public, parameterless constructor.. ---> System.MissingMemberException: The lazily-initialized type does not have a public, parameterless constructor.
   at System.Threading.LazyHelpers`1.ActivatorFactorySelector()
   at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Func`1 valueFactory)
   at System.Net.Sockets.Socket.RentSocketAsyncEventArgs(Boolean isReceive)
   at System.Net.Sockets.Socket.SendAsync(ArraySegment`1 buffer, SocketFlags socketFlags, Boolean fromNetworkStream)
   at System.Net.Sockets.NetworkStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 size, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 size, CancellationToken cancellationToken)
   at System.Net.WebSockets.ManagedWebSocket.SendFrameLockAcquiredNonCancelableAsync(MessageOpcode opcode, Boolean endOfMessage, ArraySegment`1 payloadBuffer)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake. ---> System.IO.IOException: Unable to write data to the transport connection: The lazily-initialized type does not have a public, parameterless constructor.. ---> System.MissingMemberException: The lazily-initialized type does not have a public, parameterless constructor.
   at System.Threading.LazyHelpers`1.ActivatorFactorySelector()
   at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Func`1 valueFactory)
   at System.Net.Sockets.Socket.RentSocketAsyncEventArgs(Boolean isReceive)
   at System.Net.Sockets.Socket.SendAsync(ArraySegment`1 buffer, SocketFlags socketFlags, Boolean fromNetworkStream)
   at System.Net.Sockets.NetworkStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 size, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 size, CancellationToken cancellationToken)
   at System.Net.WebSockets.ManagedWebSocket.SendFrameLockAcquiredNonCancelableAsync(MessageOpcode opcode, Boolean endOfMessage, ArraySegment`1 payloadBuffer)<---

ASF Version 3.1.0.0, under Debian 8

CentOS 7 x64

It crashes the sockets because you’re using experimental unsupported configuration, which is hitting exactly the issue we’re resolving here. If you’re expecting stable experience then don’t use pre-releases and pre-release settings. If on the other hand you want to help the development, then don’t complain and provide constructive feedback, like @GUiHKX is doing all the time, helping me greatly to solve all remaining ASF issues.

Pre-release is not “faster stable”. Either you want to help the development, or you should not use it. And if you want to help, then you shouldn’t make it harder for me. A simple “I’ve encountered the same issue on ASF V3.0.2.4” would be enough.

Looks like that won’t be needed as Windows uses different implementation. Let’s just wait for corefx devs response now.

It doesn’t necessarily have to be anything connected with custom build itself, as the issue seems generic enough to not look like a fuckup, but I prefer to fill missing details so we confirm that it’s indeed corefx issue.

I’ll report it to corefx guys, while you should still ensure that you can reproduce it on Windows, thanks.

I share the ASF installation between Linux and Windows (I have them installed in dual boot). Last crash happened while I was using Arch Linux x64:

$ dotnet --info

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

DLL version:

asf

Now being more specific: I have Windows 10 Enterprise 64-bit and Arch Linux 64-bit, both partitioned in the same SSD disk, in dual boot. I use ASF-generic and it lies within the Windows partition, specifically in C:\Users\ME\Downloads\ASF\. So, when I’m using Linux, I mount the Windows partition to run ASF.

It has happened again. I’m sorry for the huge 2MB file, but it took me too long to notice those errors. Anyway, here it is:

https://gist.githubusercontent.com/GUiHKX/822bf93ea5bec76eb3cea72b45a50880/raw/c9458854fd0a060d9e7ea610daa66904c075b40f/log.txt

Bug hunting continues with 3.0.2.3.

If you want to help, please ensure that you’re using ASF V3.0.2.3 and your SteamProtocols setting in ASF.json is set to 4 (websocket). If you spot any unhandled exceptions related to networking or websockets, especially similar to above, please let me know. Thanks!

I have one more log file to share, thanks to my shitty internet. This one was generated on Windows, so that’s why isn’t in english… Maybe I’ve got a new error as well? (At least I couldn’t find this message in the previous log I sent):

2017-08-30 22:59:06|dotnet-7144|FATAL|ASF|OnUnobservedTaskException() 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. (There is already one outstanding 'ReceiveAsync' call for this WebSocket instance. ReceiveAsync and SendAsync can be called simultaneously, but at most one outstanding operation for each of them is allowed at the same time.) ---> System.InvalidOperationException: There is already one outstanding 'ReceiveAsync' call for this WebSocket instance. ReceiveAsync and SendAsync can be called simultaneously, but at most one outstanding operation for each of them is allowed at the same time.
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at System.Net.WebSockets.WinHttpWebSocket.<ReceiveAsync>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SteamKit2.WebSocketConnection.WebSocketContext.<ReadMessageAsync>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SteamKit2.WebSocketConnection.WebSocketContext.<RunCore>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SteamKit2.WebSocketConnection.WebSocketContext.Dispose()
   at SteamKit2.WebSocketConnection.DisconnectCore(Boolean userInitiated, WebSocketContext specificContext)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.InvalidOperationException: There is already one outstanding 'ReceiveAsync' call for this WebSocket instance. ReceiveAsync and SendAsync can be called simultaneously, but at most one outstanding operation for each of them is allowed at the same time.
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at System.Net.WebSockets.WinHttpWebSocket.<ReceiveAsync>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SteamKit2.WebSocketConnection.WebSocketContext.<ReadMessageAsync>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SteamKit2.WebSocketConnection.WebSocketContext.<RunCore>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SteamKit2.WebSocketConnection.WebSocketContext.Dispose()
   at SteamKit2.WebSocketConnection.DisconnectCore(Boolean userInitiated, WebSocketContext specificContext)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---

Here’s the complete log.txt:

https://gist.githubusercontent.com/GUiHKX/1f600e14f6c4826af38e34efe58b618d/raw/49e69d41357ca8ea28cec3dcf4c62beae7b351c2/log.txt

Hope it helps.

I’ve just got a bunch of those. I know today is maintenance day, but at the time I got those errors, Steam seemed to be operating fine, I made sure to keep an eye on https://steamstat.us/. Anyway, here’s the log.txt:

https://gist.github.com/GUiHKX/6c82462161895a699e0a7744b822a76e/raw/592687b3c1dc7c65c208b3c4a93e982cfe885e6a/log.txt

My timezone is UTC-3, btw. And here’s my ASF.json:

{
  "AutoRestart": false,
  "AutoUpdates": false,
  "Blacklist": [],
  "ConnectionTimeout": 60,
  "CurrentCulture": null,
  "Debug": false,
  "FarmingDelay": 15,
  "GiftsLimiterDelay": 1,
  "Headless": false,
  "IdleFarmingPeriod": 3,
  "InventoryLimiterDelay": 3,
  "IPCHost": "127.0.0.1",
  "IPCPort": 1242,
  "LoginLimiterDelay": 10,
  "MaxFarmingTime": 4,
  "MaxTradeHoldDuration": 15,
  "OptimizationMode": 0,
  "Statistics": false,
  "SteamOwnerID": <hidden>,
  "SteamProtocols": 4,
  "UpdateChannel": 2
}