karelia / BSManagedDocument

Brings UIManagedDocument's design to OS X
Other
55 stars 25 forks source link

Error when saving external data references #13

Open adib opened 11 years ago

adib commented 11 years ago

I've been trying out your fork and been experiencing crashes when Core Data tries to save its additional content - crash with exception message: Can't open externalDataReference interim file : 2

Any idea how to fix this?

Exception log below


2013-05-12 02:20:49.781 ScuttlebuttPro[31963:12b37] An uncaught exception was raised 2013-05-12 02:20:49.782 ScuttlebuttPro[31963:12b37] Can't open externalDataReference interim file : 2 2013-05-12 02:20:49.792 ScuttlebuttPro[31963:12b37](0 CoreFoundation 0x00007fff90d5ab06 exceptionPreprocess + 198 1 libobjc.A.dylib 0x00007fff926983f0 objc_exception_throw + 43 2 CoreData 0x00007fff93125e83 +[_PFRoutines writePFExternalReferenceDataToInterimFile:] + 483 3 CoreData 0x00007fff93158842 -[NSSQLCore writeExternalDataReferences] + 210 4 CoreData 0x00007fff930ca7e8 -[NSSQLCore saveChanges:] + 280 5 CoreData 0x00007fff9309dada -[NSSQLCore executeRequest:withContext:error:] + 298 6 CoreData 0x00007fff9309ce0c -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 1756 7 CoreData 0x00007fff930c5a98 -[NSManagedObjectContext save:] + 456 8 ScuttlebuttOSX 0x0000000100218c5b -[BSManagedDocument preflightURL:thenSaveContext:error:] + 299 9 ScuttlebuttOSX 0x00000001002189cd 50-[BSManagedDocument writeStoreContentToURL:error:]_block_invoke + 61 10 CoreData 0x00007fff930e34dc developerSubmittedBlockToNSManagedObjectContextPerform + 92 11 libdispatch.dylib 0x00007fff98b880b6 _dispatch_client_callout + 8 12 libdispatch.dylib 0x00007fff98b89723 _dispatch_barrier_sync_f_invoke + 39 13 CoreData 0x00007fff930e3457 -[NSManagedObjectContext performBlockAndWait:] + 183 14 ScuttlebuttOSX 0x000000010021885e -[BSManagedDocument writeStoreContentToURL:error:] + 606 15 ScuttlebuttOSX 0x000000010021821e -[BSManagedDocument writeToURL:ofType:forSaveOperation:originalContentsURL:error:] + 2270 16 ScuttlebuttOSX 0x00000001002175cf -[BSManagedDocument writeSafelyToURL:ofType:forSaveOperation:error:] + 1199 17 AppKit 0x00007fff97f77467 block_global_90 + 76 18 AppKit 0x00007fff97f84b6f block_global_97 + 242 19 libdispatch.dylib 0x00007fff98b8bf01 _dispatch_call_block_and_release + 15 20 libdispatch.dylib 0x00007fff98b880b6 _dispatch_client_callout + 8 21 libdispatch.dylib 0x00007fff98b891fa _dispatch_worker_thread2 + 304 22 libsystem_c.dylib 0x00007fff93452d0b _pthread_wqthread + 404 23 libsystem_c.dylib 0x00007fff9343d1d1 start_wqthread + 13) 2013-05-12 02:20:49.878 ScuttlebuttPro[31963:12b37] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Can't open externalDataReference interim file : 2' * First throw call stack: ( 0 CoreFoundation 0x00007fff90d5ab06 exceptionPreprocess + 198 1 libobjc.A.dylib 0x00007fff926983f0 objc_exception_throw + 43 2 CoreData 0x00007fff93125e83 +[_PFRoutines writePFExternalReferenceDataToInterimFile:] + 483 3 CoreData 0x00007fff93158842 -[NSSQLCore writeExternalDataReferences] + 210 4 CoreData 0x00007fff930ca7e8 -[NSSQLCore saveChanges:] + 280 5 CoreData 0x00007fff9309dada -[NSSQLCore executeRequest:withContext:error:] + 298 6 CoreData 0x00007fff9309ce0c -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 1756 7 CoreData 0x00007fff930c5a98 -[NSManagedObjectContext save:] + 456 8 ScuttlebuttOSX 0x0000000100218c5b -[BSManagedDocument preflightURL:thenSaveContext:error:] + 299 9 ScuttlebuttOSX 0x00000001002189cd 50-[BSManagedDocument writeStoreContentToURL:error:]_block_invoke + 61 10 CoreData 0x00007fff930e34dc developerSubmittedBlockToNSManagedObjectContextPerform + 92 11 libdispatch.dylib 0x00007fff98b880b6 _dispatch_client_callout + 8 12 libdispatch.dylib 0x00007fff98b89723 _dispatch_barrier_sync_f_invoke + 39 13 CoreData 0x00007fff930e3457 -[NSManagedObjectContext performBlockAndWait:] + 183 14 ScuttlebuttOSX 0x000000010021885e -[BSManagedDocument writeStoreContentToURL:error:] + 606 15 ScuttlebuttOSX 0x000000010021821e -[BSManagedDocument writeToURL:ofType:forSaveOperation:originalContentsURL:error:] + 2270 16 ScuttlebuttOSX 0x00000001002175cf -[BSManagedDocument writeSafelyToURL:ofType:forSaveOperation:error:] + 1199 17 AppKit 0x00007fff97f77467 block_global_90 + 76 18 AppKit 0x00007fff97f84b6f block_global_97 + 242 19 libdispatch.dylib 0x00007fff98b8bf01 _dispatch_call_block_and_release + 15 20 libdispatch.dylib 0x00007fff98b880b6 _dispatch_client_callout + 8 21 libdispatch.dylib 0x00007fff98b891fa _dispatch_worker_thread2 + 304 22 libsystem_c.dylib 0x00007fff93452d0b _pthread_wqthread + 404 23 libsystem_c.dylib 0x00007fff9343d1d1 start_wqthread + 13 ) libc++abi.dylib: terminate called throwing an exception

mikeabdullah commented 11 years ago

Hi! Can I ask which branch you're on for this? I found our ksmanageddocument one isn't quite suitable for non-atomic stores; duplicate-sqlite-stores corrects that.

adib commented 11 years ago

ksmanageddocument, 8d51e4f. Btw, Iv'e just pushed a fix.

adib commented 11 years ago

Yeah, I've just pushed a fix for this, but there were some changes that may not be compatible with your code base.

https://github.com/adib/BSManagedDocument/commit/bae41a09c809ef85952e458176e328965b815dd2

Btw, I'll be going to bed now. It's 4:21 here. Let me know if there's anything I can do for you on this.

adib commented 11 years ago

Did some more testing and fixes: 3dec050