Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weird Memcached issue with apache

apache2: libmemcached/storage.cc:341: memcached_return_t memcached_send_ascii(memcached_st*, memcached_server_write_instance_st, const char*, size_t, const char*, size_t, time_t, uint32_t, uint64_t, bool, bool, memcached_storage_action_t): Assertion `memcached_failed(rc)' failed.

I have no idea what is causing this to throw, when it was thrown, or why.

Is this a fatal error? If so, does anyone know where i can fix it?

like image 312
Ascherer Avatar asked Apr 17 '13 18:04

Ascherer


2 Answers

I have had the same issue with SugarCRM Community Edition v6.5.15 (Build 1083). I have fixed this forcing memcached daemon to negotiate binary protocol with clients (including libmemcached C++ client). This works for me, try it.

In Debian Wheezy, memcached package has a configuration file at /etc/memcached.conf. Add this line at end of file:

-B binary

Then restart memcached service

service memcached restart

More info : http://linux.die.net/man/1/memcached

like image 148
Antonio Espinosa Avatar answered Nov 20 '22 07:11

Antonio Espinosa


I would look at it line 341 of storage.cc in libmemcached. libmemcached doesn't do a good job of input validation so depending on say .... your key values (never use spaces in keys or in the key namespace) you can have lots of trouble with errors.

Looking at the source, libmemcache was expecting a reply from the memcache server after sending a command and failed to send the command. So it could have many causes (key error, connection error, etc).

http://bazaar.launchpad.net/~tangent-trunk/libmemcached/1.0/view/head:/libmemcached/storage.cc

like image 44
Daniel Williams Avatar answered Nov 20 '22 08:11

Daniel Williams