I also figured the code checks out, so i'm not sure where to look, there is no error, just that queries return nothing
If I point the mongo URI just to the primary node, I get this
Nov 16 17:59:45 SG1-SIP /usr/local/sbin/kamailio[16451]: DEBUG: db_mongodb [mongodb_connection.c:55]: db_mongodb_new_connection(): connection open to: mongodb://
10.0.1.2/siptraceNov 16 17:59:45 SG1-SIP /usr/local/sbin/kamailio[16451]: DEBUG: db_mongodb [mongodb_dbase.c:851]: db_mongodb_query(): query to collection [version]
Nov 16 17:59:45 SG1-SIP /usr/local/sbin/kamailio[16451]: DEBUG: db_mongodb [mongodb_dbase.c:885]: db_mongodb_query(): query filter: { "table_name" : "sip_trace" }
Nov 16 17:59:45 SG1-SIP /usr/local/sbin/kamailio[16451]: DEBUG: db_mongodb [mongodb_dbase.c:904]: db_mongodb_query(): columns filter: { "table_version" : 1 }
Nov 16 17:59:45 SG1-SIP /usr/local/sbin/kamailio[16451]: DEBUG: db_mongodb [mongodb_dbase.c:349]: db_mongodb_get_columns(): 1 columns returned from the query
Nov 16 17:59:45 SG1-SIP /usr/local/sbin/kamailio[16451]: DEBUG: db_mongodb [mongodb_dbase.c:377]: db_mongodb_get_columns(): Found a field[0] named: table_version
Nov 16 17:59:45 SG1-SIP /usr/local/sbin/kamailio[16451]: DEBUG: db_mongodb [mongodb_dbase.c:396]: db_mongodb_get_columns(): allocate 16 bytes for RES_NAMES[0] at 0x7f521bfb3ca8
Nov 16 17:59:45 SG1-SIP /usr/local/sbin/kamailio[16451]: DEBUG: db_mongodb [mongodb_dbase.c:406]: db_mongodb_get_columns(): use DB1_INT result type
Nov 16 17:59:45 SG1-SIP /usr/local/sbin/kamailio[16451]: DEBUG: db_mongodb [mongodb_dbase.c:460]: db_mongodb_get_columns(): RES_NAMES(0x7f521bfb3ca8)[0]=[table_version] (16)
Nov 16 17:59:45 SG1-SIP /usr/local/sbin/kamailio[16451]: DEBUG: db_mongodb [mongodb_dbase.c:671]: db_mongodb_convert_result(): selected document: { "_id" : { "$oid" : "5642dec7775a1afd9ecc394e" }, "table_version" : 4 }
if i include a replicaset, this happens:
Nov 16 17:56:47 SG1-SIP /usr/local/sbin/kamailio[16131]: DEBUG: db_mongodb [mongodb_dbase.c:851]: db_mongodb_query(): query to collection [version]
Nov 16 17:56:47 SG1-SIP /usr/local/sbin/kamailio[16131]: DEBUG: db_mongodb [mongodb_dbase.c:885]: db_mongodb_query(): query filter: { "table_name" : "sip_trace" }
Nov 16 17:56:47 SG1-SIP /usr/local/sbin/kamailio[16131]: DEBUG: db_mongodb [mongodb_dbase.c:904]: db_mongodb_query(): columns filter: { "table_version" : 1 }
Nov 16 17:56:47 SG1-SIP /usr/local/sbin/kamailio[16125]: DEBUG: db_mongodb [mongodb_dbase.c:733]: db_mongodb_store_result(): no result from mongodb
Nov 16 17:56:47 SG1-SIP /usr/local/sbin/kamailio[16126]: DEBUG: db_mongodb [mongodb_dbase.c:733]: db_mongodb_store_result(): no result from mongodb
Nov 16 17:56:47 SG1-SIP /usr/local/sbin/kamailio[16154]: DEBUG: <core> [sr_module.c:897]: init_mod_child(): rank -2: ndb_mongodb
Nov 16 17:56:47 SG1-SIP /usr/local/sbin/kamailio[16128]: DEBUG: db_mongodb [mongodb_dbase.c:733]: db_mongodb_store_result(): no result from mongodb
Nov 16 17:56:47 SG1-SIP /usr/local/sbin/kamailio[16130]: DEBUG: db_mongodb [mongodb_dbase.c:733]: db_mongodb_store_result(): no result from mongodb
Nov 16 17:56:47 SG1-SIP /usr/local/sbin/kamailio[16131]: DEBUG: db_mongodb [mongodb_dbase.c:733]: db_mongodb_store_result(): no result from mongodb