Skip to content

Proper handling of maximum response size errors for /_search API #254876

@adcoelho

Description

@adcoelho

Note: This issue was created in response to an operational runbook.

We discovered that the agent_builder plugin is not gracefully handling a scenario in which an Elasticsearch query could return a payload that's too large for Kibana to process.

This unhandled error is triggering a rule in the overview cluster.

Unexpected error in handler: RequestAbortedError: The content length (104860439) is bigger than the maximum allowed string (104857600)

The following queries were identified:
POST /.chat-conversations/_search

Loggers:

  • plugins.agentBuilder

Please use the isMaximumResponseSizeExceededError
helper to catch these errors and ensure that an actionable error is returned to users, such as:

resulting dataset is too large, try narrowing your search with filters, or use a smaller time range

If you want to add any server-side logging, this should be done at the warn level or lower.

Metadata

Metadata

Assignees

No one assigned

    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