Hi Daniel, It worked with different names like "versions".Please put it in your issue list for future release. Thank you. Regards,Hossein -- On Tuesday, February 9, 2021, 12:34:06 AM PST, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
hmm, that's interesting, used to be no problem with name "version", afaik, might be something specific to newer versions of mongodb. I think there is a function to retrieve the collection by name, but that requires changes in the c code, not sure when I will get time for it, maybe others can also take a look.
Meanwhile, the solution is to use a different name for the version table, you can set it via the core parameter:
- https://www.kamailio.org/wiki/cookbooks/5.4.x/core#version_table
Cheers, Daniel
On 09.02.21 09:17, H Yavari wrote:
Hi Daniel, I investigated a little and find something: db.version.find() doesn't run. It seems Mongo has a problem with the name of "version" and it says: 2021-02-09T00:16:57.333-0800 E QUERY [js] TypeError: db.version.find is not a function :
I am using: The server version: 4.2.12 Mongo-C version: 1.17.4 Do you have any idea? is there any hint about versions?
BR, Hossein
-- On Monday, February 8, 2021, 11:32:57 PM PST, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
maybe the version collection was not created properly -- have you read the guidelines from next link?
* https://www.kamailio.org/wiki/tutorials/kamailio-and-mongodb
Cheers, Daniel
On 09.02.21 08:00, H Yavari wrote:
Dear Daniel, Thanks for reply. Obviously, there is a problem in my collection, is there any how-to for it? kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:973]: db_mongodb_query(): query to collection [version] kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:1007]: db_mongodb_query(): query filter: { "table_name" : "address" } kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:1043]: db_mongodb_query(): columns filter: { "projection" : { "table_version" : 1 } } kamailio[1206]: 0(1208) DEBUG: <core> [db_res.c:119]: db_new_result(): allocate 56 bytes for result set at 0x7ff37023bce0 kamailio[1206]: 0(1208) DEBUG: db_mongodb [mongodb_dbase.c:851]: db_mongodb_store_result(): no result from mongodb kamailio[1206]: 0(1208) DEBUG: <core> [db.c:407]: db_table_version(): no row for table address found kamailio[1206]: 0(1208) ERROR: <core> [db.c:466]: db_check_table_version(): invalid version 0 for table address found, expected 6 (check table structure and table "version") What I miss? Regards, Hossein
On Monday, February 8, 2021, 10:12:51 AM PST, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
jumping in to add another hint: run kamailio with debug=3 in kamailio.cfg and look at the syslog file, iirc, the db_mongodb should print many details when doing queries and then you may get a clue of what happens. If not, send over here all the log messages printed by kamailio in such case and we can take a look.
Cheers, Daniel
On 08.02.21 11:56, Henning Westerholt wrote:
Hello,
can you see on the mongoDB level (e.g. with query debugging) what query is actually done on the server? This might help to debug the problem.
Cheers,
Henning