# Issue with aerospike ordered\_map

**URL:** <https://discuss.aerospike.com/t/issue-with-aerospike-ordered-map/5455>\
**Category:** General Discussion\
**Tags:** map\
**Created:** [August 17, 2018, 10:27am UTC](https://discuss.aerospike.com/t/issue-with-aerospike-ordered-map/5455 "2018-08-17T10:27:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aman.choudhary](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@aman.choudhary](https://discuss.aerospike.com/u/aman.choudhary)\
**Post date:** [August 17, 2018, 10:27am UTC](https://discuss.aerospike.com/t/issue-with-aerospike-ordered-map/5455/1 "2018-08-17T10:27:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pgupta](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/pgupta/32/2351_2.png) [@pgupta](https://discuss.aerospike.com/u/pgupta)\
**Post date:** [August 17, 2018, 4:49pm UTC](https://discuss.aerospike.com/t/issue-with-aerospike-ordered-map/5455/2 "2018-08-17T16:49:45Z")

</div>

What is your Aerospike server version? Verified, I get the same failure on Server ver 3.16.0.6. 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(ReadCommand.java:111)
> at com.aerospike.client.command.SyncCommand.execute(SyncCommand.java:84)
> at com.aerospike.client.AerospikeClient.operate(AerospikeClient.java:1277)
> 
> ```

---

<div class="post-metadata">

**Author:** ![aman.choudhary](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@aman.choudhary](https://discuss.aerospike.com/u/aman.choudhary)\
**Post date:** [August 17, 2018, 8:50pm UTC](https://discuss.aerospike.com/t/issue-with-aerospike-ordered-map/5455/3 "2018-08-17T20:50:22Z")

</div>

I am using aerospike server version 4.0.0.5

---

<div class="post-metadata">

**Author:** ![Brian](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/brian/32/2211_2.png) [@Brian](https://discuss.aerospike.com/u/Brian)\
**Post date:** [August 20, 2018, 7:36pm UTC](https://discuss.aerospike.com/t/issue-with-aerospike-ordered-map/5455/4 "2018-08-20T19:36:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aman.choudhary](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@aman.choudhary](https://discuss.aerospike.com/u/aman.choudhary)\
**Post date:** [August 21, 2018, 7:37am UTC](https://discuss.aerospike.com/t/issue-with-aerospike-ordered-map/5455/5 "2018-08-21T07:37:20Z")

</div>

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

Also will only updating the client version help?

---

<div class="post-metadata">

**Author:** ![Brian](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/brian/32/2211_2.png) [@Brian](https://discuss.aerospike.com/u/Brian)\
**Post date:** [August 21, 2018, 5:24pm UTC](https://discuss.aerospike.com/t/issue-with-aerospike-ordered-map/5455/6 "2018-08-21T17:24:52Z")

</div>

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

[https://www.aerospike.com/download/server/notes.html#4.1.0.1](https://www.aerospike.com/download/server/notes.html#4.1.0.1)

This is not a client bug.
