Start a new topic

NSInternalInconsistencyException Crash in Kinvey library, cannot determine what's causing it.

For some reason certain test accounts are causing our app to crash on iOS (and not Android). It's not clear from the call stack exactly what query or object creation is causing the issue. There is an exception being raised but it's happened in an internal library so we can't see whats happening:


*** Assertion failure in -[KCS_SBJsonStreamParserAdapter parser:found:], /Users/mike/work/ios-library/tags/1.27.1/KinveyKit/KinveyKit/3rdParty/SBJson/KCS_SBJsonStreamParserAdapter.m:83

2014-09-04 14:33:21.435 Moti-Mate[62123:3503] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: obj'

*** First throw call stack:


0 CoreFoundation 0x0000000103277495 __exceptionPreprocess + 165

1 libobjc.A.dylib 0x0000000102d7799e objc_exception_throw + 43

2 CoreFoundation 0x000000010327731a +[NSException raise:format:arguments:] + 106

3 Foundation 0x0000000100888f19 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 189

4 Moti-Mate 0x0000000100128017 -[KCS_SBJsonStreamParserAdapter parser:found:] + 199

5 Moti-Mate 0x00000001001286b2 -[KCS_SBJsonStreamParserAdapter parser:foundDate:] + 50

6 Moti-Mate 0x00000001001274ce -[KCS_SBJsonStreamParser parse:] + 910

7 Moti-Mate 0x000000010011a813 -[KCS_SBJsonParser objectWithData:] + 243

8 Moti-Mate 0x00000001000c1884 -[KCSNetworkResponse jsonResponseValue:] + 228

9 Moti-Mate 0x00000001000c1bfc -[KCSNetworkResponse jsonObject] + 156

10 Moti-Mate 0x000000010010bb2b -[KCSBackgroundAppdataStore handleLoadResponse:error:completionBlock:] + 123

11 Moti-Mate 0x000000010010ddd7 __84-[KCSBackgroundAppdataStore doQueryWithQuery:withCompletionBlock:withProgressBlock:]_block_invoke + 55

12 Moti-Mate 0x00000001000fc51d -[KCSRequest2 callCallback:request:] + 1981

13 Moti-Mate 0x00000001000fb717 -[KCSRequest2 requestCallback:request:] + 1111

14 Moti-Mate 0x00000001000fb23e __20-[KCSRequest2 start]_block_invoke_3 + 46

15 Foundation 0x0000000100963063 __103+[__NSOperationInternal _observeValueForKeyPath:ofObject:changeKind:oldValue:newValue:indexes:context:]_block_invoke96 + 16

16 libdispatch.dylib 0x00000001043ee851 _dispatch_call_block_and_release + 12

17 libdispatch.dylib 0x000000010440172d _dispatch_client_callout + 8

18 libdispatch.dylib 0x00000001043f1b27 _dispatch_root_queue_drain + 380

19 libdispatch.dylib 0x00000001043f1d12 _dispatch_worker_thread2 + 40

20 libsystem_pthread.dylib 0x000000010474eef8 _pthread_wqthread + 314

21 libsystem_pthread.dylib 0x0000000104751fb9 start_wqthread + 13


libc++abi.dylib: terminating with uncaught exception of type NSException


We tried disabling all business logic but it had no effect. Some accounts cause the issue and some don't and it's not clear at what point they are returning invalid data. Regardless I would expect the library to return an error rather than raising an exception. It seems like it would be simple to debug if we were able to see the source code.

Is there anything we could possibly do, or would likely cause this kind of exception? We are using the latest version of the library 1.27.1



(Edited to include code formatting)

sorry for the delay in getting back to you. This looks like an issue with json parser, when it is attempting to parse an ISO date. It looks like a date object is containing an empty string, as opposed to the actual date.

Can you check for any value that looks like `ISODate(“")` or `ISODate()`? That would cause this issue.
Login or Signup to post a comment