My app uses Core Data and CloudKit together. I consistently get a debug messages like this:
020-12-16 11:05:48.933716-0600 Prayer Sparks[13035:4347318] [error] error: CoreData+CloudKit:
-[PFCloudKitCKQueryBackedImportWorkItem queryOperationFinishedWithCursor:error:completion:](105):
<PFCloudKitCKQueryBackedImportWorkItem: 0x2829375c0 -
<NSCloudKitMirroringImportRequest: 0x281697ea0>
ACD62C39-CCBB-4FDE-BBBE-337C9725E759> { CDMR:nil }:
Failed due to querying for an unknown record type (not fatal,
schema needs to be initialized): <CKError 0x28165c420:
"Unknown Item" (11/2003); server message = "{
"recordTypeId" : "CDMR",
"title" : "did not find record type"
}"; uuid = EAF05A49-2FB4-460B-A93D-DBFD9FF1E755; container ID = "iCloud.com.stevenhovater.Prayer-Sparks">
A version of that debug message comes at even the lowest debug feedback levels, about every 5-15 seconds. My interpretation is that in the background, the app is queuing up a request to the public database to query for CDMR records (the way cloud kit approximates relationships in Core Data, as per the article here: https://developer.apple.com/documentation/coredata/mirroring_a_core_data_store_with_cloudkit/reading_cloudkit_records_for_core_data)
However, my app doesn't have any relationships in the model. It did at one point, but I've long since removed those. My suspicion is that somewhere the model generated something to manage the relationships in the background, and it's hanging around as an artifact somewhere. I've cleaned and rebuilt probably a hundred times since that relationship existed, and have deleted the "Derived Data" folder for the app multiple times as well. I've reset the schema in the CloudKit Dashboard and reinitialized it with dummy data several times as well, yet this message persists.
Any ideas where the culprit hides, and how to get rid of it?
Had the same issue here. The messages have been appearing for a while now (ignored for as long as i could stand!) so I can't pinpoint exactly when the messages started appearing, but my best guess is that they started around the time that I moved my model to incorporate/merge private records with public records - something in the difference between the way NSManagedObject and CKRecords handle relationships perhaps?
Anyway - @Reinhard Männer's solution of creating an empty CMDR record in the CloudKit dashboard, and setting the indexes for createdTimestamp, modifiedTimestamp and recordName to queryable worked for me.
I did try creating dummy related entities in my data model, but it solve anything, I suspect because they were not being initialized/pushed to CloudKit in my situation, so the server knew nothing about them.
Instead, I gave up on all of that, cleared the decks and just manually added the empty CMDR record to my schema in the CloudKit dashboard, set the indexes to queryable, and voila! Did the trick - in the end, a 2 minute job.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With