Hi,
using kamailio 5.3, I have added two connections to the cluster:
```
modparam("db_cluster", "connection", DB_URL_REDIS_READ)
modparam("db_cluster", "connection", DB_URL_REDIS_WRITE)
modparam("ims_charging", "db_url", "cluster://cluster1")
```
it fails to start, here with additional debug prints
```
2020-06-30T20:51:10.003728531Z 0(128) DEBUG: db_cluster [dbcl_api.c:267]: db_cluster_init(): initializing with cluster [cluster://k1] len 46
2020-06-30T20:51:10.003751277Z 0(128) DEBUG: db_cluster [dbcl_api.c:277]: db_cluster_init(): call dbcl_get_cluster with trimmed name of cluster [k1] len 36
2020-06-30T20:51:10.003772897Z 0(128) DEBUG: db_cluster [dbcl_data.c:67]: dbcl_get_cluster(): inside dbcl_get_cluster looking up new cluster [k1] len 36
2020-06-30T20:51:10.003801798Z 0(128) DEBUG: db_cluster [dbcl_data.c:75]: dbcl_get_cluster(): checking new 2749854490 cluster with name [k1] len 36
2020-06-30T20:51:10.003825383Z 0(128) DEBUG: db_cluster [dbcl_data.c:76]: dbcl_get_cluster(): checking 26214 cluster with name [k1] len 2
2020-06-30T20:51:10.003844796Z 0(128) ERROR: db_cluster [dbcl_api.c:281]: db_cluster_init(): cluster not found [cluster://k1]
```
so i see different hash id and the length mismatch, where it seems that db_cluster_init already gets wrong dburl strict structure from DB API,
because the _dburl.s is pointing to the db_url but the length is calculated from the 2nd connection URL so 36 = strlen ("c2=>mysql://scscf:heslo@mysql/scscf2")
I couldn't get it work also with only 1 connection. I could only tell there is something wrong with the way db_do_init2 / new_db_id from srdb1 interacts with db_cluster_init
and then I found this commit [https://github.com/kamailio/kamailio/commit/5457bcbc51012e93775c3aaefa32c73…
What I am getting at is:
is it possible that commit in srdb1 with id 5457bcbc51012e93775c3aaefa32c73f956aa279 broke the db_cluster module in 2014?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2385
Module: kamailio
Branch: 5.3
Commit: dffd3502fed5cf33055f67967ba538f2c68c2a59
URL: https://github.com/kamailio/kamailio/commit/dffd3502fed5cf33055f67967ba538f…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2020-07-02T10:02:03+02:00
modules: readme files regenerated - modules ... [skip ci]
---
Modified: src/modules/carrierroute/README
Modified: src/modules/pua/README
---
Diff: https://github.com/kamailio/kamailio/commit/dffd3502fed5cf33055f67967ba538f…
Patch: https://github.com/kamailio/kamailio/commit/dffd3502fed5cf33055f67967ba538f…
---
diff --git a/src/modules/carrierroute/README b/src/modules/carrierroute/README
index cb659bdf75..8f1b4a0532 100644
--- a/src/modules/carrierroute/README
+++ b/src/modules/carrierroute/README
@@ -365,7 +365,8 @@ modparam("carrierroute", "config_source", "file")
3.6. config_file (string)
- Specifies the path to the config file.
+ Specifies the path to the config file. The file has to be owned by the
+ user and group used to run Kamailio.
Default value is “/etc/kamailio/carrierroute.conf”.
diff --git a/src/modules/pua/README b/src/modules/pua/README
index e232590207..3079312646 100644
--- a/src/modules/pua/README
+++ b/src/modules/pua/README
@@ -193,7 +193,7 @@ modparam("pua", "hash_size", 11)
Example 1.2. Set db_url parameter
...
-modparam("pua", "db_url" "dbdriver://username:password@dbhost/dbname")
+modparam("pua", "db_url", "dbdriver://username:password@dbhost/dbname")
...
3.3. db_table (str)
Module: kamailio
Branch: 5.3
Commit: 35d977aed4c7137d34d4cf8216d503ac48f1e423
URL: https://github.com/kamailio/kamailio/commit/35d977aed4c7137d34d4cf8216d503a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-07-02T09:47:15+02:00
carrierroute: docs - note about config file ownership
- GH #2369
(cherry picked from commit 214c762c46d5cd5892d2ddc06a25193a01164e8b)
---
Modified: src/modules/carrierroute/doc/carrierroute_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/35d977aed4c7137d34d4cf8216d503a…
Patch: https://github.com/kamailio/kamailio/commit/35d977aed4c7137d34d4cf8216d503a…
---
diff --git a/src/modules/carrierroute/doc/carrierroute_admin.xml b/src/modules/carrierroute/doc/carrierroute_admin.xml
index 21fb73f42e..dee8d006f5 100644
--- a/src/modules/carrierroute/doc/carrierroute_admin.xml
+++ b/src/modules/carrierroute/doc/carrierroute_admin.xml
@@ -206,7 +206,8 @@ modparam("carrierroute", "config_source", "file")
<section>
<title><varname>config_file</varname> (string)</title>
<para>
- Specifies the path to the config file.
+ Specifies the path to the config file. The file has to be owned by
+ the user and group used to run &kamailio;.
</para>
<para>
<emphasis>