Understanding CBL error messages


#1

Does there exist a resource that explains the meaning of error messages encountered in Couchbase Lite for iOS? For example, an error message I would like to understand is ‘-[TtGCSs22_NativeSetStorageOwnerSS cbjson_encodeTo:canonical:]: unrecognized selector sent to instance 0x7fdc28e8dde0’. The error message is not helpful to me. Where can I get more insight for general cbl errors?


#2

I have the same question. I am using the sample code from :
https://developer.couchbase.com/documentation/mobile/1.4/training/develop/using-the-database/index.html

specifically, this block of code:

let docId = username + “.” + NSUUID().uuidString
guard let doc = database.document(withID: docId) else {
Ui.showMessageDialog(onController: self, withTitle: “Error”,
withMessage: “Couldn’t save task list”)
return nil
}

do {
return try doc.putProperties(properties)
} catch let error as NSError {
Ui.showMessageDialog(onController: self, withTitle: “Error”,
withMessage: “Couldn’t save task list”, withError: error)
return nil
}

execution enters the do block fine, but this line of code:

try doc.putProperties(properties)

gives me the following error (and enters catch block):

[AppName.Message cbjson_encodeTo:canonical:]: unrecognized selector sent to instance 0x17038a280
2018-04-29 18:41:02.700855-0700 AppName[330:47745] Exception caught in CBLDatabase transaction:
-[AppName.Message cbjson_encodeTo:canonical:]: unrecognized selector sent to instance 0x17038a280
0 CoreFoundation 0x0000000188e9eff8 + 148
2 CoreFoundation 0x0000000188ea5ef4 + 0
3 CoreFoundation 0x0000000188ea2f54 + 916
4 CoreFoundation 0x0000000188d9ed4c _CF_forwarding_prep_0 + 92
5 AppName 0x00000001000e6740 -[NSArray(CBJSONEncoder) cbjson_encodeTo:canonical:] + 200
6 AppName 0x00000001000e6c0c -[NSDictionary(CBJSONEncoder) cbjson_encodeTo:canonical:keyFilter:error:] + 480
7 AppName 0x00000001000e6054 -[CBJSONEncoder encode:] + 140
8 AppName 0x0000000100069998 +[CBL_Revision asCanonicalJSON:error:] + 140
9 AppName 0x000000010011dd98 __103-[CBL_SQLiteStorage addDocID:prevRevID:properties:deleting:allowConflict:validationBlock:status:error:]_block_invoke + 1268
10 AppName 0x0000000100117ac0 -[CBL_SQLiteStorage inTransaction:] + 348
11 AppName 0x0000000100117bd0 -[CBL_SQLiteStorage inOuterTransaction:] + 88
12 AppName 0x000000010011d71c -[CBL_SQLiteStorage addDocID:prevRevID:properties:deleting:allowConflict:validationBlock:status:error:] + 372
13 AppName 0x00000001000dffbc -[CBLDatabase(Insertion) putDocID:properties:prevRevisionID:allowConflict:source:status:error:] + 1088
14 AppName 0x00000001000a2e2c -[CBLDocument putProperties:prevRevID:allowConflict:error:] + 180
15 AppName 0x00000001000a2f0c -[CBLDocument putProperties:error:] + 108

2018-04-29 18:41:02.708132-0700 AppName[330:47745] Error: Couldn’t save task list in proche 04/29/2018 (error=Error Domain=CBLHTTP Code=500 “Internal error” UserInfo={NSLocalizedFailureReason=Internal error, NSLocalizedDescription=Internal error})

the line in my pod file related to CBL is following:
pod ‘couchbase-lite-ios’, ‘~> 1.4.1’

Could someone shed some light on this? Thanks !


#3

It seems like CBL is unable to encode the JSON that’s sent down. What is the properties dictionary that you are sending down.