*** 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 = [super initWithDocument:doc];
if (self)
{
self.user_id = user_id;
self.type = kOPDocType_UserProfile;
self.created_at = [NSDate date];
}
return self;
}
2014-11-09 11:04:25.471 OnePlan[10513:214282] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: _document'
*** First throw call stack:
(
0 CoreFoundation 0x0000000110e99f35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001106f7bb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000110e99d9a +[NSException raise:format:arguments:] + 106
3 Foundation 0x000000010dc2a5df -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 OnePlan 0x000000010cc54b70 -[CBLModel setValue:ofProperty:] + 199
5 OnePlan 0x000000010cc65ed8 __50+[MYDynamicObject impForSetterOfProperty:ofClass:]_block_invoke + 43
--
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 mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/f51a51f6-c352-4da6-a376-17b50e35fb9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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
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 mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/f51a51f6-c352-4da6-a376-17b50e35fb9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
CBLDocument *doc = [db documentWithID:[@"profile:" stringByAppendingString:user_id]];
Failure with database is nil:
2014-11-10 14:11:43.322 OnePlan[30062:712261] *** Assertion failure in -[OPUserProfile setValue:ofProperty:], /Users/jenkins/jenkins/workspace/build_cblite_ios_102-enterprise/couchbase-lite-ios/Source/API/CBLModel.m:461
--
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 mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/7DD8FD98-6889-4E66-8A35-DADC55E9FC23%40couchbase.com.