Hi Traun, Its really easy to reproduce once you understand the issue: you call the manager, create a database object but you don't connect the two...
CBLManager* dbManager = [CBLManager sharedInstance]; CBLDatabase* database; Its a really stupid mistake, especially because we should check whether the database actually got created but the error message also threw us off. We were digging around in the model completing missing the fact that there is no database - well there was a database object but unassigned. Thanks From: Traun leyden <[email protected]<mailto:[email protected]>> Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Date: Monday, November 10, 2014 at 7:04 AM To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Subject: Re: Assertion failure in CBLModel.m:461 Thanks for reporting. Can you provide a code sample of triggering the issue? I'm just wondering if its possible to add a sanity check to CBLModel to detect this and make debugging easier. On Nov 9, 2014, at 2:15 PM, Christoph Berlin <[email protected]<mailto:[email protected]>> wrote: Ok it seems like we found the root cause (finally). It turns out that something we initialized the wrong database in CBLManager for whatever reason. We don't know why but it happened - however its important to understand that the database was initialized. I still don't understand why this error message would occur but fixing this other more potentially lethal problem fixed this issue as well. So I guess I answered my own problem but in case anyone ever runs into this issue, have a look at your database object. On Sunday, November 9, 2014 10:25:09 AM UTC-8, Christoph Berlin wrote: Hi, we are kind of stuck on a problem we cannot explain. Sometimes (not always) we get the following error: *** Assertion failure in -[OPUserProfile setValue:ofProperty:], /Users/jenkins/jenkins/workspace/build_cblite_ios_102-enterprise/couchbase-lite-ios/Source/API/CBLModel.m:461 Our problem is that the issue occurs randomly - it works about 50% of the time (same functions) while other times it fails. Debugging the issue leads to nowhere. Does anyone have an idea of what could be the cause? The OPProfilefunction does nothing fancy but we know that it fails at self.user_id = user_id; - (instancetype) initCurrentUserProfileInDatabase: (CBLDatabase*)db andUserID:(NSString*)user_id; { NSParameterAssert(user_id); CBLDocument *doc = [db documentWithID:[@"profile:"stringByAppendingString:user_id]]; self = [superinitWithDocument:doc]; if (self) { self.user_id = user_id; self.type = kOPDocType_UserProfile; self.created_at = [NSDatedate]; } return self; } -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]<mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/f51a51f6-c352-4da6-a376-17b50e35fb9e%40googlegroups.com<https://groups.google.com/d/msgid/mobile-couchbase/f51a51f6-c352-4da6-a376-17b50e35fb9e%40googlegroups.com?utm_medium=email&utm_source=footer>. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/xvJOvcRtQnI/unsubscribe. To unsubscribe from this group and all its topics, send an email to [email protected]<mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/CC2E1449-8D75-4AAE-8E24-1FCBAB8DB985%40gmail.com<https://groups.google.com/d/msgid/mobile-couchbase/CC2E1449-8D75-4AAE-8E24-1FCBAB8DB985%40gmail.com?utm_medium=email&utm_source=footer>. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/D08634F7.18C11%25cberlin%40christophberlin.com. For more options, visit https://groups.google.com/d/optout.
