Error Put data into single-bin namespace - "Error Code 12: Bin type error"

I configured a single-bin namespace where I would like to store some evidence string data.

Here is the namespace:

namespace evidence {
    replication-factor 2
    default-ttl 31d
    memory-size 10G
    single-bin true
    data-in-index true
    high-water-disk-pct 90
    storage-engine device {
        file /dev/shm/aerospoke_evidence_file.dat
    filesize 7G
    data-in-memory true
    }
 }

Here is my C# code:

string evidence = "<xml>test data</xml>";
string hash = GenerateMD5Hash(evidence); 
//This is used to generate a hash to be used as Key, since some content will generate same key

WritePolicy writePolicy = new WritePolicy();
writePolicy.recordExistsAction = RecordExistsAction.UPDATE;
writePolicy.commitLevel = CommitLevel.COMMIT_MASTER;
writePolicy.expiration = 604800;
writePolicy.timeout = 300;

string setName = "CustomSystemDiagnosticsConsoleSampleApplication_1_0_0";
Key key = new Key("evidence", setName, hash);
client.Put(writePolicy, key, new Bin(string.Empty, evidence));

But I get an exception “Error Code 12: Bin type error”

Anyone have an idea?

Can you provide your “evidence” namespace configuration in “aerospike.conf”?

Hey Brian, I just edited my post and inserted the namespace configuration.

Please see: http://www.aerospike.com/docs/operations/configure/namespace/storage/#recipe-for-a-hdd-storage-engine-with-data-in-index-engine

The “data-in-index” configuration requires bin type to be numeric (integer or double).

The data type in the example, “evidence”, is string type. This is why a “Bin type error” is returned.