#440 wrap_memcached_insert : NO SERVERS DEFINED

1.6.x
closed-invalid
core (110)
5
2011-10-25
2011-10-19
No

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

Discussion

  • Roystan Mendez

    Roystan Mendez - 2011-10-20
    • assigned_to: nobody --> anca_vamanu
     
  • Vladut-Stefan Paiu

    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

     
  • Vladut-Stefan Paiu

    • assigned_to: anca_vamanu --> vladut-paiu
     
  • Roystan Mendez

    Roystan Mendez - 2011-10-20

    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

     
  • Vladut-Stefan Paiu

    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.

     
  • Roystan Mendez

    Roystan Mendez - 2011-10-20

    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.

     
  • Vladut-Stefan Paiu

    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

     
  • Roystan Mendez

    Roystan Mendez - 2011-10-20

    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

     
  • Vladut-Stefan Paiu

    Hello,

    I have just committed to trunk an example module on how to use the Key-Value interface, it is located in cachedb/example , so please do a checkout of trunk and take a look at the example.

    Regards,
    Vlad

     
  • Vladut-Stefan Paiu

    Hi,

    I am now going to close this and mark it as invalid, as this isn't a bug, but rather 1.6 wasn't meant to work this way.
    For such functionality, use the latest trunk branch.

    Regards,
    Vlad

     
  • Vladut-Stefan Paiu

    • status: open --> closed-invalid
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks