Questions tagged [ckerror]

A `CloudKit.CKError` object encapsulates an error that may occur when you use CloudKit JS. This includes CloudKit server errors and local errors.

A CloudKit.CKError object encapsulates an error that may occur when you use CloudKit JS. This includes CloudKit server errors and local errors.

CKErrorCode:

CKErrorInternalError           = 1,  /* CloudKit.framework encountered an error.  This is a non-recoverable error. */
CKErrorPartialFailure          = 2,  /* Some items failed, but the operation succeeded overall */
CKErrorNetworkUnavailable      = 3,  /* Network not available */
CKErrorNetworkFailure          = 4,  /* Network error (available but CFNetwork gave us an error) */
CKErrorBadContainer            = 5,  /* Un-provisioned or unauthorized container. Try provisioning the container before retrying the operation. */
CKErrorServiceUnavailable      = 6,  /* Service unavailable */
CKErrorRequestRateLimited      = 7,  /* Client is being rate limited */
CKErrorMissingEntitlement      = 8,  /* Missing entitlement */
CKErrorNotAuthenticated        = 9,  /* Not authenticated (writing without being logged in, no user record) */
CKErrorPermissionFailure       = 10, /* Access failure (save or fetch) */
CKErrorUnknownItem             = 11, /* Record does not exist */
CKErrorInvalidArguments        = 12, /* Bad client request (bad record graph, malformed predicate) */
CKErrorResultsTruncated        = 13, /* Query results were truncated by the server */
CKErrorServerRecordChanged     = 14, /* The record was rejected because the version on the server was different */
CKErrorServerRejectedRequest   = 15, /* The server rejected this request.  This is a non-recoverable error */
CKErrorAssetFileNotFound       = 16, /* Asset file was not found */
CKErrorAssetFileModified       = 17, /* Asset file content was modified while being saved */
CKErrorIncompatibleVersion     = 18, /* App version is less than the minimum allowed version */
CKErrorConstraintViolation     = 19, /* The server rejected the request because there was a conflict with a unique field. */
CKErrorOperationCancelled      = 20, /* A CKOperation was explicitly cancelled */
CKErrorChangeTokenExpired      = 21, /* The previousServerChangeToken value is too old and the client must re-sync from scratch */
CKErrorBatchRequestFailed      = 22, /* One of the items in this batch operation failed in a zone with atomic updates, so the entire batch was rejected. */
CKErrorZoneBusy                = 23, /* The server is too busy to handle this zone operation. Try the operation again in a few seconds. */
CKErrorBadDatabase             = 24, /* Operation could not be completed on the given database. Likely caused by attempting to modify zones in the public database. */
CKErrorQuotaExceeded           = 25, /* Saving a record would exceed quota */
CKErrorZoneNotFound            = 26, /* The specified zone does not exist on the server */
CKErrorLimitExceeded           = 27, /* The request to the server was too large. Retry this request as a smaller batch. */
CKErrorUserDeletedZone         = 28, /* The user deleted this zone through the settings UI. Your client should either remove its local data or prompt the user before attempting to re-upload any data to this zone. */

Reference:

20 questions
7
votes
3 answers

CKError localizedDescription

Aim I would like to display the CKError encountered to the user in the app as an alert. So I would like to extract the string from the error that can be displayed to the user. Note: This question is not about UI code to display. Just want to…
user1046037
  • 16,755
  • 12
  • 92
  • 138
7
votes
2 answers

Swift / CloudKit: After record changed, upload triggers "Service Record Changed"

I'm trying to add a CKReference to a record in cloud kit, but the attempt keeps triggering "Service Record Changed". From the console messages my println's have shown (console messages and code below), I'm uploading said record with 0 references,…
Mercutio
  • 1,152
  • 1
  • 14
  • 33
5
votes
3 answers

CKAsset in server record contains no fileURL, cannot even check for nil

I am testing a sync conflict when I save a record that contains a CKAsset (simply a JPG image) using CKModifyRecordsOperation with a save policy of .IfServerRecordUnchanged. I am getting the error CKErrorCode.ServerRecordChanged. This CKError…
Coder1224
  • 1,785
  • 2
  • 17
  • 21
4
votes
1 answer

Parsing CloudKit Error (CKError)

I'm using CloudKit and I'm checking if a specific zone was already created. For this example, let's say that a zone isn't set, so CloudKit retrieves me a CKError. This CKError has a property called partialErrorsByItemID which is of type [AnyHashable…
Ivan Cantarino
  • 3,058
  • 4
  • 34
  • 73
4
votes
1 answer

CloudKit - partialFailure and limitExceeded

Summary In CloudKit would like to know all the possible CKError.Code possible for a .partialFailure. Presently I am only handling the following CKError.Code for a partialFailure. Assumptions: .serverRecordChanged //Only applicable while saving…
user1046037
  • 16,755
  • 12
  • 92
  • 138
2
votes
1 answer

CloudKit Batch Error: Previous Error in Atomic Zone

I am attempting to save a CKRecord using a CKModifyRecordsOperation and every time I try it, I get this initial error: ["CKErrorDescription": Failed to modify some records, "CKPartialErrors": { "CKRecordID: 0x60c000034000; recordName=ABC,…
Clifton Labrum
  • 13,053
  • 9
  • 65
  • 128
2
votes
1 answer

CloudKit "subscription is duplicate of" error - get SubscriptionId

I'm trying to save a CKQuerySubscription to the public database - a CKError is returned with the following information: [ "ServerErrorDescription": subscription is duplicate of 'C82E82EF-F373-4D75-A465-65364D8FEB12', "CKErrorDescription":…
Max Chuquimia
  • 7,494
  • 2
  • 40
  • 59
2
votes
1 answer

IOS: fetchRecordZoneChangesCompletionBlock not called when no internet connection

I'm using the CloudKit in my app. To retrieve all changes from the iCloud I use the operation CKFetchRecordZoneChangesOperation. When I add this operation while I do not have an active internet connection the fetchRecordZoneChangesCompletionBlock is…
Leontien
  • 612
  • 5
  • 22
2
votes
1 answer

recovering errors with CKPartialErrorsByItemIDKey

After getting .partialFailure CKError, I've been trying to recover id's and corresponding errors but I'm having problems... Right now I'm using: print("pE \(error.partialErrorsByItemID) or \(error.userInfo[CKPartialErrorsByItemIDKey])") if let…
Mercutio
  • 1,152
  • 1
  • 14
  • 33
2
votes
1 answer

Error saving record CKRecordID to server: invalid attempt to update record from type 'X' to 'Y'

While I'm using CKModifyRecordsOperation to save records for multiple tables to Private Cloud Database's Default Zone, it always return the error below except table 'X': Error saving record to server: invalid attempt to update record from type 'X'…
Kjuly
  • 34,476
  • 22
  • 104
  • 118
1
vote
0 answers

NSPersistentCloudKitContainer stop sync when CKErrorDomain 12 error occurred

My app uses NSPersistentCloudKitContainer to implement Coredata and iCloud synchronization data Recently, I received feedback from online users about data synchronization errors, and the error code is CKErrorDomain 12 . In the App, I use…
wanbo
  • 868
  • 9
  • 24
1
vote
0 answers

CloudKit: how to handle CKError partialFailure when using NSPersistentCloudKitContainer?

I'm using NSPersistentCloudKitContainer with Core Data and I receive errors because my iCloud space is full. The errors printed are the following:
alpennec
  • 1,864
  • 3
  • 18
  • 25
1
vote
1 answer

CloudKit Error: Change Token Expired, Reset Needed

Swift 3.1, Xcode 8.3.3 I keep getting an error from CloudKit and I don't know what to do about it. I'm tracking notifications from CloudKit like this: let operation = CKFetchNotificationChangesOperation(previousServerChangeToken:…
Clifton Labrum
  • 13,053
  • 9
  • 65
  • 128
1
vote
0 answers

CKModifyRecordsOperation error retry logic

I am new to CloudKit and have figured out CKModifyRecordsOperation with basic cases of add/remove/delete of one CKRecord at a time. I want to use it to pass in multiple recordsToSave and recordIDsToDelete. I know that I need to do a retry when…
Coder1224
  • 1,785
  • 2
  • 17
  • 21
1
vote
2 answers

CloudKit fails to fetch data from Public Container. Error 1/4000

I recently deployed an app update with CloudKit support. It has been working fine, and all of sudden I'm starting to get this error: Internal Error" (4000); "Couldn't get a signing certificate" And my app can't fetch the information from…
Roger Oba
  • 1,292
  • 14
  • 28
1
2