[OpenSIPS-Devel] [ opensips-Bugs-3425998 ] wrap_memcached_insert : NO SERVERS DEFINED

SourceForge.net noreply at sourceforge.net
Thu Oct 20 17:34:08 CEST 2011


Bugs item #3425998, was opened at 2011-10-19 20:14
Message generated for change (Comment added) made by roystan1981
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3425998&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: 1.6.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Roystan Mendez (roystan1981)
Assigned to: Vladut-Stefan Paiu (vladut-paiu)
Summary: wrap_memcached_insert : NO SERVERS DEFINED

Initial Comment:
I have downloaded and using the opensips-1.6.4-2-notls version.
I am trying to save data into memcache using cache_store with memcached backend function, but i keep on getting the following error:
ERROR:memcached:wrap_memcached_insert: Failed to insert: NO SERVERS DEFINED
As it is stated in the bug tracer that the issue has been fixed and updated in the 1.6.x branch and trunk but it is still occurring.
Please help me fix it.

Roystan

----------------------------------------------------------------------

>Comment By: Roystan Mendez (roystan1981)
Date: 2011-10-20 21:04

Message:
Hello,

Okay. 
As well I have updated the memcached API with functionalities like
increment , decrement & remove in the 1.6.4-2 version. 
The only place I got stuck was to store the key-values while loading the
module.
I did a work around to load the key-values into memcache by a perl script
before starting opensips.
Will do it with the start-up script now.
Likewise will also upgrade the module for 1.8 version.

Regards,
Roystan


----------------------------------------------------------------------

Comment By: Vladut-Stefan Paiu (vladut-paiu)
Date: 2011-10-20 20:25

Message:
Hello,

You can use the startup route to execute memcached queries at OpenSIPS
startup, because the startup route is executed after fork() and
child_init() is done.

But if you want to make further alterations ( add, remove keys ) in
memcache from within your module in a later moment in time, you will not be
able to in 1.6, and your only option is to upgrade to 1.8.
Tommorow I will add some proper code examples on how to use the Key-Value
interface recently added into OpenSIPS,
http://www.opensips.org/Resources/DocsTutKvinterface

Regards,
Vlad

----------------------------------------------------------------------

Comment By: Roystan Mendez (roystan1981)
Date: 2011-10-20 20:15

Message:
Hello,

Yes that is exactly what I am trying to achieve.

Between I have also  read about STARTUP route. Will it be possible to
achieve it by doing so.

Also it would be a great help if you could add examples of this scenario.
Thanks in advance.


----------------------------------------------------------------------

Comment By: Vladut-Stefan Paiu (vladut-paiu)
Date: 2011-10-20 19:59

Message:
Hello,

So you are trying to make a new module, that in mod_init() attempts to do
some memcached server inserts ? 

If yes, this will not work in OpenSIPS 1.6, because it was not designed
for other modules to use this functionality, it was only meant for the
script.
So what happens in 1.6 is that the actual connections are created when the
child_init() function inside the memcached module is ran, which happens
after OpenSIPS forks all it's children, so each OpenSIPS child gets a
different connection.

OpenSIPS trunk ( 1.8 ) allows this functionality ( modules can internally
use Cache/DB key-value functionality ), but it hasn't been documented yet
with some good examples. 
If I have understood your scenario right, please let me know and I will
add some proper examples.


----------------------------------------------------------------------

Comment By: Roystan Mendez (roystan1981)
Date: 2011-10-20 19:46

Message:
Hi Vladut,

Thank you so much for looking into the issue.

Let me explain the scenario to you.
I am trying to develop a module where I can do some ANI & DNID
manipulations based on some rules.
I am trying to load the data into the memcahed server for computing.
When I am trying to load the module I am getting that error.

Following are the log messages printed when I try to run opensips -E 
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Oct 20 19:13:07 [19585] INFO:core:main: using 720 Mb shared memory
Oct 20 19:13:07 [19585] INFO:core:main: using 256 Mb private memory per
process
Oct 20 19:13:07 [19585] INFO:memcached:mod_init: Memcached
memcached_b2cmsg
Oct 20 19:13:07 [19585] INFO:memcached:mod_init: Memcached Loaded....
Oct 20 19:13:07 [19585] NOTICE:signaling:mod_init: initializing module
...
Oct 20 19:13:07 [19585] INFO:maxfwd:mod_init: initializing...
Oct 20 19:13:07 [19585] INFO:textops:mod_init: initializing...
Oct 20 19:13:07 [19585] INFO:rr:mod_init: rr - initializing
Oct 20 19:13:07 [19585] INFO:sl:mod_init: Initializing StateLess engine
Oct 20 19:13:07 [19585] INFO:tm:mod_init: TM - initializing...
Oct 20 19:13:07 [19585] INFO:sips_rule:sips_rule_init:
Initializing...SIPS_RULES
Oct 20 19:13:07 [19585] INFO:sips_rule:reload_rule_group_table: Using rule
group table = RuleGroupList
Oct 20 19:13:07 [19585] INFO:sips_rule:reload_rule_group_table: Number of
rows in rule group table: 1
Oct 20 19:13:07 [19585] INFO:core:cache_store: memcache system is
Registered <memcached_b2cmsg>
Oct 20 19:13:07 [19585] ERROR:memcached:wrap_memcached_insert: Failed to
insert: NO SERVERS DEFINED
Oct 20 19:13:07 [19585] ERROR:sips_rule:reload_rule_group_table: Could not
sotre key RG1-1 : 1|1|1|1|18184xxxxxx|0|0|||18185xxxxxx|0|1234*|4|0|||
Oct 20 19:13:07 [19585] INFO:core:probe_max_receive_buffer: using a UDP
receive buffer of 255 kb
Oct 20 19:13:07 [19585] INFO:core:probe_max_receive_buffer: using a UDP
receive buffer of 255 kb
Oct 20 19:13:07 [19585] INFO:core:probe_max_receive_buffer: using a UDP
receive buffer of 255 kb
Oct 20 19:13:07 [19586] INFO:mi_datagram:datagram_process: a new child
0/19586
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

If you see above RG1-1 is the KEY and
"1||18184xxxxxx|0|0|||18185xxxxxx|0|1234*|4|0|||" is some data I am trying
to store in the memcache server.

Following is the memcached configuration in the opensips.cfg
------------------------------------------------------------------------------------------------------------------
. . . . . .
. . . . . . 
loadmodule "memcached.so"
modparam("memcached", "server", "b2cmsg = 192.168.15.235:11211")

loadmodule "sips_rule.so"
. . .. . . 
. . . . . .
-------------------------------------------------------------------------------------------------------------------------------

I am loading the memcached.so before I load my module.

But still getting the error message.

-- Roystan



----------------------------------------------------------------------

Comment By: Vladut-Stefan Paiu (vladut-paiu)
Date: 2011-10-20 19:16

Message:
Hello,

From where are you calling cache_store when the error occurs ? You can use
xlog() to trace exactly which cache_store() call is triggering the error. I
see the previous bug was when cache_* was called from the timer_route ? Is
this your case ?

Are there any other relevant errors, other than "NO SERVERS DEFINED" ?

Regards,
Vlad

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3425998&group_id=232389



More information about the Devel mailing list