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( at com.aerospike.client.command.SyncCommand.execute( at com.aerospike.client.AerospikeClient.put(

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
© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.