Invalid namespace error

FAQ - Invalid namespace error.


Client got “Invalid namespace” error exception even though the namespace is correctly specified.

Caused by: com.aerospike.client.AerospikeException: Invalid namespace: bar
at com.aerospike.client.command.Command.getSequenceNode(
at com.aerospike.client.command.Command.getNode(
at com.aerospike.client.command.SyncCommand.execute(
at com.aerospike.client.AerospikeClient.get(
at com.fbt.speed.dao.SpeedDao.getSpeedData(
at com.fbt.speed.api.SpeedApi.getSpeedById(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(


The error means the namespace is not found in the partition map (keyed by the specified namespace). Namespaces are statically configured on the server-side and never change while the server is running. When the AerospikeClient instance is constructed, the namespaces are retrieved from the servers.

So the client could be pointing to the a different cluster with no such namespace. It is also possible the access-address is not correctly configured.

One not common case that has been observed is one with an MTU mismatch in a docker environment.

After fixing the client MTU to match with the other instances the issue was resolved:

cat /etc/docker/daemon.json
"mtu" : 1400

In this case, the client also contained errors like these every second:

2018-10-30 19:02:54 WARN Node BB9AB1F9E565000 partition refresh failed: AEROSPIKE_ERR_TIMEOUT
2018-10-30 19:02:55 WARN Node BB9AB1F9E565000 partition refresh failed: AEROSPIKE_ERR_TIMEOUT
2018-10-30 19:02:56 WARN Node BB951619E565000 partition refresh failed: AEROSPIKE_ERR_TIMEOUT

This is an indication of a network issue. This can also be reproduced by dropping packets using special firewall rules in a non-docker environment. When the client gets a timeout error, it will return an “invalid namespace” because the namespace is not found in the current parition map.





© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.