Core Data: executeFetchRequest:error: leads to SQLite error code:522, 'not an error'

Originator:neocool2
Number:rdar://22047995 Date Originated:29-Jul-2015 11:11 AM
Status:Open Resolved:
Product:iOS SDK Product Version:
Classification:Serious Bug Reproducible:Always
 
Summary:

I’m running the tests of my project, code can be found here: https://github.com/contentful/contentful.objc

The Core Data part of the test suite has been working fine for iOS 6, 7 and 8, but when running the tests using Xcode 7 / iOS 9 in the iOS simulator, I’m receiving an “SQLite error code:522, 'not an error’”. You can find the full console output attached to this bug report.

More specifically, the failing test is “-[CoreDataBasicTests testContinueSyncWithSameManager]” — it fails every time and the error is quite non-descriptive.

Steps to Reproduce:

1. Run the test suite of https://github.com/contentful/contentful.objc

Expected Results:

The test suite passes, as it does on iOS 8 using Xcode 6.4

Actual Results:

The test “-[CoreDataBasicTests testContinueSyncWithSameManager]” fails because of “SQLite error code:522, 'not an error’”.

Regression:

This has been working fine for multiple iOS releases, as described above.

Notes:

I’m open to the possibility that this is my fault, but the error message needs to be a lot more descriptive.

Comments

Seeing this as well

By RRomanchuk at Aug. 23, 2015, 8:50 p.m. (reply...)

For completeness sake, this is the attached log of console output

Test Suite 'All tests' started at 2015-07-29 11:03:39.217 Test Suite 'CDA Tests.xctest' started at 2015-07-29 11:03:39.219 Test Suite 'AddContentTypesSyncTests' started at 2015-07-29 11:03:39.219 Test Case '-[AddContentTypesSyncTests beforeAll]' started. Test Case '-[AddContentTypesSyncTests beforeAll]' passed (0.016 seconds). Test Case '-[AddContentTypesSyncTests testAddContentTypesDuringSyncSession]' started. Test Case '-[AddContentTypesSyncTests testAddContentTypesDuringSyncSession]' passed (0.422 seconds). Test Case '-[AddContentTypesSyncTests afterAll]' started. Test Case '-[AddContentTypesSyncTests afterAll]' passed (0.004 seconds). Test Suite 'AddContentTypesSyncTests' passed at 2015-07-29 11:03:39.666. Executed 3 tests, with 0 failures (0 unexpected) in 0.442 (0.447) seconds Test Suite 'ArrayTests' started at 2015-07-29 11:03:39.670 Test Case '-[ArrayTests beforeAll]' started. Test Case '-[ArrayTests beforeAll]' passed (0.002 seconds). Test Case '-[ArrayTests testFetchResourcesOfTypeAsset]' started. Test Case '-[ArrayTests testFetchResourcesOfTypeAsset]' passed (2.217 seconds). Test Case '-[ArrayTests testFetchResourcesOfTypeContentType]' started. Test Case '-[ArrayTests testFetchResourcesOfTypeContentType]' passed (0.527 seconds). Test Case '-[ArrayTests testFetchResourcesOfTypeEntry]' started. Test Case '-[ArrayTests testFetchResourcesOfTypeEntry]' passed (0.467 seconds). Test Case '-[ArrayTests testIncludes]' started. Test Case '-[ArrayTests testIncludes]' passed (0.220 seconds). Test Case '-[ArrayTests testPaging]' started. Test Case '-[ArrayTests testPaging]' passed (0.577 seconds). Test Case '-[ArrayTests testRequest]' started. Test Case '-[ArrayTests testRequest]' passed (0.003 seconds). Test Case '-[ArrayTests afterAll]' started. Test Case '-[ArrayTests afterAll]' passed (0.072 seconds). Test Suite 'ArrayTests' passed at 2015-07-29 11:03:43.762. Executed 8 tests, with 0 failures (0 unexpected) in 4.085 (4.092) seconds Test Suite 'AssetTests' started at 2015-07-29 11:03:43.763 Test Case '-[AssetTests beforeAll]' started. Test Case '-[AssetTests beforeAll]' passed (0.001 seconds). Test Case '-[AssetTests testAssertImageQuality]' started. 2015-07-29 11:03:43.778 UFO Example[18593:7124781] * Assertion failure in -[CDAAsset imageURLWithSize:quality:format:fit:focus:radius:background:progressive:], /Users/boris/Projects/contentful.objc/Code/CDAAsset.m:166 Test Case '-[AssetTests testAssertImageQuality]' passed (4.615 seconds). Test Case '-[AssetTests testChangeImageBackgroundBlue]' started. Test Case '-[AssetTests testChangeImageBackgroundBlue]' passed (0.028 seconds). Test Case '-[AssetTests testChangeImageBackgroundHex]' started. Test Case '-[AssetTests testChangeImageBackgroundHex]' passed (0.387 seconds). Test Case '-[AssetTests testChangeImageFitCrop]' started. Test Case '-[AssetTests testChangeImageFitCrop]' passed (0.043 seconds). Test Case '-[AssetTests testChangeImageFitDefault]' started. Test Case '-[AssetTests testChangeImageFitDefault]' passed (0.007 seconds). Test Case '-[AssetTests testChangeImageFitFill]' started. Test Case '-[AssetTests testChangeImageFitFill]' passed (0.046 seconds). Test Case '-[AssetTests testChangeImageFitPad]' started. Test Case '-[AssetTests testChangeImageFitPad]' passed (0.048 seconds). Test Case '-[AssetTests testChangeImageFitScale]' started. Test Case '-[AssetTests testChangeImageFitScale]' passed (0.062 seconds). Test Case '-[AssetTests testChangeImageFitThumb]' started. Test Case '-[AssetTests testChangeImageFitThumb]' passed (0.081 seconds). Test Case '-[AssetTests testChangeImageFocusRight]' started. Test Case '-[AssetTests testChangeImageFocusRight]' passed (0.209 seconds). Test Case '-[AssetTests testChangeImageFocusTopRight]' started. Test Case '-[AssetTests testChangeImageFocusTopRight]' passed (0.054 seconds). Test Case '-[AssetTests testChangeImageFormatToJPEG]' started. Test Case '-[AssetTests testChangeImageFormatToJPEG]' passed (0.007 seconds). Test Case '-[AssetTests testChangeImageFormatToPNG]' started. Test Case '-[AssetTests testChangeImageFormatToPNG]' passed (0.008 seconds). Test Case '-[AssetTests testChangeImageProgressive]' started. Test Case '-[AssetTests testChangeImageProgressive]' passed (0.043 seconds). Test Case '-[AssetTests testChangeImageQuality]' started. Test Case '-[AssetTests testChangeImageQuality]' passed (0.010 seconds). Test Case '-[AssetTests testChangeImageRadiusAny]' started. Test Case '-[AssetTests testChangeImageRadiusAny]' passed (0.046 seconds). Test Case '-[AssetTests testChangeImageRadiusMax]' started. Test Case '-[AssetTests testChangeImageRadiusMax]' passed (0.043 seconds). Test Case '-[AssetTests testDoNotRequireClientPropertyForGeneratingURL]' started. Test Case '-[AssetTests testDoNotRequireClientPropertyForGeneratingURL]' passed (0.008 seconds). Test Case '-[AssetTests testResizeAsset]' started. Test Case '-[AssetTests testResizeAsset]' passed (0.018 seconds). Test Case '-[AssetTests afterAll]' started. Test Case '-[AssetTests afterAll]' passed (0.017 seconds). Test Suite 'AssetTests' passed at 2015-07-29 11:03:49.563. Executed 21 tests, with 0 failures (0 unexpected) in 5.783 (5.800) seconds Test Suite 'ClientConfiguration' started at 2015-07-29 11:03:49.564 Test Case '-[ClientConfiguration beforeAll]' started. Test Case '-[ClientConfiguration beforeAll]' passed (0.001 seconds). Test Case '-[ClientConfiguration testClientCanBeInstantiatedWithoutSpaceKey]' started. Test Case '-[ClientConfiguration testClientCanBeInstantiatedWithoutSpaceKey]' passed (0.003 seconds). Test Case '-[ClientConfiguration testCustomUserAgent]' started. Test Case '-[ClientConfiguration testCustomUserAgent]' passed (0.004 seconds). Test Case '-[ClientConfiguration testDefaultUserAgent]' started. Test Case '-[ClientConfiguration testDefaultUserAgent]' passed (0.003 seconds). Test Case '-[ClientConfiguration afterAll]' started. Test Case '-[ClientConfiguration afterAll]' passed (0.006 seconds). Test Suite 'ClientConfiguration' passed at 2015-07-29 11:03:49.588. Executed 5 tests, with 0 failures (0 unexpected) in 0.015 (0.025) seconds Test Suite 'ComplexLinkSyncTests' started at 2015-07-29 11:03:49.591 Test Case '-[ComplexLinkSyncTests beforeAll]' started. Test Case '-[ComplexLinkSyncTests beforeAll]' passed (0.005 seconds). Test Case '-[ComplexLinkSyncTests testComplexLinkSync]' started. /Users/boris/Projects/contentful.objc/Tests/ComplexLinkSyncTests.m:64: error: -[ComplexLinkSyncTests testComplexLinkSync] : failed - Error: Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: not found (404)" UserInfo={NSUnderlyingError=0x7fa8bfbe51e0 {Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/plain" UserInfo={com.alamofire.serialization.response.error.response= { URL: https://cdn.contentful.com/spaces/emh6o2ireilu/content_types?limit=2&sys.id%5Bin%5D=5kLp8FbRwAG0kcOOYa6GMa%2C4yCmJfmk1WeqACagaemOIs } { status code: 404, headers { } }, NSErrorFailingURLKey=https://cdn.contentful.com/spaces/emh6o2ireilu/content_types?limit=2&sys.id[in]=5kLp8FbRwAG0kcOOYa6GMa%2C4yCmJfmk1WeqACagaemOIs, com.alamofire.serialization.response.error.data={length = 692, capacity = 1024, bytes = 0x7b0a202022737973223a207b0a202020 ... 7d0a20205d0a7d0a}, NSLocalizedDescription=Request failed: unacceptable content-type: text/plain}}, com.alamofire.serialization.response.error.response= { URL: https://cdn.contentful.com/spaces/emh6o2ireilu/content_types?limit=2&sys.id%5Bin%5D=5kLp8FbRwAG0kcOOYa6GMa%2C4yCmJfmk1WeqACagaemOIs } { status code: 404, headers { } }, NSErrorFailingURLKey=https://cdn.contentful.com/spaces/emh6o2ireilu/content_types?limit=2&sys.id[in]=5kLp8FbRwAG0kcOOYa6GMa%2C4yCmJfmk1WeqACagaemOIs, com.alamofire.serialization.response.error.data={length = 692, capacity = 1024, bytes = 0x7b0a202022737973223a207b0a202020 ... 7d0a20205d0a7d0a}, NSLocalizedDescription=Request failed: not found (404)} /Users/boris/Projects/contentful.objc/Tests/ComplexLinkSyncTests.m:72: error: -[ComplexLinkSyncTests testComplexLinkSync] : ((1U) equal to (self.numberOfEntriesCreated)) failed: ("1") is not equal to ("0") /Users/boris/Projects/contentful.objc/Tests/ComplexLinkSyncTests.m:74: error: -[ComplexLinkSyncTests testComplexLinkSync] : ((1U) equal to (self.numberOfEntriesDeleted)) failed: ("1") is not equal to ("0") Test Case '-[ComplexLinkSyncTests testComplexLinkSync]' failed (0.020 seconds). Test Case '-[ComplexLinkSyncTests testComplexLinkSyncWithoutSyncSpaceInstance]' started. /Users/boris/Projects/contentful.objc/Tests/ComplexLinkSyncTests.m:105: error: -[ComplexLinkSyncTests testComplexLinkSyncWithoutSyncSpaceInstance] : failed - Error: Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: not found (404)" UserInfo={NSUnderlyingError=0x7fa8bfbc6970 {Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/plain" UserInfo={com.alamofire.serialization.response.error.response= { URL: https://cdn.contentful.com/spaces/emh6o2ireilu/content_types?limit=2&sys.id%5Bin%5D=5kLp8FbRwAG0kcOOYa6GMa%2C4yCmJfmk1WeqACagaemOIs } { status code: 404, headers { } }, NSErrorFailingURLKey=https://cdn.contentful.com/spaces/emh6o2ireilu/content_types?limit=2&sys.id[in]=5kLp8FbRwAG0kcOOYa6GMa%2C4yCmJfmk1WeqACagaemOIs, com.alamofire.serialization.response.error.data={length = 692, capacity = 1024, bytes = 0x7b0a202022737973223a207b0a202020 ... 7d0a20205d0a7d0a}, NSLocalizedDescription=Request failed: unacceptable content-type: text/plain}}, com.alamofire.serialization.response.error.response= { URL: https://cdn.contentful.com/spaces/emh6o2ireilu/content_types?limit=2&sys.id%5Bin%5D=5kLp8FbRwAG0kcOOYa6GMa%2C4yCmJfmk1WeqACagaemOIs } { status code: 404, headers { } }, NSErrorFailingURLKey=https://cdn.contentful.com/spaces/emh6o2ireilu/content_types?limit=2&sys.id[in]=5kLp8FbRwAG0kcOOYa6GMa%2C4yCmJfmk1WeqACagaemOIs, com.alamofire.serialization.response.error.data={length = 692, capacity = 1024, bytes = 0x7b0a202022737973223a207b0a202020 ... 7d0a20205d0a7d0a}, NSLocalizedDescription=Request failed: not found (404)} /Users/boris/Projects/contentful.objc/Tests/ComplexLinkSyncTests.m:114: error: -[ComplexLinkSyncTests testComplexLinkSyncWithoutSyncSpaceInstance] : ((1U) equal to (self.numberOfEntriesUpdated)) failed: ("1") is not equal to ("0") /Users/boris/Projects/contentful.objc/Tests/ComplexLinkSyncTests.m:115: error: -[ComplexLinkSyncTests testComplexLinkSyncWithoutSyncSpaceInstance] : ((1U) equal to (self.numberOfEntriesDeleted)) failed: ("1") is not equal to ("0") Test Case '-[ComplexLinkSyncTests testComplexLinkSyncWithoutSyncSpaceInstance]' failed (0.236 seconds). Test Case '-[ComplexLinkSyncTests afterAll]' started. Test Case '-[ComplexLinkSyncTests afterAll]' passed (0.006 seconds). Test Suite 'ComplexLinkSyncTests' failed at 2015-07-29 11:03:49.865. Executed 4 tests, with 6 failures (0 unexpected) in 0.267 (0.273) seconds Test Suite 'ComplexSyncTests' started at 2015-07-29 11:03:49.866 Test Case '-[ComplexSyncTests beforeAll]' started. Test Case '-[ComplexSyncTests beforeAll]' passed (0.003 seconds). Test Case '-[ComplexSyncTests testSyncWithLinks]' started. Test Case '-[ComplexSyncTests testSyncWithLinks]' passed (0.017 seconds). Test Case '-[ComplexSyncTests testSyncWithLinksWithoutSyncSpaceInstance]' started. Test Case '-[ComplexSyncTests testSyncWithLinksWithoutSyncSpaceInstance]' passed (0.021 seconds). Test Case '-[ComplexSyncTests afterAll]' started. Test Case '-[ComplexSyncTests afterAll]' passed (0.002 seconds). Test Suite 'ComplexSyncTests' passed at 2015-07-29 11:03:49.912. Executed 4 tests, with 0 failures (0 unexpected) in 0.043 (0.047) seconds Test Suite 'CoreDataBaseTestCase' started at 2015-07-29 11:03:49.913 Test Case '-[CoreDataBaseTestCase beforeAll]' started. Test Case '-[CoreDataBaseTestCase beforeAll]' passed (0.004 seconds). Test Case '-[CoreDataBaseTestCase afterAll]' started. Test Case '-[CoreDataBaseTestCase afterAll]' passed (0.002 seconds). Test Suite 'CoreDataBaseTestCase' passed at 2015-07-29 11:03:49.920. Executed 2 tests, with 0 failures (0 unexpected) in 0.006 (0.007) seconds Test Suite 'CoreDataBasicTests' started at 2015-07-29 11:03:49.921 Test Case '-[CoreDataBasicTests beforeAll]' started. Test Case '-[CoreDataBasicTests beforeAll]' passed (0.009 seconds). Test Case '-[CoreDataBasicTests testContinueSyncFromDataStore]' started. Test Case '-[CoreDataBasicTests testContinueSyncFromDataStore]' passed (0.205 seconds). Test Case '-[CoreDataBasicTests testContinueSyncWithSameManager]' started. 2015-07-29 11:03:50.156 UFO Example[18593:7124781] CoreData: error: (522) I/O error for database at /Users/boris/Library/Developer/CoreSimulator/Devices/960CE8E3-9D7C-47E9-851F-0C5468415494/data/Containers/Data/Application/427C54AF-BB57-469E-A25A-3B3546719D1B/Documents/CoreDataExample.sqlite. SQLite error code:522, 'not an error' 2015-07-29 11:04:03.914 UFO Example[18593:7124781] Core Data: error: -executeRequest: encountered exception = I/O error for database at /Users/boris/Library/Developer/CoreSimulator/Devices/960CE8E3-9D7C-47E9-851F-0C5468415494/data/Containers/Data/Application/427C54AF-BB57-469E-A25A-3B3546719D1B/Documents/CoreDataExample.sqlite. SQLite error code:522, 'not an error' with userInfo = { NSFilePath = "/Users/boris/Library/Developer/CoreSimulator/Devices/960CE8E3-9D7C-47E9-851F-0C5468415494/data/Containers/Data/Application/427C54AF-BB57-469E-A25A-3B3546719D1B/Documents/CoreDataExample.sqlite"; NSSQLiteErrorDomain = 522; } 2015-07-29 11:04:03.934 UFO Example[18593:7124781] CoreData: error: (522) I/O error for database at /Users/boris/Library/Developer/CoreSimulator/Devices/960CE8E3-9D7C-47E9-851F-0C5468415494/data/Containers/Data/Application/427C54AF-BB57-469E-A25A-3B3546719D1B/Documents/CoreDataExample.sqlite. SQLite error code:522, 'not an error' 2015-07-29 11:04:06.355 UFO Example[18593:7124781] Core Data: error: -executeRequest: encountered exception = I/O error for database at /Users/boris/Library/Developer/CoreSimulator/Devices/960CE8E3-9D7C-47E9-851F-0C5468415494/data/Containers/Data/Application/427C54AF-BB57-469E-A25A-3B3546719D1B/Documents/CoreDataExample.sqlite. SQLite error code:522, 'not an error' with userInfo = { NSFilePath = "/Users/boris/Library/Developer/CoreSimulator/Devices/960CE8E3-9D7C-47E9-851F-0C5468415494/data/Containers/Data/Application/427C54AF-BB57-469E-A25A-3B3546719D1B/Documents/CoreDataExample.sqlite"; NSSQLiteErrorDomain = 522; } 2015-07-29 11:04:06.382 UFO Example[18593:7124781] CoreData: error: (522) I/O error for database at /Users/boris/Library/Developer/CoreSimulator/Devices/960CE8E3-9D7C-47E9-851F-0C5468415494/data/Containers/Data/Application/427C54AF-BB57-469E-A25A-3B3546719D1B/Documents/CoreDataExample.sqlite. SQLite error code:522, 'not an error' 2015-07-29 11:04:07.728 UFO Example[18593:7124781] Core Data: error: -executeRequest: encountered exception = I/O error for database at /Users/boris/Library/Developer/CoreSimulator/Devices/960CE8E3-9D7C-47E9-851F-0C5468415494/data/Containers/Data/Application/427C54AF-BB57-469E-A25A-3B3546719D1B/Documents/CoreDataExample.sqlite. SQLite error code:522, 'not an error' with userInfo = { NSFilePath = "/Users/boris/Library/Developer/CoreSimulator/Devices/960CE8E3-9D7C-47E9-851F-0C5468415494/data/Containers/Data/Application/427C54AF-BB57-469E-A25A-3B3546719D1B/Documents/CoreDataExample.sqlite"; NSSQLiteErrorDomain = 522; } 2015-07-29 11:04:07.741 UFO Example[18593:7124781] CoreData: error: (522) I/O error for database at /Users/boris/Library/Developer/CoreSimulator/Devices/960CE8E3-9D7C-47E9-851F-0C5468415494/data/Containers/Data/Application/427C54AF-BB57-469E-A25A-3B3546719D1B/Documents/CoreDataExample.sqlite. SQLite error code:522, 'not an error' (lldb)


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!