Resolve AerospikeException: Error 22

I am facing the same issue while performing write operation to aerspike. com.aerospike.client.AerospikeException: Error 22,1,30000,0,0,BB98EADF34CDF02 3000: Operation not allowed at this time at com.aerospike.client.command.WriteCommand.parseResult( at com.aerospike.client.command.SyncCommand.execute(

public <T> boolean writeToAerospike(String key, List<T> data) {
        int expiration = 2;
        try {
            Key aerospikeKey = new Key(namespace, setName, key);
            WritePolicy writePolicy = new WritePolicy();
            writePolicy.expiration = expiration;
            Bin bin = new Bin(bins, l2rData);
            aerospikeClient.put(writePolicy, aerospikeKey, bin);
        } catch (Exception e) {
            LOGGER.error("Error while writing data to aerospike", e);
            return false;
        return true;

Can anyone pls help in resolving this ?

Please share your namespace configuration and your aerospike server version. You are trying to insert a record with finite time to live (expiration). Your namespace may be configured to accept only live-for-ever records.

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