Skip to content

Capture "caused_by" in errors #166

@axw

Description

@axw

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions