Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 10 Core Data Exception Code error: (6922)

We're experiencing an exception from our SQL database while trying to migrate Core Data on iOS 10. The exception is thrown but it seems the migration still succeeds. We do a manual migration then MagicalRecord handles the rest of the setup. Has anyone else experienced this before/ knows how to resolve this?

Error output:

    CoreData: error: (6922) I/O error for database at /var/mobile/Containers/Data/Application/9CA333FB-49CB-4168-B26A-A6F6E6CF94C7/Documents/Messaging.sqlite.  SQLite error code:6922, 'disk I/O error'
CoreData: error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///var/mobile/Containers/Data/Application/9CA333FB-49CB-4168-B26A-A6F6E6CF94C7/Documents/Messaging.sqlite options:{
NSInferMappingModelAutomaticallyOption = 1;
NSMigratePersistentStoresAutomaticallyOption = 1;
NSSQLitePragmasOption =     {
    "journal_mode" = WAL;
};
} ... returned error Error Domain=NSCocoaErrorDomain Code=256 "The file couldn't be opened." UserInfo={NSSQLiteErrorDomain=6922, NSUnderlyingException=I/O error for database at /var/mobile/Containers/Data/Application/9CA333FB-49CB-4168-B26A-A6F6E6CF94C7/Documents/Messaging.sqlite.  SQLite error code:6922, 'disk I/O error'} with userInfo dictionary {
NSSQLiteErrorDomain = 6922;
NSUnderlyingException = "I/O error for database at /var/mobile/Containers/Data/Application/9CA333FB-49CB-4168-B26A-A6F6E6CF94C7/Documents/Messaging.sqlite.  SQLite error code:6922, 'disk I/O error'";
}
CoreData: error: Illegal attempt to save to a file that was never opened.  "This NSPersistentStoreCoordinator has no persistent stores (I/O error).  It cannot perform a save operation.".  Last recorded error = Error Domain=NSCocoaErrorDomain Code=256 "The file "Messaging.sqlite" couldn't be opened." UserInfo={NSFilePath=/var/mobile/Containers/Data/Application/9CA333FB-49CB-4168-B26A-A6F6E6CF94C7/Documents/Messaging.sqlite, NSSQLiteErrorDomain=6922} / {
NSFilePath = "/var/mobile/Containers/Data/Application/9CA333FB-49CB-4168-B26A-A6F6E6CF94C7/Documents/Messaging.sqlite";
NSSQLiteErrorDomain = 6922;
}
like image 561
sammarshall61 Avatar asked Feb 17 '17 22:02

sammarshall61


1 Answers

I encountered this issue today after upgrading to Xcode 11 beta 5.

Running the command to reset all of my simulators corrected it for me:

xcrun simctl erase all
like image 156
CodeBender Avatar answered Nov 09 '22 13:11

CodeBender