Bad blob get

When running trying to grab values from a blob in the agent, I keep getting this error:

“bad blob get”

The index is 3622 and the length of the blob is 13034, so the value shouldn’t be outside of the bounds. It used to work previously.

local t1 = data[j];

Interesting. I can’t replicate with code that creates a new blob in the agent, or code which sends a blob from the device to the agent. Is this blob one that has been received from the device?

This is the method that receives blob data from the device.

function receiveData(blinkupData) { blinkupData.buffer.resize(blinkupData.length); data.writeblob(blinkupData.buffer); server.log("Received buffer of length " + blinkupData.buffer.len()); }

Essentially I am iterating over the blob data at a later point in the agent (on http request). If I start iterating from 0, everything works fine. If I start the iteration at a much later point … the bad blob get happens.

Looking in the code, you’ll get that error if your index (j) is not an integer. Is it?

ie, data[3622] is ok for me, but data[3622.0] gives me bad blob get.

That would seem to be the answer (Thanks!). I am calculating my initial iteration point by multiplying a value by 2. The perils of dynamic type.