CloudKit, Failed to modify some records - Zone Not Found

I'm getting the following error.


ERROR[CKErrorDomain:2] Failed to modify some records,

<CKError 0x1c005e1e0: "Partial Failure" (1011); "Failed to modify some records";

partial errors: {

BB27A0F8-0D8A-4279-A4E6-515B4E6C5116:(MainCustomZone:__defaultOwner__) =

<CKError 0x1c0050740: "Zone Not Found" (26/2036); server message = "Zone 'MainCustomZone'

does not exist"; uuid = E4AE311D-A73F-4F8A-BAF7-1EF5082D2FA9>

}>


My app works fine on my development devices, but in testflight for my beta users they get the error above. When I use a testflight build it still works fine for me, yes I am pointing at the production conatiner in my entitlements I have set the 'com.apple.developer.icloud-container-environment' set to 'production.


I've triple checked that the I'm looking at the correct container and the zone name is spelt correctly.

https://www.evernote.com/l/AO-2zN3CIcFHrpoboVAFLBrtmylB7NZwnAkB/image.png


I have iCloud enabled in my developer account under app id's.


I've also got Write set for authentication, in security roles for each record type.


Please can someone suggest what the problem is?

I've been researching the issue without success.

Replies

Are you sure you're creating the zone "MainCustomZone" for each user? You may have created it for your own account once and forgot about it, but you need to create it for each user.

For clarity - custom zones are only available in the private database. They are not available in the public database. To use a custom zone in a private database the owner of that private database (the user) must create and populate the custom zone.