ArgumentError: must specify an iv occurring since introduction of blind_index
MeZKaL opened this issue · 4 comments
Since we introduced blind_index
in our rails project, we get randomly the ArgumentError: must specify an iv
error when accessing some indexed encrypted fields.
The failing row is always this:
def method_1(object)
object.field_1.present? && object.field_2.present? && check_field_2_is_valid(object.field_2)
end
So it only checks the presence of 2 encrypted fields and access the value of one of them.
We've had the same version (3.1.0) of attr_encrytped
for 9 months, and the error started appearing days after introducing blind_index
.
The error only occurred 3 times within the last 90 days. It doesn't seem much, but it's a quite a lot given that it occurs with a process that we run fortnightly.
Any help or hints is appreciated.
Hey @MeZKaL, is the IV column nil
for the failing record in the database? I'm not sure what would cause this, but will be hard to debug without a reproducible example.
No, I don't think so. Retrying the sidekiq job were that occurs works straight away without the content of field having changed.
I'm running an script to repeat the operation several thousand times to see if it can be reproduced. I will update later.
My test to reproduce it was not succesful, and it hasn't happened in the last 30 days.
I'll close for now and reopen if it happens again and I can provide any way to reproduce it.
Thanks for your support.