[OpenSIPS-Users] OpenSIPs 2.3.3 - cachedb_mongodb - problems with connecting to secure Mongo with the latest mongoc driver

Liviu Chircu liviu at opensips.org
Wed Jun 13 11:00:18 EDT 2018


Update: issue found and fixed on master branch [1], as well as 2.4 and 2.3.

[1]: https://github.com/OpenSIPS/opensips/commit/e4f98a6d4c830ee1f

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 13.06.2018 17:18, Liviu Chircu wrote:
> Hi, Vladimir!
>
> Definitely looks like a code issue, and shouldn't be too hard to fix.  
> Thanks for the report! I should be able to look into it during these 
> days.
>
> Best regards,
>
> Liviu Chircu
> OpenSIPS Developer
> http://www.opensips-solutions.com
>
> On 09.06.2018 02:49, vladimirk wrote:
>> Hello,
>>
>> I am trying to use db_cachedb in conjunction with cachedb_mongodb.
>> Everything was working fine until we switched to the secured Mongo 
>> DB. Now
>> we switched to use secure mongo instance.
>>
>> When we use a connection string like below
>>
>> Config:
>> loadmodule "cachedb_mongodb.so"
>> modparam("cachedb_mongodb", "compat_mode_3.0", 1)
>> loadmodule "db_cachedb.so"
>> modparam("cachedb_mongodb|db_cachedb", "cachedb_url",
>> "mongodb:global://myUser:SuperSecret@mongocluster:27017/opensips.col")
>> modparam("db_cachedb", "cachedb_url",
>> "mongodb:instance1://myUser:SuperSecret at mongolocal:27017/opensips.col")
>>
>>   server fails with the following error:
>>
>> Log:
>> Jun  8 19:39:02 [30738] DBG:db_cachedb:db_cachedb_bind_api: BINDING 
>> API for
>> : cachedb://mongodb:instance1
>> Jun  8 19:39:02 [30738] DBG:db_cachedb:db_cachedb_init: Found 
>> matching URL :
>> [mongodb:instance1://myUser:SuperSecret at mongolocal:27017/opensips.col]
>> Jun  8 19:39:02 [30738] DBG:core:cachedb_bind_mod: Binded to mod mongodb
>> Jun  8 19:39:02 [30738] DBG:core:parse_cachedb_url: parsing
>> [mongodb:instance1://myUser:SuperSecret at mongolocal:27017/opensips.col]
>> Jun  8 19:39:02 [30738] DBG:core:parse_cachedb_url: in host - :
>> Jun  8 19:39:02 [30738] DBG:core:cachedb_do_init: opening new connection
>> Jun  8 19:39:02 [30738] DBG:cachedb_mongodb:mongo_new_connection: 
>> MongoDB
>> conn for [opensips-30738]: mongodb:instance1 myUser:SuperSecret
>> |mongolocal|:27017
>> Jun  8 19:39:02 [30738] DBG:cachedb_mongodb:mongo_new_connection: cstr:
>> mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col
>> 2018/06/08 19:39:02.0865: [30738]:  WARNING:       mongoc: Error parsing
>> URI: 'Invalid database name in URI'
>> Jun  8 19:39:02 [30738] ERROR:cachedb_mongodb:mongo_new_connection: 
>> failed
>> to connect to Mongo
>> (mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col)
>> Jun  8 19:39:02 [30738] ERROR:core:cachedb_do_init: failed to open
>> connection
>> Jun  8 19:39:02 [30738] ERROR:db_cachedb:db_cachedb_init: Failed to 
>> connect
>> to the cachedb back-end
>>
>>
>> I have also noticed, that when we have user/password in the URL,
>> mongo_new_connection receives connection string with the collection 
>> name at
>> the end
>>
>> Jun  8 19:39:02 [30738] DBG:cachedb_mongodb:mongo_new_connection: cstr:
>> mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col
>>
>> This is not happening if I use connection string with authentication.
>>
>> Can you help to resolve this issue? Can this be resolved with the
>> configuration only or this looks more like a code issue?
>>
>> Thanks,
>> Vladimir
>>
>>
>>
>>
>>
>> -- 
>> Sent from: 
>> http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20180613/dd789c07/attachment.html>


More information about the Users mailing list