Fix CloudKit container permissions

Apple Recommended

  • Worked, thanks! I asked the admin of our team to fix Certificates.

Add a Comment

Replies

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:
  • You have roles defined for record types.

  • Your app is trying to accept a share that the current user was not invited to."

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.html

This 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


Yep, having this issue, very annoying - I hope it'll be fixed in the next few days as it seems to be an issue on Apple's side.

Meanwhile I've filed a radar: FB8877360, and also posted here: https://developer.apple.com/forums/thread/665280

I had the same issue, I had retrieved the container via: let container = CKContainer.default() spent a few hours one day working on it, then the following morning decided to try: let container = CKContainer(identifier: "mycontainer.id") and it worked.

So I tried print the default container identifier, which turned out to be mycontainer.id -- so I reverted my code to: let container = CKContainer.default() and it worked again. My conclusion is that either:

  • calling it with the identifier explicitly fixed some setting, to make it match the setting in the XCode project settings (which had always been mycontainer.id),

or:

  • there was an issue where Apple had to finish updating some database permissions or something internally, which took a few hours or more (less than a day in my case though thankfully).

Anyway, figured I'd post this in case for when someone else runs into it -- seems to be a reasonably common issue.

  • I have spent a couple days on this issue. I also tried going back and forth from default container id to using the identifier. I am using an example found from iOS Academy (https://www.youtube.com/watch?v=Og-2A5n5IAY). I was able to get it to work once, but repeating the exercise in a new app copied exactly from the previous one, with exception of changing the app and container name resulted in the same error messages. There seems to be some very random happening. Now I cannot get it to work at all with the same code.

Add a Comment
  • Worked, thanks! I asked the admin of our team to fix Certificates.

Add a Comment