Cannot download photos from iCloud via Photos framework for some accounts
Number:rdar://FB7599120 Date Originated:02/25/2020
Status:Open Resolved:
Product:PhotoKit Product Version:iOS 13+
Classification:Incorrect/Unexpected Behavior Reproducible:Rear
All the time getting an error for some iCloud accounts when trying download photos from iCloud because the photos are not presented locally on a device. The error occurs for some iCloud photos:

Error Domain=CloudPhotoLibraryErrorDomain Code=25 "Failed to download CPLResourceTypeOriginal for ARUQNQfwZKmf/HcerGPjcRjjf1/H#PrimarySync (Record not found)" UserInfo={NSLocalizedDescription=Failed to download CPLResourceTypeOriginal for ARUQNQfwZKmf/HcerGPjcRjjf1/H#PrimarySync (Record not found)}

iOS Settings -> Photos has iCloud Photos enabled. Also in iCloud settings the iCloud is on for Photos app.

The code I use to export photos:

let options = PHImageRequestOptions()
options.version = .original
options.isSynchronous = false
options.isNetworkAccessAllowed = true
options.deliveryMode = .highQualityFormat
let id = PHImageManager.default().requestImageDataAndOrientation(for: asset, options: options) { data, _, _, info in { /*...*/ }

After I deleted some photos and added some new, seems the error has gone on my devices. But my clients (users) sometimes see this error and I cannot figure out what to suggest them to fix the error.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!