drewmccormack / ensembles

A synchronization framework for Core Data.
MIT License
1.63k stars 131 forks source link

Failed to merge: The operation couldn’t be completed. (CDEErrorDomain error 204.) #176

Closed tuckerwales closed 10 years ago

tuckerwales commented 10 years ago

I was using Ensembles in my app (with Core Data), then I ripped Core Data out to play around with Parse.

However, now I've decided to go with Core Data again (:/) - I added a new model and am now getting this new error.

I know it's because my new model is a newer version that the one in the cloud, but how do I resolve this?

Thanks.

drewmccormack commented 10 years ago

Ensembles can handle lightweight migrations. As long as your model is versioned, and includes all the versions that were used during syncing, it should merge without error.

I suspect you may have used a model during development which you then changed, and didn't leave in as a version of the model.

If this is the case, the best thing to do is to just nuke the cloud data. The easiest is problem to go to ~/Library/Mobile Documents on your Mac, locate your app's data, and delete the ensembles data.

Best to wait 10 mins too, and make sure no new files appear there.

After that you should be able to start sync again.

pventura1976 commented 9 years ago

I'm having the same issue but I think it could be in a different context:

2015-02-13 09:45:39.121 kPlant[1642:167378] Sync failed: Error Domain=CDEErrorDomain Code=204 "The operation couldn’t be completed. (CDEErrorDomain error 204.)" 2015-02-13 09:46:09.416 kPlant[1642:167378] Sync failed: Error Domain=CDEErrorDomain Code=204 "The operation couldn’t be completed. (CDEErrorDomain error 204.)" 2015-02-13 09:46:39.702 kPlant[1642:167378] Sync failed: Error Domain=CDEErrorDomain Code=204 "The operation couldn’t be completed. (CDEErrorDomain error 204.)"

The version of the app available on AppStore works fine, but not the new version that has model changes (nothing that a lightweight migration can't handle). I've tried to delete iCloud existing data but the error is still the same. There is no files at ~/Library/Mobile Documents

Any clue?

drewmccormack commented 9 years ago

That is caused by not having all the different model versions in your momd.

Is it possible you did a sync with an intermediate version of your model, that is no longer one of the versions?

To clear the data and start again:

  1. Deleech your ensemble
  2. Remove any files in Mobile Documents on all devices
  3. Leech your ensemble again.

The problems are probably because you are not deleeching, and the old sync data is cached locally on the device.

If you don’t want to explicitly deleech, you can also just remove the cached data. It is stored in Application Support.

Drew

On 13 Feb 2015, at 09:58, pventura1976 notifications@github.com wrote:

I'm having the same issue but I think it could be in a different context:

2015-02-13 09:45:39.121 kPlant[1642:167378] Sync failed: Error Domain=CDEErrorDomain Code=204 "The operation couldn’t be completed. (CDEErrorDomain error 204.)" 2015-02-13 09:46:09.416 kPlant[1642:167378] Sync failed: Error Domain=CDEErrorDomain Code=204 "The operation couldn’t be completed. (CDEErrorDomain error 204.)" 2015-02-13 09:46:39.702 kPlant[1642:167378] Sync failed: Error Domain=CDEErrorDomain Code=204 "The operation couldn’t be completed. (CDEErrorDomain error 204.)"

The version of the app available on AppStore works fine, but not the new version that has model changes (nothing that a lightweight migration can't handle). I've tried to delete iCloud existing data but the error is still the same. There is no files at ~/Library/Mobile Documents

Any clue?

— Reply to this email directly or view it on GitHub https://github.com/drewmccormack/ensembles/issues/176#issuecomment-74223302.

pventura1976 commented 9 years ago

May be this has happened during the development of the new version. But my real concern now is how this will affect users when I upload this new version. They will loose all data?

drewmccormack commented 9 years ago

The problem should not happen to your customers. I think it only arose because you probably made changed your most recent model a few times without creating a revision. In you end users case, they will jump from the old model version to the new, and all the versions will be present.

But you should definitely test. Install the App Store app, sync a bit, then install the new version and see if that works.

Kind regards, Drew

On 13 Feb 2015, at 18:33, pventura1976 notifications@github.com wrote:

May be this has happened during the development of the new version. But my real concern now is how this will affect users when I upload this new version. They will loose all data?

— Reply to this email directly or view it on GitHub.

pventura1976 commented 9 years ago

Thank you very much, I'm on it :-)