We hit this error after upgrading to rails 7 and attr_encrypted 4.0.0:
TypeError
can't dump IO (TypeError)
value = options[:marshal] ? options[:marshaler].send(options[:dump_method], value) : value.to_s
It looks like the gem was no longer able to handle an encrypted json object in a payload. We fixed it by converting the payload to a hash.