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;
}
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With