Java Client Error Message : Error -3,1,0,30000,0,2: Cluster is empty

Reading record from aerospike gives cluster is empty exception.Also the error occurs for few requests. Some records passes and give the result but few gives this exception : com.aerospike.client.AerospikeException$InvalidNode: Error -3,1,0,30000,0,2: Cluster is empty

I am using java client version 5.1.11

Below is the code to read :

new AerospikeClient(hostName,port);

@Autowired private AerospikeClient client;

client.get(policy, key);

Hi @paras, welcome to the community! It sounds like the initial tending doesn’t happen, causing the client to see an empty partition map. Is it possible the client object is being instantiated with each attempt?

The AerospikeClient log will identify tend issues. Have a look at how to subscribe to the log to hopefully get a better picture of what’s happening.

Since you are working with Spring Boot, it may be worthwhile to check out this blog post and its corresponding GitHub repo to ensure your setup is correct.

Hi @aanderson ,

Client object is created only once.

Below is the code for same :

@ Configuration public class AppConfig { @ Value(“${aerospike.hostName}”) private String hostName;

@ Value("${aerospike.portNumber}")
private int port;

@ Bean(destroyMethod = “close”) public AerospikeClient aerospike() { return new AerospikeClient(hostName,port); } }

I agree with @aanderson that taking a look at the logs should help figure out potential connectivity issues during initial seeding/discovering of the cluster (which would be the most common cause for this).