FAF Client sometimes show error and stop connecting to custom/coop game

When I connect to any custom/coop game, sometimes an error appers, and after that connection is aborted. It can happen multiple times in a row with the same server, very annying. Here's error text, it's the same every time:

It looks like Supreme Commander: Forged Alliance crashed check with exit code -1,073,740,791 the game log C:\Users\Kirill\AppData\Roaming\Forged Alliance Forever\logs\game_18583362.log for more information.

I'll upload some screenshots and logs, hope you will find and kill this annoying bug.

SCFAF fukin error.png

SCFAF log folder.png

game_18583362.log

client.log

ice-adapter.log

@maudlin27 Related to m27ai?

info: Warning - no valid units in tNewUnits
warning: false	M27WARNING: Count=1: GameTime 527: Couldnt find valid target or object for the action so wont proceed with it, review if this happens repeatedly for unexpected actions (examples where this triggers in line with expectations are if want to assist a building but all of them have nearby enemies (or are factories that are idle), or if try to reclaim a unit that no longer has a position (this warning is hidden if the action was to reclaim a unit as a result though). iActionToAssign=19; iCurrentConditionToTry=26; bMaxEngisIsAdditionNotTotal=false
warning: stack traceback:
warning:         [C]: in function `assert'
warning:         [C]: in function `pcall'
warning:         ...nder forged alliance\mods\m27ai\lua\m27utilities.lua(79): in function `ErrorHandler'
warning:         ...d alliance\mods\m27ai\lua\ai\m27engineeroverseer.lua(15308): in function <...d alliance\mods\m27ai\lua\ai\m27engineeroverseer.lua:9625>
info: Warning - no valid units in tNewUnits
info: Warning - no valid units in tNewUnits
info: Warning - no valid units in tNewUnits
warning: false	M27WARNING: Count=2: GameTime 528: Couldnt find valid target or object for the action so wont proceed with it, review if this happens repeatedly for unexpected actions (examples where this triggers in line with expectations are if want to assist a building but all of them have nearby enemies (or are factories that are idle), or if try to reclaim a unit that no longer has a position (this warning is hidden if the action was to reclaim a unit as a result though). iActionToAssign=19; iCurrentConditionToTry=26; bMaxEngisIsAdditionNotTotal=false
warning: stack traceback:
warning:         [C]: in function `assert'
warning:         [C]: in function `pcall'
warning:         ...nder forged alliance\mods\m27ai\lua\m27utilities.lua(79): in function `ErrorHandler'
warning:         ...d alliance\mods\m27ai\lua\ai\m27engineeroverseer.lua(15308): in function <...d alliance\mods\m27ai\lua\ai\m27engineeroverseer.lua:9625>
info: Warning - no valid units in tNewUnits

gets spammed over 6k times with ton of other m27ai errors

@magge The OP sounds like it's an issue joining games in the first place, whereas those errors would be things that occur during an actual game (that has started). I've not heard of M27 causing any issues with joining games so think it's unlikely, although one thing to try to make sure @zorg-kirill would be to disable all sim and ui mods and see if you still get the crash (and if not then enable them one by one).

In terms of the error/warning messages highlighted unfortunately M27 will generate a lot of warnings and errors in the logs. For example the one about no valid units is something that happens regularly that I've not got around to properly investigating (I'm fairly confident it's a false error the vast majority of the time, but figuring out how it arises and how to not have it show the message when it's not an issue without slowing things down is harder). They're also things that would affect how M27 plays in the game (rather than something that would cause a crash).

If the game is crashing (i.e. during the game) with M27 enabled though I can look into further as that's something I've seen happen before

@magge the problem is not with M27 AI. It's only with joining to any game with any mods or without any mods. It's just a coincidence that the last game was with AI mod

To make it more clean and easy, I deleted all logs, launched SCFAF and managed to get an error from the first attempt. Here are screenshots/fresh logs:

scfaf error with logs cleaned.png

client.log

ice-adapter.log

So, the error code is the same, but now it don't point at "game log" or any log. So there is another bug with wrong error alerts. And in my opinion, the main error might be somewhere in ICE adapter.

Thanks, for the clean logs, the m27ai was really misleading and produced a lot of noise. Also thank you maudlin27 for the detail explaining.

To go for the low-hanging fruit here - Try with a VPN from a different country first. Many RU people have connection issues, because many of their providers are interfering with the connections.

@magge I'll try later, after work.

It would be also good to make so that error alert would be more easy to understand. And maybe add game lobby reconnect feature, so that it will automatically try 3-5 times to connect to game lobby in case of small errors. It works by hands, when I connect to the same server a couple more times, but it will be quicker and more pleasurable just watching it.

Didn't find good vpn yet, but found another interesting thing: this bug also occurs when trying to host new game. So, i doubt it's vpn problem.

Still the problem is present. Maybe get latest build from github and debug it myself? Tired of this silly error...

Google sez WSAEINTR can be caused by a firewall. To see if that's a network issue and not something with the game, try running the FA exe directly and launching a lobby from there.

@mazornoob I have firewall off. And FA don't launch directly. And I even can't host new campaign games

Could it be the reason?

2023-06-28 22:46:20.367 INFO Ice Servers set, total addresses: 18 (c.f.iceadapter.ice.GameSession:170)
2023-06-28 22:46:20.367 INFO Sending Response:{"result":null,"id":1,"jsonrpc":"2.0"} (com.nbarraille.jjsonrpc.JJsonPeer:574)
2023-06-28 22:46:20.482 WARN Failed to ping coturn1.faforever.com (c.f.iceadapter.util.PingWrapper:52)
2023-06-28 22:46:20.517 WARN Failed to ping coturn2.faforever.com (c.f.iceadapter.util.PingWrapper:52)
2023-06-28 22:46:20.560 WARN Failed to ping coturn3.faforever.com (c.f.iceadapter.util.PingWrapper:52)
2023-06-28 22:46:20.600 WARN Failed to ping coturn5.faforever.com (c.f.iceadapter.util.PingWrapper:52)
2023-06-28 22:46:20.654 WARN Failed to ping anz1.coturn.faforever.com (c.f.iceadapter.util.PingWrapper:52)
2023-06-28 22:46:20.751 WARN Failed to ping coturn4.faforever.com (c.f.iceadapter.util.PingWrapper:52)
2023-06-28 22:46:22.187 WARN Close requested, stopping... (c.f.iceadapter.rpc.RPCHandler:139)
2023-06-28 22:46:22.187 INFO close() - stopping the adapter (com.faforever.iceadapter.IceAdapter:158)
2023-06-28 22:46:22.189 INFO GPGNetServer stopped (c.f.iceadapter.gpgnet.GPGNetServer:253)

Is that during a game?

A work of art is never finished, merely abandoned

@zorg-kirill said in FAF Client sometimes show error and stop connecting to custom/coop game:

To make it more clean and easy, I deleted all logs, launched SCFAF and managed to get an error from the first attempt. Here are screenshots/fresh logs:

scfaf error with logs cleaned.png

client.log

ice-adapter.log

So, the error code is the same, but now it don't point at "game log" or any log. So there is another bug with wrong error alerts. And in my opinion, the main error might be somewhere in ICE adapter.

it's in lobby, like in this screenshot

Looks like something is blocking your connection to any coturn server

@sheikah btw, if I ping these servers in CMD, everything works fine, no packets lost

So, I turned on IPV6 in FAF settings, choose COTURN server Finland (no server was chosen before), turned on experimental debugger. And it started connecting 80-90% times (it's ok for me, because it was around 0% for the last week and much earlier). Maybe this information will help somebody.