-
Re: NSCocoaErrorDomain 513
eskimo Sep 16, 2016 1:11 AM (in response to bvrlt)I'm fighting with the following error NSCocoaErrorDomain 513 reported by a very small number of users (~ 0.01%):
Do the users who have this problem always have the problem? Or can they do something to avoid it (restart the device, delete and reinstall your app, and so on)?
Do the users who have this problem have anything in common? All in the same country? Or using the same language? Or locale? All using a particular type of device? Or using a jailbroken device?
Share and Enjoy —
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
Re: NSCocoaErrorDomain 513
bvrlt Sep 16, 2016 7:56 AM (in response to eskimo)Hello,
So far I haven't been able to find a pattern and I'm investigating with more logs.
I know the following information about the people who have reported the issue, without being able to draw statistical conclusions:
- people who have this problem seem to always have it
- on non-jailbroken devices
- at least for English locales
- on devices which have a large amount of free disk space
- at least on iPhone 6, iPhone 6S+
- at least on iOS 9.3.5
Restarting the phone doesn't help.
We cannot ask them to remove and reinstall the app as they would lose their data.
Do you have any hint in what direction I could search for this issue?
Thanks,
Bruno
-
Re: NSCocoaErrorDomain 513
eskimo Sep 21, 2016 2:03 AM (in response to bvrlt)Do you have any hint in what direction I could search for this issue?
You could create a build that, when it gets this error, manually does the equivalent of
-createDirectoryAtPath:xxx
using low-level BSD APIs to see which call is actually flagging the error, then pass that build to a few willing victims^H^H^H^H^H^H^H testers.Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
Re: NSCocoaErrorDomain 513
bvrlt Sep 20, 2016 4:12 AM (in response to eskimo)OK - I will try that but it's hard to get custom builds in the hands of John Doe, especially when they stop answering the support emails
Could it be related to data protection in any way? I don't think it should be the case as the application is in the foreground when this error happens (this error happens on a user action).
-
Re: NSCocoaErrorDomain 513
eskimo Sep 21, 2016 2:05 AM (in response to bvrlt)Could it be related to data protection in any way?
I wouldn’t have thought so; data protection problems typically involve the contents of files, and
-createDirectoryAtPath:xxx
is manipulating file system metadata.Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
Re: NSCocoaErrorDomain 513
bvrlt Oct 18, 2016 12:38 PM (in response to eskimo)We have been unable to find a user able to install a test build so far.
I can confirm this issue is also affecting iOS 10 and it could happen after updating the app. Could it be that the app sandbox directory would be cached in some very rare instance resulting in valid paths generated in the app?
Additionally, I know that the app is able to write to Core Data (eg. some metadata is registered, but the associated data files cannot be created because of this error).
I have also evidence that files fail to be created as the following code fails for these users according to the logs:
if (![UIImageJPEGRepresentation(image, 0.75) writeToFile:self.filePath options:NSDataWritingAtomic error:&error]) {
DDLogError(@"Error while persisting cached image: %@", error);
}
I have submitted a radar: 28827236.
-
Re: NSCocoaErrorDomain 513
bvrlt Apr 11, 2017 8:14 AM (in response to eskimo)Hello,
This issue is still happening and we are unable to find a willing tester.
Is there any chance this can be due to a file system corruption?
Thanks,
Bruno
-
Re: NSCocoaErrorDomain 513
sykste Apr 19, 2017 9:41 PM (in response to bvrlt)I had the same issue, and the problem was that in my "Create Directory" statement I was not using the variable from appendstring, but just the the folder I wanted to create. Here is the method I am now using:
-(BOOL)doCheckRptFolder:(id)sender inFolder:(NSString *)inFolder
{
BOOL folderFound = NO;
NSString *folderPath = nil;
NSFileManager *fileManager = [[NSFileManager alloc] init];
fileManager.delegate = self;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
folderPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:inFolder];
if ([fileManager fileExistsAtPath:folderPath])
{
folderFound = YES;
return folderFound;
}
else
{
/
NSError *error = nil;
if (![fileManager createDirectoryAtPath:folderPath withIntermediateDirectories:YES attributes:nil error:&error])
{
NSLog(@"Create directory error: %@", [error userInfo]);
folderFound = NO;
return folderFound;
}
}
return folderFound;
}
-
-
-
-
-
-