I've have been experiencing the same CKError (10) which is a permission failure--but not one per their documentation. In other words, it is not a security role thing. One attempt was on a completely new container with no defined roles.
https://developer.apple.com/documentation/cloudkit/ckerror/code/permissionfailure"This error typically occurs in the public database in one of these circumstances:
Following some archive documentation, I was adding my container to a second app as described in the section "Share Containers Between Apps" here:
https://developer.apple.com/library/archive/documentation/DataManagement/Conceptual/CloudKitQuickStart/EnablingiCloudandConfiguringCloudKit/EnablingiCloudandConfiguringCloudKit.htmlThis gave me the same error as described above (10/2007)
However, unlike you, creating a new container and using it in ANY of my development/TestFlight apps did not work. Doing so resulted in the same error.
My troubleshooting so far was:
Uncheck/Recheck the container identifier in signing + capabilities
Kill Xcode followed by reboot of iPhone + Mac
Remove all mobile device provisioning profiles that Xcode manages
Delete all provisioning profiles on the iPhone using Xcode Devices window
Create new container and attempt to connect in app
Nothing seemed to work. Seems like it is an Apple problem and not me (us)! Glad I found your post before making my own of the same nature.
I filed a Feedback Assistant bug yesterday for this exact error code (10/2007). Please file a Feedback Assistant bug too and feel free to reference my number so they can see it is affecting more than one developer. FB8826569