Issue with aerospike ordered_map

Hi, I am using aerospike KEY_ORDERED map for a usecase. When I am trying to get value of a key which does not exist in the map, I am getting “Error Code 4: Parameter error” error. Below is the code snippet

Key key = new Key(namespace, set, primarykey);
Record record = client.operate(null, key, MapOperation.getByKey("data", Value.get(keyname), MapReturnType.VALUE));

However the same code works fine and returns null for unordered_map. Please let me know if I am missing something here. I want the KEY_ORDERED map to return a null value instead of the exception “Error Code 4: Parameter error”.

Thanks for the help in advance.

What is your Aerospike server version? Verified, I get the same failure on Server ver I get the exception with KEY_VALUE_ORDERED also.

Exception in thread "main" com.aerospike.client.AerospikeException: Error Code 4: Parameter error
	at com.aerospike.client.command.ReadCommand.parseResult(
	at com.aerospike.client.command.SyncCommand.execute(
	at com.aerospike.client.AerospikeClient.operate(

I am using aerospike server version

This was a bug in server version In the latest server version, both unordered and ordered maps return null values (no error) when the map key does not exist.

1 Like

Hi Brian, What is the latest server version in which this bug is solved? Is it server version?

Also will only updating the client version help?

The bug was fixed in server version (AER-5855)

This is not a client bug.

1 Like