3

I am trying to sync the data of a core data app between two devices via iCloud. It basically seems to work, but it mostly fails. Data does not show up, or shows up randomly / partially. Sync takes forever (sometimes: hours).

Of course I tried all obvious remedies such as deleting the apps and data from the devices etc.

I get the following messages (relevant excerpt):

[_PFUbiquityRecordsImporter operation:failedWithError:](839): 
CoreData: Ubiquity:  Import operation encountered an error: 
Error Domain=NSCocoaErrorDomain 
Code=134060 "The operation couldn’t be completed. 
(Cocoa error 134060.)" UserInfo=0x1106a6a0 
{exception=Attempted to perform an operation without an open database} 
while trying to import the log file at the URL: 
<PFUbiquityTransactionLog: 0x11062710>

right after

CoreData: Ubiquity: Error importing transaction log: 
<PFUbiquityTransactionLog: 0x110eb820> 

and later

-[_PFUbiquityRecordsImporter operation:failedWithError:](824): 
CoreData: Ubiquity:  Import operation encountered a corrupt log file, 
Error Domain=NSCocoaErrorDomain Code=134302 
"The operation couldn’t be completed. (Cocoa error 134302.)" 
UserInfo=0x12e0b0 {underlyingError=Error Domain=NSCocoaErrorDomain Code=19 
"The operation couldn’t be completed. (Cocoa error 19.)" UserInfo=0x1af070
{NSUnderlyingException=error during SQL execution : constraint failed,
NSFilePath=/var/mobile/Applications/
59087988-334C-40DC-9F6A-C7DA22F7B790/Documents/database.sqlite, 
NSSQLiteErrorDomain=19}, reason=Error encountered while importing 
transaction log at URL: <PFUbiquityTransactionLog: 0xe87b3f0>

Any clues about this "without an open database" error?
What to do about the "corrupt log file"?

Michael Celey
  • 12,645
  • 6
  • 57
  • 62
Mundi
  • 79,884
  • 17
  • 117
  • 140
  • 1
    That's the reason why I totally avoid using iCloud for CoreData in my app - it's unpredicatble. I've (almost) made syncing through Dropbox using simple JSON files and it's working quite good. Today I've also found other site which looks like a good alternative https://simperium.com/. – thom_ek May 20 '12 at 22:50
  • Your third block of errors has "constraint failed" as an issue. Are you sure that all your constraints are setup to allow an import of data (and is the data arriving in the correct order to ensure the constraints will not fail)? – Robotic Cat May 21 '12 at 00:31
  • As far as I can tell the constraints are set up correctly. After all, if you try to save with a failing constraint, it should anyway through an error independent from iCloud functionality. How would I influence "the correct order" in which "the data is arriving" (from where?) ? – Mundi May 21 '12 at 08:45
  • Did you eventually find a solution ? I am getting the exact same message. – Leonardo Jun 14 '12 at 06:56
  • Nope. But Apple has published a new [iOS 6 iCloud Design Guide](http://developer.apple.com/library/prerelease/ios/#documentation/General/Conceptual/iCloudDesignGuide/Chapters/Introduction.html#//apple_ref/doc/uid/TP40012094) (accessible if logged in). Maybe more luck with that. – Mundi Jun 14 '12 at 11:00
  • happens to me too. slightly annoyed that you can't really double check those transaction files to see what the corruption is. What kind of data are you iclouding? – Magnus Sep 04 '12 at 19:12
  • Did you ever find an answer for this? – Adam Carter Mar 02 '13 at 01:03
  • No, sorry. Actually, it got worse. See my [follow up question](http://stackoverflow.com/q/14478517/427083). – Mundi Mar 02 '13 at 08:23

0 Answers0