The following step has followed:
telnet localhost 11211
set Test 0 100 10
get Test
CLIENT_ERROR bad data chunk
ERROR
set amit 2 2 2
get amit
CLIENT_ERROR bad data chunk
ERROR
The following step has followed:
telnet localhost 11211
set Test 0 100 10
get Test
CLIENT_ERROR bad data chunk
ERROR
set amit 2 2 2
get amit
CLIENT_ERROR bad data chunk
ERROR
In my case I was providing the value but the bytes were not exactly what I was mentioning in the set command, for the format of the command is:
set KEY META_DATA EXPIRY_TIME LENGTH_IN_BYTES
so for those who were just copy pasting the command without knowing as to why is it not storing the key and came here for the answer, this might help:
You need to provide the value of exactly the same bytes which you have mentioned in the last parameter of the set command
the following won't work:
also the following won't:
So when you enter the value it has to be exactly the same bytes, like this:
Although you do not ask a specific question, i presume you want to store a value. You could test with the default example from the Memcached manual.
You define that you want to store a key, but don't specify a value.
The following example specifies that you want to save a key "tutorialspoint", no flags, timeout of 900 and reserve 9 bytes for a value. Those 9 bytes are specified in the next line: "memcached". In your example i don't see a value.
set tutorialspoint 0 900 9
memcached
STORED
get tutorialspoint
VALUE tutorialspoint 0 9
memcached
END
the set
command takes 4 arguments:
0
for no flagsIn my case I was neglecting to calculate the number of bytes and that was why I kept getting the "client error bad data chunk" error