Reputation: 8093
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?
Upvotes: 5
Views: 1885
Reputation: 25293
I had exactly the same error (except "apache2" head) when developing a library and it was a threading related error. One instance of memcached client was accessed by a number of concurrent threads so the client and the server happened to occur in inconsistent state. Thus the assertion on return code, rc
, in libmemcached fails. As far as I see, libmemcached internal structure that defines a connection is not thread-safe.
At the same time it isn't easy to imagine how could you make this, presumably a threading error, happen in PHP which doesn't provide threading utilities. Anyway you should inspect your code for doing something abnormal with a memcached connection.
Upvotes: -1
Reputation: 1764
First of all - you should check connection limit.
This error appears when memcached service reached limit of connections (-c param). By default, limit set to 1024 connections. But if you tried to make multithreading the limit may quickly reached.
Default config path: /etc/sysconfig/memcached
Upvotes: 0
Reputation: 999
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
Upvotes: 7
Reputation: 8895
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
Upvotes: 6