<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><tt>Update: issue found and fixed on master branch [1], as well
as 2.4 and 2.3.<br>
</tt></p>
<p><tt>[1]: </tt><tt><a class="moz-txt-link-freetext"
href="https://github.com/OpenSIPS/opensips/commit/e4f98a6d4c830ee1f3d9b5ac5299146b005953e5">https://github.com/OpenSIPS/opensips/commit/e4f98a6d4c830ee1f</a></tt></p>
<pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 13.06.2018 17:18, Liviu Chircu
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:c94b65c4-f08c-ba71-730f-f0253338c2ab@opensips.org">Hi,
Vladimir!
<br>
<br>
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.
<br>
<br>
Best regards,
<br>
<br>
Liviu Chircu
<br>
OpenSIPS Developer
<br>
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a>
<br>
<br>
On 09.06.2018 02:49, vladimirk wrote:
<br>
<blockquote type="cite">Hello,
<br>
<br>
I am trying to use db_cachedb in conjunction with
cachedb_mongodb.
<br>
Everything was working fine until we switched to the secured
Mongo DB. Now
<br>
we switched to use secure mongo instance.
<br>
<br>
When we use a connection string like below
<br>
<br>
Config:
<br>
loadmodule "cachedb_mongodb.so"
<br>
modparam("cachedb_mongodb", "compat_mode_3.0", 1)
<br>
loadmodule "db_cachedb.so"
<br>
modparam("cachedb_mongodb|db_cachedb", "cachedb_url",
<br>
<a class="moz-txt-link-rfc2396E" href="mailto:mongodb:global://myUser:SuperSecret@mongocluster:27017/opensips.col">"mongodb:global://myUser:SuperSecret@mongocluster:27017/opensips.col"</a>)
<br>
modparam("db_cachedb", "cachedb_url",
<br>
<a class="moz-txt-link-rfc2396E" href="mailto:mongodb:instance1://myUser:SuperSecret@mongolocal:27017/opensips.col">"mongodb:instance1://myUser:SuperSecret@mongolocal:27017/opensips.col"</a>)
<br>
<br>
server fails with the following error:
<br>
<br>
Log:
<br>
Jun 8 19:39:02 [30738] DBG:db_cachedb:db_cachedb_bind_api:
BINDING API for
<br>
: cachedb://mongodb:instance1
<br>
Jun 8 19:39:02 [30738] DBG:db_cachedb:db_cachedb_init: Found
matching URL :
<br>
[<a class="moz-txt-link-abbreviated" href="mailto:mongodb:instance1://myUser:SuperSecret@mongolocal:27017/opensips.col">mongodb:instance1://myUser:SuperSecret@mongolocal:27017/opensips.col</a>]
<br>
Jun 8 19:39:02 [30738] DBG:core:cachedb_bind_mod: Binded to mod
mongodb
<br>
Jun 8 19:39:02 [30738] DBG:core:parse_cachedb_url: parsing
<br>
[<a class="moz-txt-link-abbreviated" href="mailto:mongodb:instance1://myUser:SuperSecret@mongolocal:27017/opensips.col">mongodb:instance1://myUser:SuperSecret@mongolocal:27017/opensips.col</a>]
<br>
Jun 8 19:39:02 [30738] DBG:core:parse_cachedb_url: in host - :
<br>
Jun 8 19:39:02 [30738] DBG:core:cachedb_do_init: opening new
connection
<br>
Jun 8 19:39:02 [30738]
DBG:cachedb_mongodb:mongo_new_connection: MongoDB
<br>
conn for [opensips-30738]: mongodb:instance1 myUser:SuperSecret
<br>
|mongolocal|:27017
<br>
Jun 8 19:39:02 [30738]
DBG:cachedb_mongodb:mongo_new_connection: cstr:
<br>
<a class="moz-txt-link-abbreviated" href="mailto:mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col">mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col</a>
<br>
2018/06/08 19:39:02.0865: [30738]: WARNING: mongoc: Error
parsing
<br>
URI: 'Invalid database name in URI'
<br>
Jun 8 19:39:02 [30738]
ERROR:cachedb_mongodb:mongo_new_connection: failed
<br>
to connect to Mongo
<br>
(<a class="moz-txt-link-abbreviated" href="mailto:mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col">mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col</a>)
<br>
Jun 8 19:39:02 [30738] ERROR:core:cachedb_do_init: failed to
open
<br>
connection
<br>
Jun 8 19:39:02 [30738] ERROR:db_cachedb:db_cachedb_init: Failed
to connect
<br>
to the cachedb back-end
<br>
<br>
<br>
I have also noticed, that when we have user/password in the URL,
<br>
mongo_new_connection receives connection string with the
collection name at
<br>
the end
<br>
<br>
Jun 8 19:39:02 [30738]
DBG:cachedb_mongodb:mongo_new_connection: cstr:
<br>
<a class="moz-txt-link-abbreviated" href="mailto:mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col">mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col</a>
<br>
<br>
This is not happening if I use connection string with
authentication.
<br>
<br>
Can you help to resolve this issue? Can this be resolved with
the
<br>
configuration only or this looks more like a code issue?
<br>
<br>
Thanks,
<br>
Vladimir
<br>
<br>
<br>
<br>
<br>
<br>
--
<br>
Sent from:
<a class="moz-txt-link-freetext" href="http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html">http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html</a><br>
<br>
_______________________________________________
<br>
Users mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
<br>
</blockquote>
<br>
<br>
_______________________________________________
<br>
Users mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
<br>
</blockquote>
<br>
</body>
</html>