Background: I have a Core Data model that uses CloudKit where I store images as "Binary Data" with "Allows External Storage" enabled. This works fine, but:
Problem: After a fresh install (meaning I deleted the app and optionally restarted the device, but didn't wipe the device itself) on my physical device, when the app starts, it loads ~150 of these images from iCloud and starts logging the following error for each:
Note: I formatted the output and replaced the UUIDs with
<AppUUID>,<UUID2>and<UUID3>to improve readability. The untouched output is below.
Receiptsis the name of the Core Data Entity that contains theimagefield.
open on /private/var/mobile/Containers/Data/Application/<AppUUID>/tmp/.LINKS/<UUID1>/<UUID2>_0x283d218b0:
No such file or directory
[error] error: Failed to create safeguard location for file: /var/mobile/Containers/Data/Application/<AppUUID>/Library/Application Support/.Receipts_SUPPORT/_EXTERNAL_DATA/<UUID2>
error: Error Domain=NSCocoaErrorDomain Code=4 "The file “<UUID2>” doesn’t exist."
UserInfo={
NSSourceFilePathErrorKey=/var/mobile/Containers/Data/Application/<AppUUID>/Library/Application Support/.Receipts_SUPPORT/_EXTERNAL_DATA/<UUID2>,
NSUserStringVariant=(Copy),
NSDestinationFilePath=/private/var/mobile/Containers/Data/Application/<AppUUID>/tmp/.LINKS/<UUID1>/<UUID2>_0x283d218b0,
NSFilePath=/var/mobile/Containers/Data/Application/<AppUUID>/Library/Application Support/.Receipts_SUPPORT/_EXTERNAL_DATA/<UUID2>,
NSUnderlyingError=0x28114f810 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}
}
and for some, but other images/UUIDs:
open on /private/var/mobile/Containers/Data/Application/<AppUUID>/tmp/.LINKS/<UUID1>/<UUID3>_0x283df45f0:
No such file or directory
[error] error: Failed to clone external data reference from /var/mobile/Containers/Data/Application/<AppUUID>/Library/Application Support/.Receipts_SUPPORT/_EXTERNAL_DATA/<UUID3>.interim
to /private/var/mobile/Containers/Data/Application/<AppUUID>/tmp/.LINKS/<UUID1>/<UUID3>_0x283df45f0
error: Error Domain=NSCocoaErrorDomain Code=4 "The file “<UUID3>.interim” doesn’t exist."
UserInfo={
NSSourceFilePathErrorKey=/var/mobile/Containers/Data/Application/<AppUUID>/Library/Application Support/.Receipts_SUPPORT/_EXTERNAL_DATA/<UUID3>.interim,
NSUserStringVariant=(Copy),
NSDestinationFilePath=/private/var/mobile/Containers/Data/Application/<AppUUID>/tmp/.LINKS/<UUID1>/<UUID3>_0x283df45f0,
NSFilePath=/var/mobile/Containers/Data/Application/<AppUUID>/Library/Application Support/.Receipts_SUPPORT/_EXTERNAL_DATA/<UUID3>.interim,
NSUnderlyingError=0x2810a86f0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}
}
unedited log output:
open on /private/var/mobile/Containers/Data/Application/EDBF2ECB-ECBA-4E6B-BF4E-48C91E2A0A61/tmp/.LINKS/DC56F37B-5992-4D6F-A789-05225C4B4399/99E2DEBB-8C99-4C2A-B962-4B26D87B8B6A_0x283d218b0: No such file or directory
[error] error: Failed to create safeguard location for file: /var/mobile/Containers/Data/Application/EDBF2ECB-ECBA-4E6B-BF4E-48C91E2A0A61/Library/Application Support/.Receipts_SUPPORT/_EXTERNAL_DATA/99E2DEBB-8C99-4C2A-B962-4B26D87B8B6A error: Error Domain=NSCocoaErrorDomain Code=4 "The file “99E2DEBB-8C99-4C2A-B962-4B26D87B8B6A” doesn’t exist." UserInfo={NSSourceFilePathErrorKey=/var/mobile/Containers/Data/Application/EDBF2ECB-ECBA-4E6B-BF4E-48C91E2A0A61/Library/Application Support/.Receipts_SUPPORT/_EXTERNAL_DATA/99E2DEBB-8C99-4C2A-B962-4B26D87B8B6A, NSUserStringVariant=(
Copy
), NSDestinationFilePath=/private/var/mobile/Containers/Data/Application/EDBF2ECB-ECBA-4E6B-BF4E-48C91E2A0A61/tmp/.LINKS/DC56F37B-5992-4D6F-A789-05225C4B4399/99E2DEBB-8C99-4C2A-B962-4B26D87B8B6A_0x283d218b0, NSFilePath=/var/mobile/Containers/Data/Application/EDBF2ECB-ECBA-4E6B-BF4E-48C91E2A0A61/Library/Application Support/.Receipts_SUPPORT/_EXTERNAL_DATA/99E2DEBB-8C99-4C2A-B962-4B26D87B8B6A, NSUnderlyingError=0x28114f810 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
open on /private/var/mobile/Containers/Data/Application/EDBF2ECB-ECBA-4E6B-BF4E-48C91E2A0A61/tmp/.LINKS/DC56F37B-5992-4D6F-A789-05225C4B4399/8C84C01C-EA5E-4DBF-A94E-0DFC1844BFE1_0x283df45f0: No such file or directory
[error] error: Failed to clone external data reference from /var/mobile/Containers/Data/Application/EDBF2ECB-ECBA-4E6B-BF4E-48C91E2A0A61/Library/Application Support/.Receipts_SUPPORT/_EXTERNAL_DATA/8C84C01C-EA5E-4DBF-A94E-0DFC1844BFE1.interim to /private/var/mobile/Containers/Data/Application/EDBF2ECB-ECBA-4E6B-BF4E-48C91E2A0A61/tmp/.LINKS/DC56F37B-5992-4D6F-A789-05225C4B4399/8C84C01C-EA5E-4DBF-A94E-0DFC1844BFE1_0x283df45f0 error: Error Domain=NSCocoaErrorDomain Code=4 "The file “8C84C01C-EA5E-4DBF-A94E-0DFC1844BFE1.interim” doesn’t exist." UserInfo={NSSourceFilePathErrorKey=/var/mobile/Containers/Data/Application/EDBF2ECB-ECBA-4E6B-BF4E-48C91E2A0A61/Library/Application Support/.Receipts_SUPPORT/_EXTERNAL_DATA/8C84C01C-EA5E-4DBF-A94E-0DFC1844BFE1.interim, NSUserStringVariant=(
Copy
), NSDestinationFilePath=/private/var/mobile/Containers/Data/Application/EDBF2ECB-ECBA-4E6B-BF4E-48C91E2A0A61/tmp/.LINKS/DC56F37B-5992-4D6F-A789-05225C4B4399/8C84C01C-EA5E-4DBF-A94E-0DFC1844BFE1_0x283df45f0, NSFilePath=/var/mobile/Containers/Data/Application/EDBF2ECB-ECBA-4E6B-BF4E-48C91E2A0A61/Library/Application Support/.Receipts_SUPPORT/_EXTERNAL_DATA/8C84C01C-EA5E-4DBF-A94E-0DFC1844BFE1.interim, NSUnderlyingError=0x2810a86f0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
My interpretation: Core Data tried to copy the downloaded, external file from /Library/Application Support/.Receipts_SUPPORT/_EXTERNAL_DATA/<UUID2> to /tmp/.LINKS/<UUID1>/<UUID2>_0x283d218b0 but Failed to create safeguard location for file because The file “<UUID2>” doesn’t exist. (at the source).
When I restart the app, the errors are gone. Also, as far as I can tell, all the images can be displayed.
Still it bugs me to have that many errors and not understand them. Does anybody understand more than I do?