# "Required array length too large" error during reindex

**URL:** <https://discuss.elastic.co/t/required-array-length-too-large-error-during-reindex/283090>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [September 1, 2021, 5:49pm UTC](https://discuss.elastic.co/t/required-array-length-too-large-error-during-reindex/283090 "2021-09-01T17:49:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Ney](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richard_ney/32/79007_2.png) [@Richard\_Ney](https://discuss.elastic.co/u/Richard_Ney)\
**Post date:** [September 1, 2021, 5:49pm UTC](https://discuss.elastic.co/t/required-array-length-too-large-error-during-reindex/283090/1 "2021-09-01T17:49:52Z")

</div>

I'm in the process of reindexing an index of large nested documents. During the reindex I'm using painless script to pull a couple nested documents up a level. For the most part the reindex is going fine but occasionally I'm getting a "java.lang.OutOfMemoryError: Required array length too large" which results in the Coordinator node running the job to restart.

I'm suspecting the document might be invalid given the size issues. Is there a simple way via `_search` to find the largest document?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 29, 2021, 5:50pm UTC](https://discuss.elastic.co/t/required-array-length-too-large-error-during-reindex/283090/2 "2021-09-29T17:50:06Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
