How to debug 'no entities specified' when working with ZSync and CoreData Syncing

422 views Asked by At

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

1

There are 1 answers

3
Marcus S. Zarra On

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:

  1. Your path is nil, check that in the debugger
  2. There is something wrong with your sync schema.

What other debug comments are you seeing?