Document corruption?

68 views
Skip to first unread message

Christoph Berlin

unread,
Jan 8, 2015, 1:48:28 AM1/8/15
to mobile-c...@googlegroups.com

Hi,


We are currently trying to replicate the chat functionality from the sample project and it works. Everything seems to in order  however we now experienced an issue three times in random order that the app crashed due with the following exception:


*** ASSERTION FAILED: Cannot index view chatMessages: no map block registered

 


 

2015-01-07 22:00:49.229 OnePlan[69028:1294393] *** Assertion failure in __51-[CBLDatabase(ViewIndexing) updateIndexes:forView:]_block_invoke(), /Users/jenkins/jenkins/workspace/build_cblite_ios_1031-community/couchbase-lite-ios/Source/CBLView+Internal.m:280


 

22:00:49.237 WARNING: Exception caught in CBLDatabase transaction:


 

       
Assertion failed: Cannot index view chatMessages: no map block registered


 

       
5   OnePlan                             0x000000010db2756a __51-[CBLDatabase(ViewIndexing) updateIndexes:forView:]_block_invoke + 6895


 

       
6   OnePlan                             0x000000010db1d518 -[CBLDatabase(Internal) _inTransaction:] + 113


 

       
7   OnePlan                             0x000000010db25936 -[CBLDatabase(ViewIndexing) updateIndexes:forView:] + 170


 

       
8   OnePlan                             0x000000010db257d5 -[CBLView(Internal) updateIndex] + 85


 

       
9   OnePlan                             0x000000010db5a96d -[CBLDatabase(Views) queryViewNamed:options:lastSequence:status:] + 170


 

       
10  OnePlan                             0x000000010db581e9 __21-[CBLQuery runAsync:]_block_invoke + 59


 

       
11  OnePlan                             0x000000010db2be9f __35-[CBL_Server tellDatabaseNamed:to:]_block_invoke + 69


 

       
12  Foundation                          0x000000010f952212 __NSThreadPerformPerform + 299


 

       
13  CoreFoundation                      0x0000000111fb6551 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17


 

       
14  CoreFoundation                      0x0000000111fac41d __CFRunLoopDoSources0 + 269


 

       
15  CoreFoundation                      0x0000000111faba54 __CFRunLoopRun + 868


 

       
16  CoreFoundation                      0x0000000111fab486 CFRunLoopRunSpecific + 470


 

       
17  Foundation                          0x000000010f956b42 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 275


 

       
18  OnePlan                             0x000000010db2bc64 -[CBL_Server runServerThread] + 312


 

       
19  Foundation                          0x000000010f954c4d __NSThread__main__ + 1194


 

       
...


 






 

2015-01-07 21:50:29.613 OnePlan[67472:1268220] *** Assertion failure in +[OPChatMessage modelForDocument:], /Users/jenkins/jenkins/workspace/build_cblite_ios_1031-community/couchbase-lite-ios/Source/API/CBLModel.m:64


 

2015-01-07 21:50:29.620 OnePlan[67472:1268220] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: document'


 

*** First throw call stack:


 

(


 

       
0   CoreFoundation                      0x0000000104f65f35 __exceptionPreprocess + 165


 

       
1   libobjc.A.dylib                     0x0000000104bcfbb7 objc_exception_throw + 45


 

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


 

       
3   Foundation                          0x000000010289b5df -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195


 

       
4   OnePlan                             0x0000000100a45fa1 +[CBLModel modelForDocument:] + 169


 

       
5   OnePlan                             0x00000001005fee61 +[OPChatMessage messageWithChatRoomId:withText:] + 337


 

       
6   OnePlan                             0x0000000100605e14 -[OPDetailChatViewController didPressSendButton:withMessageText:senderId:senderDisplayName:date:] + 260


 

       
7   OnePlan                             0x000000010091a7ac -[JSQMessagesViewController messagesInputToolbar:didPressRightBarButton:] + 284


 

       
8   OnePlan                             0x000000010090a8fd -[JSQMessagesInputToolbar jsq_rightBarButtonPressed:] + 93


 

       
9   UIKit                               0x00000001031c88be -[UIApplication sendAction:to:from:forEvent:] + 75


 

       
10  UIKit                               0x00000001032cf410 -[UIControl _sendActionsForEvents:withEvent:] + 467


 

       
11  UIKit                               0x00000001032ce7df -[UIControl touchesEnded:withEvent:] + 522


 

       
12  UIKit                               0x000000010320e308 -[UIWindow _sendTouchesForEvent:] + 735


 

       
13  UIKit                               0x000000010320ec33 -[UIWindow sendEvent:] + 683


 

       
14  UIKit                               0x00000001031db9b1 -[UIApplication sendEvent:] + 246


 

       
15  UIKit                               0x00000001031e8a7d _UIApplicationHandleEventFromQueueEvent + 17370


 

       
16  UIKit                               0x00000001031c4103 _UIApplicationHandleEventQueue + 1961


 

       
17  CoreFoundation                      0x0000000104e9b551 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17


 

       
18  CoreFoundation                      0x0000000104e9141d __CFRunLoopDoSources0 + 269


 

       
19  CoreFoundation                      0x0000000104e90a54 __CFRunLoopRun + 868


 

       
20  CoreFoundation                      0x0000000104e90486 CFRunLoopRunSpecific + 470


 

       
21  GraphicsServices                    0x0000000106caa9f0 GSEventRunModal + 161


 

       
22  UIKit                               0x00000001031c7420 UIApplicationMain + 1282


 

       
23  OnePlan                             0x0000000100608013 main + 115


 

       
24  libdyld.dylib                       0x000000010574b145 start + 1


 

       
25  ???                                 0x0000000000000001 0x0 + 1


 

)


 

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


 

(lldb)


 




Jens Alfke

unread,
Jan 8, 2015, 2:39:58 AM1/8/15
to mobile-c...@googlegroups.com
That exception means exactly what it says. It has nothing to do with doc corruption. Did you register a map block for that view at app startup?

--Jens

Christoph Berlin

unread,
Jan 8, 2015, 2:42:45 AM1/8/15
to mobile-c...@googlegroups.com
Yes we do and like I said it worked flawlessly during 15 QA cycles with thousands of messages sent. On three occasions this happened.

Jens Alfke

unread,
Jan 8, 2015, 12:39:47 PM1/8/15
to mobile-c...@googlegroups.com

> On Jan 7, 2015, at 11:42 PM, Christoph Berlin <hoptoawe...@gmail.com> wrote:
>
> Yes we do and like I said it worked flawlessly during 15 QA cycles with thousands of messages sent. On three occasions this happened.

You must have said that in an earlier thread? It's hard for me to keep track of everyone's name on this forum and what projects they're working on, so it's better if you put context like that at the beginning of each thread where it's relevant.

Looking at the logs again, those are two very different exceptions.

The first one means that you haven't registered a map block for that view yet. Since the exception is occurring on a background thread (the one that's doing the async view query for you) I suspect this is a race condition. You may be triggering an async view query, either directly or via a LiveQuery, shortly before registering your map block, and it just happens to work most of the time because of the delay before the background thread gets around to querying.

The second exception is because you passed a nil document to +[CBLModel modelForDocument:]. Since I don't have the source of your method +[OPChatMessage messageWithChatRoomId:withText:] that did this, I don't know what the problem might be. You'll need to inspect your code, or set a breakpoint on exceptions and reproduce the problem.

—Jens
Reply all
Reply to author
Forward
0 new messages