After www.apple.com/support/systemstatus/ admitted a four-hour Game Center issue on April Fools’ Day, connection chances have increased a tiny little bit, but breakdowns are still very frequent. I did some intensive testing with four devices over the last days and found about a dozen different scenarios where connections break down.
I identified 8 different scenarios were console messages seems to coincide with a connection breakdown. None of them notifies the app to let it react. All of them hint at timeouts or lost messages, and thus at overloaded servers on Apple’s side. Here are typical examples of these messages:
scenario 1:
2020-04-03 16:10:15.795282+0200 AppName[2959:960099] [ViceroyTrace] [ERROR] attempt_failover:4341 Connection timed out for [004B0858] (in clstate 3)
2020-04-03 16:10:15.807142+0200 AppName[2959:960195] [ViceroyTrace] [ERROR] -[GKSessionInternal(_private) newNSErrorFromGKSessionError:description:reason:]:673 Error: 30503 -- Connection timed out..
scenario 2:
2020-04-03 16:14:54.251494+0200 AppName[2426:580756] [ViceroyTrace] [ERROR] SendCollectionRequest:508 /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/AVConference/AVConference-1640.8.1.1/ICE.subproj/Sources/ICEMessage.c:508: HandoverReport: failed to send SNATMAP request for [192.168.0.150:16401], error(801A0016). Save message for retry
scenario 3:
2020-04-03 10:01:44.887722+0200 AppName[2228:512032] [ViceroyTrace] [ERROR] OSPFParse_ParsePacketHeader:1083 Bad destination count=0
2020-04-03 10:01:44.888342+0200 AppName[2228:511553] [ViceroyTrace] [ERROR] ICEGetCandidates:580 /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/AVConference/AVConference-1640.8.1.1/ICE.subproj/Sources/ICE.c:580: ProcessCollectionResponse failed (8015000C)
scenaro 4:
2020-04-02 18:51:04.771723+0200 AppName[4319:832248] [ViceroyTrace] [ERROR] ICEStopConnectivityCheck:2733 ICEStopConnectivityCheck() found no ICE c
scenario 5:
2020-04-03 10:08:44.206127+0200 AppName[4745:989071] [ViceroyTrace] [ERROR] AGPSessionRecvFrom:1565 fail: message fragment @index 9 ser 00000000 should be 00000009
scenario 6:
2020-04-03 10:52:24.688927+0200 AppName[2839:906970] [ViceroyTrace] [ERROR] -[GKDiscoveryManager connectToSockAddr:port:forPeer:]_block_invoke_2:279 peer [FEC57AA662DEFB0F] data received with error Connection closed
scenario7:
2020-04-03 15:00:23.804775+0200 AppName[4841:1044343] [ViceroyTrace] [ERROR] ICEGetCandidates:580 /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/AVConference/AVConference-1640.8.1.1/ICE.subproj/Sources/ICE.c:580: ProcessCollectionResponse failed (8015000C)
scenario 8:
2020-04-03 15:40:02.542114+0200 AppName[2921:951200] [ViceroyTrace] [ERROR] -[GKDiscoveryManager connectToSockAddr:port:forPeer:]_block_invoke:248 peer [0EB172B1135C04CC] error in connectedHandler [Unable to connect]
2020-04-03 15:40:02.543461+0200 AppName[2921:952495] [Match] Error sending dictionary {
bundleID = "com.company.appname";
bundleVersion = "2.6";
isDevelopmentVersion = 1;
message = 0;
platform = 1;
shortBundleVersion = "2.6";
} to deviceID: 0EB172B1135C04CC, error = Error Domain=GKDiscoveryPeer Code=-1 "Unable to connect" UserInfo={NSLocalizedDescription=Unable to connect}
Some easier scenarios revolve around lost authentication of the local player. Some of them return GKError with codes 6 or 8, which then enables the app to react. I managed to work around some of them by preloading and caching recent players. The lost authentications usually leave the following message in the console:
2020-04-01 18:53:43.275375+0200 AppName[55085:4001598] [Error] _authenticateUsingAlert:Failed to authenticate player with existing credentials.Error: Error Domain=NSURLErrorDomain Code=-1001 "(null)"
Other error messages keep cluttering the console in large numbers but seem to appear independently of success or failures. Here are some examples:
2020-04-01 18:42:45.007690+0200 AppName[55085:4006523] [ViceroyTrace] [ERROR] ProcessEvent:1198 Send BINDING_REQUEST failed(801A0016).
2020-04-01 18:42:45.046783+0200 AppName[55085:4006412] [ViceroyTrace] [ERROR] AGPSessionRecvFrom:1954 0x10105a070 sack: SEARCH FAILURE SERIAL NUMBER (00000005) FROM (2930F198)...
2020-04-01 18:53:45.192184+0200 AppName[55085:4011378] [ViceroyTrace] [ERROR] ReXmitCollectionRequest:628 /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/AVConference/AVConference-1640.8.4.1/ICE.subproj/Sources/ICEMessage.c:628: ReXmit [SNATMAP_REQUEST] (1:0) from [192.168.0.214:16398] to [17.173.255.129:16384] failed (801A0016)
2020-04-02 16:29:53.050503+0200 AppName[2671:749372] [ViceroyTrace] [ERROR] OSPFParse_ParsePacketHeader:1083 Bad destination count=0
2020-04-02 16:29:53.322328+0200 AppName[2671:749372] [ViceroyTrace] [ERROR] OSPFParse_ParsePacketHeader:1100 Checksum=42050 doesn't match
2020-04-02 16:29:53.322873+0200 AppName[2671:749616] [ViceroyTrace] [ERROR] RemoveNominatedCandidatePair:982 failed with invalid index input: -1, candidate pair count: 12
2020-04-02 16:29:53.323351+0200 AppName[2671:749616] [ViceroyTrace] [ERROR] ICEStopConnectivityCheck:2733 ICEStopConnectivityCheck() found no ICE check with call id (1187846793)
2020-04-02 16:29:53.328064+0200 AppName[2671:749616] [ViceroyTrace] [ERROR] gckSessionCheckPendingConnections:1446 gckSessionCheckPendingConnections: iICEChecksLeft=0, iUnconnectedNodeCount=0, iDDsExpected=1
2020-04-02 16:30:58.915093+0200 AppName[2671:749812] [ViceroyTrace] [ERROR] -[GKDiscoveryManager connectToSockAddr:port:forPeer:]_block_invoke_2:279 peer [26D308CB935EBD99] data received with error Connection closed