All of a sudden my app started getting this CloudKit error, and it happens to a lot of users. I had no changes to cloud sync for months and really surprised by seeing this. What confuses me even more, is that there is no information on the web about this kind of error. I have no idea what causes it and how to solve it. Would love to get any feedback from the CloudKit engineer.
Client went away before operation 27761871408C460A could be validated; failing
{
"NSUnderlyingError": "<CKUnderlyingError 0x600002573f30: \"ClientInternalError\" (2005); \"Client went away before operation 27761871408C460A could be validated; failing\">",
"CKErrorDescription": "Client went away before operation 27761871408C460A could be validated; failing",
"NSDebugDescription": "CKInternalErrorDomain: 2005",
"NSLocalizedDescription": "Client went away before operation 27761871408C460A could be validated; failing"
}
Seems to happen only on macOS.
Thanks for your reply!
I think I've found what is causing the issue. I still need to verify it completely, but most likely the cause is identified.
So. My app consists of the main app with the user interface and a background service app which is started by the main app and is run independently. That background service app also syncs data via iCloud. When the main app is updated, the background service app keeps running, and that is when it starts getting errors from CloudKit. It basically is unable to do any cloud sync operations from then on. My fix is to periodically check in the background app if it should be restarted due to the main app being updated. That should solve it, I believe. I still could not completely validate it, as a fix like this takes time for people to update between versions.