iOS 10 Core Data Exception Code error: (6922)
Asked Answered
K

1

14

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;
}
Krystynakshatriya answered 17/2, 2017 at 22:20 Comment(1)
hey were you able to resolve the problem? Can you check out the solution I've proposed?Lichter
V
3

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
Vitus answered 1/8, 2019 at 13:54 Comment(1)
@Karaban Regarding my experience, it could be related to simulator changes since there were other issues associated with them. No changes were made to the app to explain an incompatibility.Vitus

© 2022 - 2024 — McMap. All rights reserved.