Hello,

No it is not a cluster, it's a standalone instance. I suspect that in the case 
of a cluster, the auth command is not getting re-sent after the MOVE is 
received.

Maybe you could workaround this by catching the error and resending both the 
auth and command to the server in the MOVE reply, but that would be a bit 
inefficient.

I agree, a local proxy to handle auth and the cluster replies may be a better 
solution.
________________________________
From: Володимир Іванець <[email protected]>
Sent: Saturday, October 11, 2025 11:21 AM
To: John Petrini <[email protected]>
Cc: Kamailio (SER) - Users Mailing List <[email protected]>
Subject: Re: [SR-Users] Re: ndb_redis behavior


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Hello John!

"write" server from your example, is it a cluster? Just tried it on my system 
and it didn't work.
It looks like Redis proxy should solve the problem.

redis_cmd("redis-cluster", "AUTH passw0rd", "r");
redis_cmd("redis-cluster", "HGET cnf:accounts:$AU password", "r");

 3(2561) DEBUG: ndb_redis [redis_client.c:439]: redisc_get_server(): Hash 
1969359015 (redis-cluster)
 3(2561) DEBUG: ndb_redis [redis_client.c:442]: redisc_get_server(): Entry 
1969359015 (redis-cluster)
 3(2561) DEBUG: ndb_redis [redis_client.c:446]: redisc_get_server(): Using 
entry 1969359015 (redis-cluster)
 3(2561) DEBUG: ndb_redis [redis_client.c:1033]: redisc_exec(): rsrv->ctxRedis 
= 0x55561cebfc30
 3(2561) DEBUG: ndb_redis [redis_client.c:1039]: redisc_exec(): rsrv->ctxRedis 
= 0x55561cebfc30
 3(2561) DEBUG: ndb_redis [redis_client.c:898]: check_cluster_reply(): Redis 
replied: "OK"
 3(2561) DEBUG: ndb_redis [redis_client.c:1118]: redisc_exec(): 
rpl->rplRedis->type:5
 3(2561) DEBUG: ndb_redis [redis_client.c:1132]: redisc_exec(): rsrv->ctxRedis 
= 0x55561cebfc30
 3(2561) DEBUG: ndb_redis [redis_client.c:439]: redisc_get_server(): Hash 
1969359015 (redis-cluster)
 3(2561) DEBUG: ndb_redis [redis_client.c:442]: redisc_get_server(): Entry 
1969359015 (redis-cluster)
 3(2561) DEBUG: ndb_redis [redis_client.c:446]: redisc_get_server(): Using 
entry 1969359015 (redis-cluster)
 3(2561) DEBUG: ndb_redis [redis_client.c:1033]: redisc_exec(): rsrv->ctxRedis 
= 0x55561cebfc30
 3(2561) DEBUG: ndb_redis [redis_client.c:1039]: redisc_exec(): rsrv->ctxRedis 
= 0x55561cebfc30
 3(2561) DEBUG: ndb_redis [redis_client.c:898]: check_cluster_reply(): Redis 
replied: "MOVED 1875 
10.42.0.36:6379<https://urldefense.com/v3/__http://10.42.0.36:6379__;!!KWzduNI!evMPnb5H_96jFoq9S8oPqOkH48P8PVZid7njjfc-Epfkt81HVwezq9u2dvYJ1WQVU3C2KhgneU9P1viZZ22bL1e1wKg$>"
 3(2561) DEBUG: ndb_redis [redis_client.c:906]: check_cluster_reply(): Port 
"6379" [4] => 6379
 3(2561) DEBUG: ndb_redis [redis_client.c:916]: check_cluster_reply(): Host 
"10.42.0.36" [10]
 3(2561) DEBUG: ndb_redis [redis_client.c:927]: check_cluster_reply(): Name of 
new connection: 
10.42.0.36:6379<https://urldefense.com/v3/__http://10.42.0.36:6379__;!!KWzduNI!evMPnb5H_96jFoq9S8oPqOkH48P8PVZid7njjfc-Epfkt81HVwezq9u2dvYJ1WQVU3C2KhgneU9P1viZZ22bL1e1wKg$>
 3(2561) DEBUG: ndb_redis [redis_client.c:439]: redisc_get_server(): Hash 
2703334398 
(10.42.0.36:6379<https://urldefense.com/v3/__http://10.42.0.36:6379__;!!KWzduNI!evMPnb5H_96jFoq9S8oPqOkH48P8PVZid7njjfc-Epfkt81HVwezq9u2dvYJ1WQVU3C2KhgneU9P1viZZ22bL1e1wKg$>)
 3(2561) DEBUG: ndb_redis [redis_client.c:442]: redisc_get_server(): Entry 
1969359015 (redis-cluster)
 3(2561) DEBUG: ndb_redis [redis_client.c:452]: redisc_get_server(): No entry 
found.
 3(2561) DEBUG: ndb_redis [redis_client.c:439]: redisc_get_server(): Hash 
2703334398 
(10.42.0.36:6379<https://urldefense.com/v3/__http://10.42.0.36:6379__;!!KWzduNI!evMPnb5H_96jFoq9S8oPqOkH48P8PVZid7njjfc-Epfkt81HVwezq9u2dvYJ1WQVU3C2KhgneU9P1viZZ22bL1e1wKg$>)
 3(2561) DEBUG: ndb_redis [redis_client.c:442]: redisc_get_server(): Entry 
2703334398 
(10.42.0.36:6379<https://urldefense.com/v3/__http://10.42.0.36:6379__;!!KWzduNI!evMPnb5H_96jFoq9S8oPqOkH48P8PVZid7njjfc-Epfkt81HVwezq9u2dvYJ1WQVU3C2KhgneU9P1viZZ22bL1e1wKg$>)
 3(2561) DEBUG: ndb_redis [redis_client.c:446]: redisc_get_server(): Using 
entry 2703334398 
(10.42.0.36:6379<https://urldefense.com/v3/__http://10.42.0.36:6379__;!!KWzduNI!evMPnb5H_96jFoq9S8oPqOkH48P8PVZid7njjfc-Epfkt81HVwezq9u2dvYJ1WQVU3C2KhgneU9P1viZZ22bL1e1wKg$>)
 3(2561) DEBUG: ndb_redis [redis_client.c:595]: redisc_reconnect_server(): 
rsrv->ctxRedis = (nil)
 3(2561) DEBUG: ndb_redis [redis_client.c:628]: redisc_reconnect_server(): 
rsrv->ctxRedis = 0x55561cec5260
 3(2561) DEBUG: ndb_redis [redis_client.c:969]: check_cluster_reply(): 
Connected to the new server with name: 
10.42.0.36:6379<https://urldefense.com/v3/__http://10.42.0.36:6379__;!!KWzduNI!evMPnb5H_96jFoq9S8oPqOkH48P8PVZid7njjfc-Epfkt81HVwezq9u2dvYJ1WQVU3C2KhgneU9P1viZZ22bL1e1wKg$>
 3(2561) DEBUG: ndb_redis [redis_client.c:1084]: redisc_exec(): rsrv->ctxRedis 
= 0x55561cec5260
 3(2561) DEBUG: ndb_redis [redis_client.c:1090]: redisc_exec(): rsrv->ctxRedis 
= 0x55561cec5260
 3(2561) DEBUG: ndb_redis [redis_client.c:1118]: redisc_exec(): 
rpl->rplRedis->type:6
 3(2561) ERROR: ndb_redis [redis_client.c:1120]: redisc_exec(): Redis 
error:NOAUTH Authentication required.

Thank you!

пт, 10 жовт. 2025 р. о 16:43 Володимир Іванець 
<[email protected]<mailto:[email protected]>> пише:
Hello John!

It appears to be an expected behavior. Module only authenticates the first time 
it connects. Found similar topic here: 
https://github.com/kamailio/kamailio/issues/3654<https://urldefense.com/v3/__https://github.com/kamailio/kamailio/issues/3654__;!!KWzduNI!evMPnb5H_96jFoq9S8oPqOkH48P8PVZid7njjfc-Epfkt81HVwezq9u2dvYJ1WQVU3C2KhgneU9P1viZZ22b6tjUtRM$>

Regardless, your approach will work perfect for me. Thank you for sharing it!


пт, 10 жовт. 2025 р., 16:37 користувач John Petrini 
<[email protected]<mailto:[email protected]>> пише:
I encountered the same issue, I'm not sure if it's a bug or if I made a mistake 
somewhere but we opted to just keep sending auth with each request as that's 
what we've been doing for years anyway.

      redis_cmd("write", "AUTH REDIS_PASS", "r");
      redis_cmd("write", "SET %s %s", "$fU", "$avp(an_avp)", "r");

Another option is to use a unix socket if the db is local.
________________________________
From: Володимир Іванець via sr-users 
<[email protected]<mailto:[email protected]>>
Sent: Friday, October 10, 2025 9:03 AM
To: Kamailio (SER) - Users Mailing List 
<[email protected]<mailto:[email protected]>>
Cc: Володимир Іванець 
<[email protected]<mailto:[email protected]>>
Subject: [SR-Users] Re: ndb_redis behavior


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.

Kamailio version is 6.0.2.

Thank you!

пт, 10 жовт. 2025 р. о 15:55 Володимир Іванець 
<[email protected]<mailto:[email protected]>> пише:
Hello everyone!

Can someone please tell if this is expected behavior and I should remove 
authentication?

I have a Redis cluster with authentication enabled. Kamailio configuration is 
as follows:
modparam("ndb_redis", "server", 
"name=redis-cluster;addr=redis-redis-cluster;port=6379;pass=mypassword")
modparam("ndb_redis", "init_without_redis", 1)
modparam("ndb_redis", "connect_timeout", 1000)
modparam("ndb_redis", "cmd_timeout", 1000)
modparam("ndb_redis", "cluster", 1)
modparam("ndb_redis", "allow_dynamic_nodes", 1)
modparam("ndb_redis", "flush_on_reconnect", 0)

Kamailio stops request to Redis with "NOAUTH Authentication required" error 
when it tries to execute redis_cmd("redis-cluster", "HGET cnf:accounts:$AU 
password", "r");
 4(1630) DEBUG: ndb_redis [redis_client.c:439]: redisc_get_server(): Hash 
1969359015 (redis-cluster)
 4(1630) DEBUG: ndb_redis [redis_client.c:442]: redisc_get_server(): Entry 
1969359015 (redis-cluster)
 4(1630) DEBUG: ndb_redis [redis_client.c:446]: redisc_get_server(): Using 
entry 1969359015 (redis-cluster)
 4(1630) DEBUG: ndb_redis [redis_client.c:1033]: redisc_exec(): rsrv->ctxRedis 
= 0x55563cd13c30
 4(1630) DEBUG: ndb_redis [redis_client.c:1039]: redisc_exec(): rsrv->ctxRedis 
= 0x55563cd13c30
 4(1630) DEBUG: ndb_redis [redis_client.c:898]: check_cluster_reply(): Redis 
replied: "MOVED 1875 
10.42.0.36:6379<https://urldefense.com/v3/__http://10.42.0.36:6379__;!!KWzduNI!aTVDOqq2zrpUtoBQ5lO840-dzwocBaaPLOLLm0U57XyJIgNfAGvrJZDGKtar-aOCXi2CJ-HvBb2ssz2s6bSbIgEm$>"
 4(1630) DEBUG: ndb_redis [redis_client.c:906]: check_cluster_reply(): Port 
"6379" [4] => 6379
 4(1630) DEBUG: ndb_redis [redis_client.c:916]: check_cluster_reply(): Host 
"10.42.0.36" [10]
 4(1630) DEBUG: ndb_redis [redis_client.c:927]: check_cluster_reply(): Name of 
new connection: 
10.42.0.36:6379<https://urldefense.com/v3/__http://10.42.0.36:6379__;!!KWzduNI!aTVDOqq2zrpUtoBQ5lO840-dzwocBaaPLOLLm0U57XyJIgNfAGvrJZDGKtar-aOCXi2CJ-HvBb2ssz2s6bSbIgEm$>
 4(1630) DEBUG: ndb_redis [redis_client.c:439]: redisc_get_server(): Hash 
2703334398 
(10.42.0.36:6379<https://urldefense.com/v3/__http://10.42.0.36:6379__;!!KWzduNI!aTVDOqq2zrpUtoBQ5lO840-dzwocBaaPLOLLm0U57XyJIgNfAGvrJZDGKtar-aOCXi2CJ-HvBb2ssz2s6bSbIgEm$>)
 4(1630) DEBUG: ndb_redis [redis_client.c:442]: redisc_get_server(): Entry 
1969359015 (redis-cluster)
 4(1630) DEBUG: ndb_redis [redis_client.c:452]: redisc_get_server(): No entry 
found.
 4(1630) DEBUG: ndb_redis [redis_client.c:439]: redisc_get_server(): Hash 
2703334398 
(10.42.0.36:6379<https://urldefense.com/v3/__http://10.42.0.36:6379__;!!KWzduNI!aTVDOqq2zrpUtoBQ5lO840-dzwocBaaPLOLLm0U57XyJIgNfAGvrJZDGKtar-aOCXi2CJ-HvBb2ssz2s6bSbIgEm$>)
 4(1630) DEBUG: ndb_redis [redis_client.c:442]: redisc_get_server(): Entry 
2703334398 
(10.42.0.36:6379<https://urldefense.com/v3/__http://10.42.0.36:6379__;!!KWzduNI!aTVDOqq2zrpUtoBQ5lO840-dzwocBaaPLOLLm0U57XyJIgNfAGvrJZDGKtar-aOCXi2CJ-HvBb2ssz2s6bSbIgEm$>)
 4(1630) DEBUG: ndb_redis [redis_client.c:446]: redisc_get_server(): Using 
entry 2703334398 
(10.42.0.36:6379<https://urldefense.com/v3/__http://10.42.0.36:6379__;!!KWzduNI!aTVDOqq2zrpUtoBQ5lO840-dzwocBaaPLOLLm0U57XyJIgNfAGvrJZDGKtar-aOCXi2CJ-HvBb2ssz2s6bSbIgEm$>)
 4(1630) DEBUG: ndb_redis [redis_client.c:595]: redisc_reconnect_server(): 
rsrv->ctxRedis = (nil)
 4(1630) DEBUG: ndb_redis [redis_client.c:628]: redisc_reconnect_server(): 
rsrv->ctxRedis = 0x55563cd1bce0
 4(1630) DEBUG: ndb_redis [redis_client.c:969]: check_cluster_reply(): 
Connected to the new server with name: 
10.42.0.36:6379<https://urldefense.com/v3/__http://10.42.0.36:6379__;!!KWzduNI!aTVDOqq2zrpUtoBQ5lO840-dzwocBaaPLOLLm0U57XyJIgNfAGvrJZDGKtar-aOCXi2CJ-HvBb2ssz2s6bSbIgEm$>
 4(1630) DEBUG: ndb_redis [redis_client.c:1084]: redisc_exec(): rsrv->ctxRedis 
= 0x55563cd1bce0
 4(1630) DEBUG: ndb_redis [redis_client.c:1090]: redisc_exec(): rsrv->ctxRedis 
= 0x55563cd1bce0
 4(1630) DEBUG: ndb_redis [redis_client.c:1118]: redisc_exec(): 
rpl->rplRedis->type:6
 4(1630) ERROR: ndb_redis [redis_client.c:1120]: redisc_exec(): Redis 
error:NOAUTH Authentication required.

Thank you!
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- 
[email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to