-
Notifications
You must be signed in to change notification settings - Fork 19
Capture "caused_by" in errors #166
Description
If one attempts to index a very long value in a flattened field, it will cause indexing to fail. This is reported by go-docappender, but the reason for the error is obscured. It will look something like "reason":"[1:40656] failed to parse field [error.exception.stacktrace] of type [flattened] in document with id '5UtbPI8BaMhqs2kExrLc'.. Elasticsearch responds with a preview of the field value, but we strip this off.
The Elasticsearch response would also include "caused_by", which has helpful information about what caused the indexing to fail. In the example scenario above, it would be something like "caused_by":{"type":"illegal_argument_exception","reason":"Flattened field [error.exception.stacktrace] contains one immense field whose keyed encoding is longer than the allowed max length of 32766 bytes. Key length: 17, value length: 121034 for key starting with [vars.request_body]"}.
We should consider logging the cause to assist in debugging.