Aerospike Exception Error Code 4 Parameter Error when doing a put through java client

I am processing an avro file with a list of records and doing a client.put for each record to my local Aerospike store.

For some reason, put for a certain number of records is succeeding and it’s not for the rest. I am doing this -

client.put(writePolicy, recordKey, bins);

The related values for the failed call are -

namespace = test

setname = test_set

userkey = ADIDGoogle#372b5e24-a9f7-4da8-a737-715c43755ecb

write policy = null

Bins - is_user,prof_loc,rfm,store_browsed,store_purch,city_id

Log Snippet

com.aerospike.client.AerospikeException: Error Code 4: Parameter error at com.aerospike.client.command.WriteCommand.parseResult(WriteCommand.java:72) at com.aerospike.client.command.SyncCommand.execute(SyncCommand.java:56) at com.aerospike.client.AerospikeClient.put(AerospikeClient.java:338)

What could possibly be the issue?

1 Like

Finally. Resolved!

I was using the REPLACE RecordsExistsAction in this case. Any bin with null value will fail in this configuration. Aerospike treats a null value in a bin as equivalent to removing that bin value from the record for a key. Thus REPLACE configuration doesn’t make sense for such an operation, and hence a parameter error - Invalid DB operation.

UPDATE config on the other hand will work perfectly fine.

1 Like