Elasticsearch "circuit_breaking_exception ... Data too large" in CI
Elasticsearch tripped a circuit breaker to stop a request that would push heap usage past a safe limit, raising circuit_breaking_exception ... Data too large. On a CI service container with a small heap, an aggregation or bulk request can hit the parent breaker even though the data volume is modest.
What this error means
A request fails with HTTP 429 and "circuit_breaking_exception ... [parent] Data too large, data for [<request>] would be [...] which is larger than the limit". The heap on the CI container is small.
{"error":{"type":"circuit_breaking_exception","reason":"[parent] Data too large,
data for [<http_request>] would be [520000000/495.9mb], which is larger than the limit of
[510000000/486.3mb]","bytes_wanted":520000000,"bytes_limit":510000000},"status":429}Common causes
The CI heap is too small for the request
A tiny -Xmx (set to keep the container light) leaves little headroom, so an aggregation or bulk load trips the parent breaker.
A single request needs a lot of heap
A large bulk body, a broad aggregation, or a big search response can momentarily require more memory than the breaker allows.
How to fix it
Give the container a larger heap
- Raise
-Xmx/-XmsinES_JAVA_OPTSso the breaker limit scales up. - Increase the container memory limit alongside the heap.
- Re-run and confirm the request stays under the breaker.
env:
discovery.type: single-node
ES_JAVA_OPTS: -Xms1g -Xmx1gShrink the request
Split large bulk requests into smaller batches and narrow aggregations so no single request needs more heap than the breaker permits.
How to prevent it
- Size the CI heap to match the heaviest request your tests make.
- Batch bulk indexing instead of sending one huge request.
- Keep container memory comfortably above the configured heap.