Yet another day, yet another iCloud error, I'm trying to get to some sort of stability. at least for a little functionality. Please explain to me what this error is about.
Here's when it occurred: Two devices sharing the same app (obviously). Both work quite well when both are online.
But, I took my iPhone without a sim and a network out for a day, added a bunch of stuff to it. And all changes are reflected within the app (obviously) and came back home, iPhone went online automatically via wifi. I didn't touch the iPhone nor did I open the app.
I fired up the iPad and launched the installed app. I expected the changes to just magically appear after taking some time of course, instead only a single update happened. That too was related to adding a new "User" entity. Not the stuff in it, or other new entities in it or related.
Here's the log part which I think is responsible, please tell me what's that all about, how did fetchedProperties come in? And how isToMany in there?
[NSFetchedPropertyDescription isToMany]: unrecognized selector sent to instance 0x43ad70
2012-02-24 23:06:01.216 App[3922:3877]
CoreData: Ubiquity: Error importing transaction log: <PFUbiquityTransactionLog: 0x4a198c0>
transactionLogLocation: <PFUbiquityLocation: 0x5685140>: /private/var/mobile/Library/Mobile Documents/PRSWRAABE7~com~testcloud~app/hgdata/mobile.D188D9B6-3C35-5E55-BB09-9BD78EC0CA64/com.testcloud.app/Zi4JIL_IINn2U12TdLepz0QoF922tqFvbcUPpcr3blU=/D320175C-FFA1-4C5C-A8C9-7CD23E85CAFD.1.cdt
transactionNumber: 39,
exception: -[NSFetchedPropertyDescription isToMany]: unrecognized selector sent to instance 0x43ad70
2012-02-24 23:06:01.216 App[3922:3877] -[_PFUbiquityRecordsImporter operation:failedWithError:](839):
CoreData: Ubiquity: Import operation ecountered an error:
Error Domain=NSCocoaErrorDomain Code=134060 "The operation couldn’t be completed. (Cocoa error 134060.)"
UserInfo=0x63359a0 {exception=-[NSFetchedPropertyDescription isToMany]: unrecognized selector sent to instance 0x43ad70}
while trying to import the log file at the URL: <PFUbiquityTransactionLog: 0x4a198c0>
transactionLogLocation: <PFUbiquityLocation: 0x5685140>: /private/var/mobile/Library/Mobile Documents/PRSWRAABE7~com~testcloud~app/hgdata/mobile.D188D9B6-3C35-5E55-BB09-9BD78EC0CA64/com.testcloud.app/Zi4JIL_IINn2U12TdLepz0QoF922tqFvbcUPpcr3blU=/D320175C-FFA1-4C5C-A8C9-7CD23E85CAFD.1.cdt
transactionNumber: 39
unrecognized selector sent to instance 0x43ad70 this message says that something going wrong with your code.
what is [NSFetchedPropertyDescription isToMany] ?? maybe it says that there are too many import transactions? looks weird
Related
The current app I have been working on has been running fine with no issues and suddenly, what seems like out of the blue as I hadn't made any changes, crashes at launch with an NSInvalidUnarchiveOperationException.
I made zero code changes and the only thing I did was to run the app on my Mac to see how it would look on MacOS. I then ran it again on my iPhone and that's when the problem started to occur. I use CoreData and CloudKit so decided to delete all data to see if that would solve the issue (not thinking it would based on the console log) and it still crashes.
The console states the following:
Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: '*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (NSFontDescriptor) for key (UIFontDescriptor) because no class named "NSFontDescriptor" was found; the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target). If the class was renamed, use setClassName:forClass: to add a class translation mapping to NSKeyedUnarchiver'
The thing is, although I use attributed strings I clearly haven't created a class named NSFontDescriptor. NSFontDescriptor is part of the SDK so I have no idea what's going on and how to fix this issue.
Any help would be much appreciated.
I am testing my app that uses iCloud. Sometimes, when I fire up the app I get the following warning in the console:
GEOResourceManifestServerRemoteProxy: Lost connection to geod
Once I get this warning I don't seem to get any data from iCloud. I have tried searching this issue, but have found very little information on it.
Any suggestions on how one should try to detect this issue and try to handle it?
I realize that you asked this back in March, but according to this it can happen when a login (like a connection to FB) has timed out.
If you do a stacktrace and see , then this should help.
And here is the code for that interface, if that's helpful.
In my project I use UIManagedDocument with CoreData and iCloud. There seems to be lots of bugs when creating a UIManagedDocument in iCloud - especially when there is no network service.
But now I get some strange errors/app crash with network service (also with wifi) when saving the document for creation:
-[PFUbiquitySetupAssistant validateOptionsWithError:](262): CoreData: Ubiquity: Error attempting to read ubiquity root url: file://localhost/private/var/mobile/Library/Mobile%20Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/.
Error: Error Domain=LibrarianErrorDomain Code=1 "The operation couldn’t be completed. (LibrarianErrorDomain error 1 - Unable to initiate item download.)" UserInfo=0x1f56d140 {NSURL=file://localhost/private/var/mobile/Library/Mobile%20Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/, NSUnderlyingError=0x1d89b4a0 "The operation couldn’t be completed. (UBErrorDomain error 0.)", NSDescription=Unable to initiate item download.}
userInfo: {
NSDescription = "Unable to initiate item download.";
NSURL = "file://localhost/private/var/mobile/Library/Mobile%20Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/";
NSUnderlyingError = "Error Domain=UBErrorDomain Code=0 \"The operation couldn\U2019t be completed. (UBErrorDomain error 0.)\"";
}
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'This NSPersistentStoreCoordinator has no persistent stores. It cannot perform a save operation.'
*** First throw call stack:
It says that a download operation from the transaction log folder couldn't be completed. I can't understand this as the app should create a document and not download anything.
btw the iCloud folder for the app is empty!
Deleting the iCloud account from device and logging in again didn't help too. The device is a iPhone 4S running iOS 6.
Anyone made similar experiences?
EDIT:
Now, after some hundrets of deletions and rebuilds I get a different error on the same device:
-[PFUbiquitySafeSaveFile waitForFileToUpload:](268): CoreData: Ubiquity: <PFUbiquityPeerReceipt: ...>(0)
permanentLocation: <PFUbiquityLocation: ...>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/mobile.XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Document/Q0_AoYZV8MTbAihmdWBiEFhxmCgziT9RyrvylTHgQP4=/receipt.0.cdt
safeLocation: <PFUbiquityLocation: ...>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/mobile.XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Document/Q0_AoYZV8MTbAihmdWBiEFhxmCgziT9RyrvylTHgQP4=/mobile.XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.0.cdt
currentLocation: <PFUbiquityLocation: ...>: /private/var/mobile/Library/Mobile Documents/XXXXXXXXXX~com~companyname~AppName/TransactionsFolder/mobile.XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/Document/Q0_AoYZV8MTbAihmdWBiEFhxmCgziT9RyrvylTHgQP4=/mobile.XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.0.cdt
kv: (null)
Safe save failed for file, error: Error Domain=NSCocoaErrorDomain Code=512 "The file upload timed out." UserInfo=0x1de36dc0 {NSLocalizedDescription=The file upload timed out.}
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'This NSPersistentStoreCoordinator has no persistent stores. It cannot perform a save operation.'
*** First throw call stack:
Somehow it seems like the device has no access to iCloud service even though it gets a iCloud token and reachability is fine...
Yes, I've had very similar experiences. These are internal bugs in Core Data's iCloud integration. They don't mean that you did anything wrong, and there's nothing you can do in code to fix them. You're right-- you aren't downloading anything in your code, but Core Data is trying to do so, behind the scenes, and failing. This is completely out of your control.
The first errors say that the framework was unable to download existing transaction files. There might not be any, but it can't even tell. The second error says that it was unable to create any new transaction files. You're right-- you have no access to iCloud, even though the API says that you do.
You might be able to get things working again by finding your app in Settings --> iCloud and deleting any data there, deleting your app from the device, sacrificing a chicken, and trying again. But the problem comes back. File bugs with Apple and hope that it gets fixed.
If you have a device that is refusing to synchronize after you have reset its iCloud data, try resetting all settings via Settings > General > Reset All Settings. This approach won’t delete any application data, and can resolve the “Error attempting to read ubiquity root url” error message.
I know this is old, but I have been chasing a similar problem and perhaps the following will help others:
In my case I get this after deleting iCould data and the app under development and rebuilding from scratch. A full shutdown and restart of the device seems to fix it - not sure why and perhaps Timbo's 'Reset All Settings' does the same thing - but this way you don't lose other app settings as well.
Ali
I'm able to complete my iphone app using core data internally.
But for the first time when I'm running in simulator or on device its crashing with following error:
2010-03-18 10:55:41.785 CrData[1605:4603] Unresolved error Error Domain=NSCocoaErrorDomain Code=513 UserInfo=0x50448d0 "Operation could not be completed. (Cocoa error 513.)", {
NSUnderlyingException = Error validating url for store;
}
When I run the app again in simulator or on device, its running perfectly. I'm not able to identify the exact problem. Can some one guide me on how to proceed further???
You need to unroll the errors and see what is going on. Inside of that error (which you can set a break point on objc_exception_thrown to catch it) is the userInfo dictionary which you can interrogate to see what the underlying errors are.
update
What does your NSPersistentStoreCoordinator creation code look like?
Did you add a break point and do a po [error userInfo] so see if there were any additional errors in the userInfo?
Core Data can and does send you a hierarchy of errors and frequently on a small amount of information is exposed at the top error. Unrolling the errors via the debugger is best to determine the underlying causes.
update
Code error 513 means, write permissions for creating store in core data app failed. But the same piece of code is running well from next time. So, what might be the actual problem is not known to me..... how to proceed here.
Again, what does your persistent store creation code look like? You need to post some code so that I can take a look at it. Otherwise I am just guessing which is no fun.
8.2 has become more strict on the location (and permissions) of your persistent store. I've just seen the "513" error appear when the database was stored in the bundle and used with a read only option. Using a device with 8.1 it worked without failing, but on 8.2 the error and exception appeared causing a crash. On the simulator the exception did not occur and happily continued to work.
The solution that worked to copy the database into the application documents directory at start up.
NSFileManager copyItemAtURL:toURL:error will come in useful.
I'm trying to get ZSync to work between a desktop and iPhone app. I've got my schemas set up and all info matches between my MOM and my schema so I should be good to go. When I initiate my sync, however, I get this error.
|Miscellaneous|Error| SyncServices
precondition failure in [ISyncSession
_validateClient:entityNames:beforeDate:clientHasTruthForEntityNames:target:selector:]:
no entities specified
Anyone know what this means, and how to debug it?
I'm a novice with this SyncServices stuff.
Cheers!
Update
Ok, I've got it showing in syncrospector, but still getting the unrecognized error.
What do you mean by my clientdescription at the Daemon is wrong?
Thanks.
Update
Alright, I had the clientDescription working , but now when this fires:
ZAssert([[ISyncManager sharedManager]
registerSchemaWithBundlePath:path],
#"Failed to register sync schema");
I get this error :(
[NOTE: this exception originated in
the server.]
*** -[NSCFArray insertObject:atIndex:]: attempt to
insert nil
This is an issue in your Sync Services settings. It means that you have not declared what entities need to be synced. I suggest comparing your SyncSchema subproject (for your desktop app side) to the one included in the SampleDesktop project.
update
I checked all that, to no avail. I am using a versioned mom, would that make a difference? In my ManagedObjectModels, should I use the name of the version or the collection? (mom or momd?) Thanks, I'm almost there!
No, the schema should point to your latest model. Are you certain that it is pointing to it correctly? That can be one of the trickiest bits. Are you including the model in the schema bundle or are you making a reference to it?
update
First, please put these updates into your question, the comment section is really not meant for them.
Alright, got past this problem. Syncing starts now I get "failed to register client because: client named Xmac wants to sync unrecognized entity named: X.Entity" This happens with all my entities, sadly.
This error means that your sync schema is still not completely valid. Does your desktop client sync?
Can you see its data in the syncrospector?
If so then your clientdescription at the Daemon is wrong. If it doesn't sync then solve that first as it sounds like your SyncSchema bundle is still incorrect. I suggest trying to compare it against the sampleDesktop application that is included in the project.
update Syncrospector
Ok, I've got it showing in syncrospector, but still getting the unrecognized error. What do you mean by my clientdescription at the Daemon is wrong? Thanks.
In the syncrospector I am guessing that you are seeing all of your entities and data?
On the Daemon, there is a clientDescription.plist. This plist describes what data that the Daemon is going to sync with. That plist needs to be updated (since the default one refers to the sample app, etc.) to reference your data structures just like your desktop application does.
In the very near future, this piece will be moved to a plugin so that you are not modifying the daemon directly. Expect to see updates on the project itself during the next couple of weeks. But for now, (and will be reusable), modify the plist inside of the daemon and you should be ready to sync.
update ZAssert
That line unwinds into:
BOOL success = [[ISyncManager sharedManager] registerSchemaWithBundlePath:path];
NSAssert(success, #"Failed to register sync schema");
A few things can cause this:
Your path is nil, check that in the debugger
There is something wrong with your sync schema.
What other debug comments are you seeing?