FirstGearGames / FishySteamworks

A Steamworks implementation for Fish-Net.
Other
81 stars 18 forks source link

InvalidOperationException Collection was modified #9

Closed f2069 closed 3 months ago

f2069 commented 6 months ago

Unity: 2021.3.18f1 FishNet: 3.11.18R Pro FishySteamworks: 4.1.0 Discord: https://discord.com/channels/424284635074134018/1248143502253101118

Sometimes we get this exception in build and it's broke gameplay. Log from host.

Server received an unhandled PacketId of 52924 on channel Reliable from connectionId 0. Connection will be kicked immediately.
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
FishNet.Managing.Logging.LevelLoggingConfiguration:LogError(String)
FishNet.Managing.Server.ServerManager:ParseReceived(ServerReceivedDataArgs)
FishNet.Managing.Server.ServerManager:Transport_OnServerReceivedData(ServerReceivedDataArgs)
FishNet.Transporting.Tugboat.Tugboat:HandleServerReceivedDataArgs(ServerReceivedDataArgs)
FishySteamworks.Server.ServerSocket:IterateIncoming()
FishNet.Managing.Transporting.TransportManager:IterateIncoming(Boolean)
FishNet.Managing.Timing.TimeManager:IncreaseTick()
FishNet.Managing.Timing.TimeManager:TickUpdate()

Steam connection not found for connectionId 0.
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
FishySteamworks.FishySteamworks:StopConnection(Int32, Boolean)
FishNet.Managing.Server.ServerManager:Kick(Int32, KickReason, LoggingType, String)
FishNet.Managing.Server.ServerManager:ParseReceived(ServerReceivedDataArgs)
FishNet.Managing.Server.ServerManager:Transport_OnServerReceivedData(ServerReceivedDataArgs)
FishNet.Transporting.Tugboat.Tugboat:HandleServerReceivedDataArgs(ServerReceivedDataArgs)
FishySteamworks.Server.ServerSocket:IterateIncoming()
FishNet.Managing.Transporting.TransportManager:IterateIncoming(Boolean)
FishNet.Managing.Timing.TimeManager:IncreaseTick()
FishNet.Managing.Timing.TimeManager:TickUpdate()

ConnectionId 0 not found within Clients. Connection will be kicked immediately.
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
FishNet.Managing.Logging.LevelLoggingConfiguration:LogError(String)
FishNet.Managing.Server.ServerManager:Kick(Int32, KickReason, LoggingType, String)
FishNet.Managing.Server.ServerManager:ParseReceived(ServerReceivedDataArgs)
FishNet.Managing.Server.ServerManager:Transport_OnServerReceivedData(ServerReceivedDataArgs)
FishNet.Transporting.Tugboat.Tugboat:HandleServerReceivedDataArgs(ServerReceivedDataArgs)
FishySteamworks.Server.ServerSocket:IterateIncoming()
FishNet.Managing.Transporting.TransportManager:IterateIncoming(Boolean)
FishNet.Managing.Timing.TimeManager:IncreaseTick()
FishNet.Managing.Timing.TimeManager:TickUpdate()

Uploading Crash Report
InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.Collections.Generic.Dictionary`2+Enumerator[TKey,TValue].MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
  at FishySteamworks.Server.ServerSocket.IterateIncoming () [0x00000] in <00000000000000000000000000000000>:0 
  at FishNet.Managing.Transporting.TransportManager.IterateIncoming (System.Boolean server) [0x00000] in <00000000000000000000000000000000>:0 
  at FishNet.Managing.Timing.TimeManager.IncreaseTick () [0x00000] in <00000000000000000000000000000000>:0 
  at FishNet.Managing.Timing.TimeManager.TickUpdate () [0x00000] in <00000000000000000000000000000000>:0 

In similar places in FizzySteamworks, connections are copied to avoid this error.

image
FirstGearGames commented 4 months ago

Thought I had replied to this awhile ago. This will get looked at as a priority given it's potential breaking capabilities.

petergiuntoli commented 4 months ago

We're seeing a similar issue in fishnet 4.3.1 with Steamworks 4.1.0

InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.Collections.Generic.Dictionary`2+Enumerator[TKey,TValue].MoveNext () [0x00013] in <eef08f56e2e042f1b3027eca477293d9>:0 
  at FishySteamworks.Server.ServerSocket.IterateIncoming () [0x000f4] rog\Assets\Plugins\FishNet\Plugins\FishySteamworks\Core\ServerSocket.cs:328 
  at FishySteamworks.FishySteamworks.IterateIncoming (System.Boolean server) [0x00003] rog\Assets\Plugins\FishNet\Plugins\FishySteamworks\FishySteamworks.cs:252 
  at FishNet.Transporting.Multipass.Multipass.IterateIncoming (System.Boolean server) [0x00015] in rog\Assets\Plugins\FishNet\Runtime\Transporting\Transports\Multipass\Multipass.cs:428 
  at FishNet.Managing.Transporting.TransportManager.IterateIncoming (System.Boolean server) [0x00012] in rog\Assets\Plugins\FishNet\Runtime\Managing\Transporting\TransportManager.cs:715 
  at FishNet.Managing.Timing.TimeManager.TryIterateData (System.Boolean incoming) [0x0001a] in rog\Assets\Plugins\FishNet\Runtime\Managing\Timing\TimeManager.cs:1029 
  at FishNet.Managing.Timing.TimeManager.IncreaseTick () [0x000f1] in rog\Assets\Plugins\FishNet\Runtime\Managing\Timing\TimeManager.cs:683 
  at FishNet.Managing.Timing.TimeManager.<TickUpdate>g__MethodLogic|97_0 () [0x00000] in rog\Assets\Plugins\FishNet\Runtime\Managing\Timing\TimeManager.cs:344 
  at FishNet.Managing.Timing.TimeManager.TickUpdate () [0x0005a] in rog\Assets\Plugins\FishNet\Runtime\Managing\Timing\TimeManager.cs:334 
  at FishNet.Transporting.NetworkReaderLoop.Update () [0x00000] in rog\Assets\Plugins\FishNet\Runtime\Transporting\NetworkReaderLoop.cs:28 
FirstGearGames commented 4 months ago

Yes it's a transport bug. It will be fixed soon.

On Wed, Jul 24, 2024, 12:57 PM Peter Giuntoli @.***> wrote:

We're seeing a similar issue in fishnet 4.3.1 with Steamworks 4.1.0

InvalidOperationException: Collection was modified; enumeration operation may not execute. at System.Collections.Generic.Dictionary`2+Enumerator[TKey,TValue].MoveNext () [0x00013] in :0 at FishySteamworks.Server.ServerSocket.IterateIncoming () [0x000f4] rog\Assets\Plugins\FishNet\Plugins\FishySteamworks\Core\ServerSocket.cs:328 at FishySteamworks.FishySteamworks.IterateIncoming (System.Boolean server) [0x00003] rog\Assets\Plugins\FishNet\Plugins\FishySteamworks\FishySteamworks.cs:252 at FishNet.Transporting.Multipass.Multipass.IterateIncoming (System.Boolean server) [0x00015] in rog\Assets\Plugins\FishNet\Runtime\Transporting\Transports\Multipass\Multipass.cs:428 at FishNet.Managing.Transporting.TransportManager.IterateIncoming (System.Boolean server) [0x00012] in rog\Assets\Plugins\FishNet\Runtime\Managing\Transporting\TransportManager.cs:715 at FishNet.Managing.Timing.TimeManager.TryIterateData (System.Boolean incoming) [0x0001a] in rog\Assets\Plugins\FishNet\Runtime\Managing\Timing\TimeManager.cs:1029 at FishNet.Managing.Timing.TimeManager.IncreaseTick () [0x000f1] in rog\Assets\Plugins\FishNet\Runtime\Managing\Timing\TimeManager.cs:683 at FishNet.Managing.Timing.TimeManager.g__MethodLogic|97_0 () [0x00000] in rog\Assets\Plugins\FishNet\Runtime\Managing\Timing\TimeManager.cs:344 at FishNet.Managing.Timing.TimeManager.TickUpdate () [0x0005a] in rog\Assets\Plugins\FishNet\Runtime\Managing\Timing\TimeManager.cs:334 at FishNet.Transporting.NetworkReaderLoop.Update () [0x00000] in rog\Assets\Plugins\FishNet\Runtime\Transporting\NetworkReaderLoop.cs:28

— Reply to this email directly, view it on GitHub https://github.com/FirstGearGames/FishySteamworks/issues/9#issuecomment-2248493412, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGPJC3XSQHDU4QWV6UV56E3ZN7MIZAVCNFSM6AAAAABH7PXHH6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBYGQ4TGNBRGI . You are receiving this because you were mentioned.Message ID: @.***>

FirstGearGames commented 3 months ago

Resolved in 4.1.1