NEW: Learn to build the incredible iOS 15 Weather app today! >>

Ultimate Portfolio: iCloud sync not working

Forums > Videos

Every time is use a different simulator or a physical device, I have to generate new example data.

The debug log shows many errors, for example "Skipping migration", "Failed to modify some record zones", "Failed to set up CloudKit integration" and "Failed to sync user keys".

Has someone else this problem or an solution to this? Google didn't help.

CoreData: debug: CoreData+CloudKit: -[PFCloudKitOptionsValidator validateOptions:andStoreOptions:error:](35): Validating options: <NSCloudKitMirroringDelegateOptions: 0x60000192b500> containerIdentifier:iCloud.net.aetron.UltimatePortfolio databaseScope:Private ckAssetThresholdBytes:<null> operationMemoryThresholdBytes:<null> useEncryptedStorage:NO useDeviceToDeviceEncryption:NO automaticallyDownloadFileBackedFutures:NO automaticallyScheduleImportAndExportOperations:YES skipCloudKitSetup:NO preserveLegacyRecordMetadataBehavior:NO useDaemon:YES apsConnectionMachServiceName:<null> containerProvider:<PFCloudKitContainerProvider: 0x600003534330> storeMonitorProvider:<PFCloudKitStoreMonitorProvider: 0x600003534390> metricsClient:<PFCloudKitMetricsClient: 0x6000035343d0> metadataPurger:<PFCloudKitMetadataPurger: 0x6000035343e0> scheduler:<null> notificationListener:<null> containerOptions:<null> defaultOperationConfiguration:<null> progressProvider:<NSPersistentCloudKitContainer: 0x600002265c40>
storeOptions: {
    NSInferMappingModelAutomaticallyOption = 1;
    NSMigratePersistentStoresAutomaticallyOption = 1;
    NSPersistentCloudKitContainerOptionsKey = "<NSPersistentCloudKitContainerOptions: 0x60000394ce40>";
    NSPersistentHistoryTrackingKey = 1;
    NSPersistentStoreMirroringOptionsKey =     {
        NSPersistentStoreMirroringDelegateOptionKey = "<NSCloudKitMirroringDelegate: 0x600000c34270>";
    };
}
CoreData: debug: CoreData+CloudKit: -[NSCloudKitMirroringDelegate observeChangesForStore:inPersistentStoreCoordinator:](404): <NSCloudKitMirroringDelegate: 0x600000c34270>: Observing store: <NSSQLCore: 0x7ffc759092b0> (URL: file:///Users/mbruenni/Library/Developer/CoreSimulator/Devices/0E959D73-97FB-4385-B194-4BC52FA86224/data/Containers/Data/Application/8B95F8A3-1760-4355-B944-EA4E5A35A463/Library/Application%20Support/Main.sqlite)
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _setUpCloudKitIntegration](503): <NSCloudKitMirroringDelegate: 0x600000c34270>: Successfully enqueued setup request.
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate checkAndExecuteNextRequest](2452): <NSCloudKitMirroringDelegate: 0x600000c34270>: Checking for pending requests.
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate checkAndExecuteNextRequest]_block_invoke(2465): <NSCloudKitMirroringDelegate: 0x600000c34270>: Executing: <NSCloudKitMirroringDelegateSetupRequest: 0x600003957660> 79FD01F3-DEC0-45DE-876F-CFDEE86BD272
CoreData: debug: CoreData+CloudKit: -[PFCloudKitMetadataModelMigrator calculateMigrationStepsWithConnection:error:](404): Skipping migration for 'ANSCKDATABASEMETADATA' because it already has a column named 'ZLASTFETCHDATE'
CoreData: debug: CoreData+CloudKit: -[PFCloudKitMetadataModelMigrator calculateMigrationStepsWithConnection:error:](456): Skipping migration for 'ANSCKMETADATAENTRY' because it already has a column named 'ZDATEVALUE'
CoreData: debug: CoreData+CloudKit: -[PFCloudKitMetadataModelMigrator calculateMigrationStepsWithConnection:error:](404): Skipping migration for 'ANSCKRECORDZONEMETADATA' because it already has a column named 'ZLASTFETCHDATE'
CoreData: debug: CoreData+CloudKit: -[PFCloudKitMetadataModelMigrator calculateMigrationStepsWithConnection:error:](419): Skipping migration for 'ANSCKRECORDZONEMETADATA' because it already has a column named 'ZSUPPORTSFETCHCHANGES'
CoreData: debug: CoreData+CloudKit: -[PFCloudKitMetadataModelMigrator calculateMigrationStepsWithConnection:error:](419): Skipping migration for 'ANSCKRECORDZONEMETADATA' because it already has a column named 'ZSUPPORTSATOMICCHANGES'
CoreData: debug: CoreData+CloudKit: -[PFCloudKitMetadataModelMigrator calculateMigrationStepsWithConnection:error:](419): Skipping migration for 'ANSCKRECORDZONEMETADATA' because it already has a column named 'ZSUPPORTSRECORDSHARING'
CoreData: debug: CoreData+CloudKit: -[PFCloudKitMetadataModelMigrator calculateMigrationStepsWithConnection:error:](432): Skipping migration for 'ANSCKRECORDZONEMETADATA' because it already has a column named 'ZNEEDSIMPORT'
CoreData: debug: CoreData+CloudKit: -[PFCloudKitMetadataModelMigrator calculateMigrationStepsWithConnection:error:](432): Skipping migration for 'ANSCKRECORDZONEMETADATA' because it already has a column named 'ZNEEDSRECOVERYFROMZONEDELETE'
CoreData: debug: CoreData+CloudKit: -[PFCloudKitMetadataModelMigrator calculateMigrationStepsWithConnection:error:](432): Skipping migration for 'ANSCKRECORDZONEMETADATA' because it already has a column named 'ZNEEDSRECOVERYFROMUSERPURGE'
CoreData: CloudKit: CoreData+CloudKit: -[PFCloudKitSetupAssistant _checkUserIdentity:]_block_invoke(1048): <PFCloudKitSetupAssistant: 0x600001321a40>: CKIdentity record matches store: <CKRecordID: 0x60000373e880; recordName=_65069701f18003156276a462cb77b911, zoneID=_defaultZone:__defaultOwner__>
2021-04-22 17:45:52.275972+0200 UltimatePortfolio[15672:1340342] [error] error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke(939): <NSCloudKitMirroringDelegate: 0x600000c34270>: Failed to set up CloudKit integration for store: <NSSQLCore: 0x7ffc759092b0> (URL: file:///Users/mbruenni/Library/Developer/CoreSimulator/Devices/0E959D73-97FB-4385-B194-4BC52FA86224/data/Containers/Data/Application/8B95F8A3-1760-4355-B944-EA4E5A35A463/Library/Application%20Support/Main.sqlite)
<CKError 0x60000391f180: "Partial Failure" (2/1011); "Failed to modify some record zones"; partial errors: {
    com.apple.coredata.cloudkit.zone:__defaultOwner__ = <CKError 0x600003945620: "Internal Error" (1/5000); "Failed to sync user keys">
}>
CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke(939): <NSCloudKitMirroringDelegate: 0x600000c34270>: Failed to set up CloudKit integration for store: <NSSQLCore: 0x7ffc759092b0> (URL: file:///Users/mbruenni/Library/Developer/CoreSimulator/Devices/0E959D73-97FB-4385-B194-4BC52FA86224/data/Containers/Data/Application/8B95F8A3-1760-4355-B944-EA4E5A35A463/Library/Application%20Support/Main.sqlite)
<CKError 0x60000391f180: "Partial Failure" (2/1011); "Failed to modify some record zones"; partial errors: {
    com.apple.coredata.cloudkit.zone:__defaultOwner__ = <CKError 0x600003945620: "Internal Error" (1/5000); "Failed to sync user keys">
}>
2021-04-22 17:45:52.276511+0200 UltimatePortfolio[15672:1340342] [error] error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate recoverFromError:](1727): <NSCloudKitMirroringDelegate: 0x600000c34270> - Attempting recovery from error: <CKError 0x60000391f180: "Partial Failure" (2/1011); "Failed to modify some record zones"; partial errors: {
    com.apple.coredata.cloudkit.zone:__defaultOwner__ = <CKError 0x600003945620: "Internal Error" (1/5000); "Failed to sync user keys">
}>
CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate recoverFromError:](1727): <NSCloudKitMirroringDelegate: 0x600000c34270> - Attempting recovery from error: <CKError 0x60000391f180: "Partial Failure" (2/1011); "Failed to modify some record zones"; partial errors: {
    com.apple.coredata.cloudkit.zone:__defaultOwner__ = <CKError 0x600003945620: "Internal Error" (1/5000); "Failed to sync user keys">
}>
2021-04-22 17:45:52.277108+0200 UltimatePortfolio[15672:1340342] [error] error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _recoverFromPartialError:forStore:inMonitor:]_block_invoke(1978): <NSCloudKitMirroringDelegate: 0x600000c34270>: Found unknown error as part of a partial failure: <CKError 0x600003945620: "Internal Error" (1/5000); "Failed to sync user keys">
CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _recoverFromPartialError:forStore:inMonitor:]_block_invoke(1978): <NSCloudKitMirroringDelegate: 0x600000c34270>: Found unknown error as part of a partial failure: <CKError 0x600003945620: "Internal Error" (1/5000); "Failed to sync user keys">
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _finishedRequest:withResult:](2483): Finished request: <NSCloudKitMirroringDelegateSetupRequest: 0x600003957660> 79FD01F3-DEC0-45DE-876F-CFDEE86BD272 with result: <NSCloudKitMirroringResult: 0x60000370a0a0> success: 0 madeChanges: 0 error: <CKError 0x60000391f180: "Partial Failure" (2/1011); "Failed to modify some record zones"; partial errors: {
    com.apple.coredata.cloudkit.zone:__defaultOwner__ = <CKError 0x600003945620: "Internal Error" (1/5000); "Failed to sync user keys">
}>
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate checkAndExecuteNextRequest](2452): <NSCloudKitMirroringDelegate: 0x600000c34270>: Checking for pending requests.
CoreData: CloudKit: CoreData+CloudKit: -[NSCloudKitMirroringDelegate checkAndExecuteNextRequest]_block_invoke(2468): <NSCloudKitMirroringDelegate: 0x600000c34270>: No more requests to execute.

   

Hello,

I seem to be having the same issue. Were you able to solve this ?

   

Hacking with Swift is sponsored by Essential Developer

SPONSORED Only until this Sunday, December 12th, you can join a free crash course to learn advanced techniques for testing new and legacy Swift code — it's the fast track to becoming a complete Senior iOS Developer!

Click to learn more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.