Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloudkit Public Database Error: "WRITE operation not permitted"

I have currently a problem with the CloudKit Public Database.

Sometimes I receive an error when modifying records: Permission Failure" (10/2007); server message = "WRITE operation not permitted"; The Error Code is 10 permissionFailure

If I have a low number of record modifies I almost never get the error but as soon as I have more modifies (3000+ per hour) errors become overproportional frequent and more than 20 percent of all request result in this error. This leads me to the fact, that my code must be okay, since the error only happens with increasing CloudKit activity.

Of course I (and all the users of the app) are signed in to iCloud and have iCloud Drive activated. The WRITE permission is activated for everyone, too.

Also the request rate is far below the limit of 40 requests per second (maximum is around 3 requests per second when many users are active).

Does anyone has an idea?

like image 804
EANicolas1 Avatar asked Oct 20 '25 05:10

EANicolas1


1 Answers

The reason for my instance of this problem: switching from one iCloud account to another was not properly purging the local cache (including metadata in Core Data), resulting in the new account occasionally attempting an update of cloud records belonging to the previous user.

The fix for this type of situation depends on the application. In my case a clean slate switch is required (purge all data after confirmation to switch account). Other applications may need cloning of the data into newly created cloud records (i.e. with correct creator/owner metadata).

like image 110
Pierre van Aswegen Avatar answered Oct 21 '25 18:10

Pierre van Aswegen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!