# Unable to set mustache.max\_output\_size\_bytes in elasticsearch.yml version 7.17.25

**URL:** <https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412>\
**Category:** Elasticsearch\
**Created:** [December 26, 2024, 12:36pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412 "2024-12-26T12:36:01Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![ManojKumarM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/manojkumarm/32/140297_2.png) [@ManojKumarM](https://discuss.elastic.co/u/ManojKumarM)\
**Post date:** [December 26, 2024, 12:36pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/1 "2024-12-26T12:36:01Z")

</div>

Hi,

We have recently upgraded to 7.17.25 and trying to set the below configuration in elasticsearch.yml as recommended in the release notes

mustache.max\_output\_size\_bytes: 10485760

however we see that configuration is not picked up by elatsicsearch at startup and throwing the Exception as below

java.lang.IllegalArgumentException: failed to parse setting [mustache.max\_output\_size\_bytes] with value [10485760] as a size in bytes: unit is missing or unrecognized

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 26, 2024, 3:34pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/2 "2024-12-26T15:34:25Z")

</div>

Try looks like the setting needs units

`mustache.max_output_size_bytes: 1mb`

So 2mb would be

`mustache.max_output_size_bytes: 2mb`

See

> <https://github.com/elastic/elasticsearch/blob/c2187fb89d283d7a18fb3d16b18cfec72ba5478b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MustacheScriptEngine.java#L57>

---

<div class="post-metadata">

**Author:** ![praveen4bv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praveen4bv/32/45595_2.png) [@praveen4bv](https://discuss.elastic.co/u/praveen4bv)\
**Post date:** [December 26, 2024, 3:47pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/3 "2024-12-26T15:47:35Z")

</div>

Thanks Stephen.

I have set the value as recommended but now i am seeing a different exception at the start up. Look like the setting itself is not recognized. Am i missing anything?

org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown setting [mustache.max\_output\_size\_bytes] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 26, 2024, 4:06pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/4 "2024-12-26T16:06:19Z")

</div>

Hmmm I am seeing the same things... I will try to check internally... Its US / UK holiday... so you may not get an answer right away

---

<div class="post-metadata">

**Author:** ![praveen4bv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praveen4bv/32/45595_2.png) [@praveen4bv](https://discuss.elastic.co/u/praveen4bv)\
**Post date:** [December 26, 2024, 4:10pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/5 "2024-12-26T16:10:58Z")

</div>

I understand. Will wait for your response. I tried this configuration in both 7.17.25 and 7.17.26. Both versions are giving the same exception.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 26, 2024, 4:20pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/6 "2024-12-26T16:20:53Z")

</div>

TO be clear the new default is `1mb` do you need more than that... that is quite a long script...

---

<div class="post-metadata">

**Author:** ![praveen4bv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praveen4bv/32/45595_2.png) [@praveen4bv](https://discuss.elastic.co/u/praveen4bv)\
**Post date:** [December 26, 2024, 4:38pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/7 "2024-12-26T16:38:34Z")

</div>

Unfortunately, yes, we need more than 1mb until we find a way to optimize.  
These are existing scripts which were running fine on 7.17.11 until we upgrade to 7.17.25 last week.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 26, 2024, 4:50pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/8 "2024-12-26T16:50:02Z")

</div>

There is a bug... thee setting was not properly "registered" so it can not be set at this time...

There is going to be a PR opened when it does I will paste it here for you to track.

Here is the PR

> <https://github.com/elastic/elasticsearch/pull/119291>
>
> In #114002 the maximum size of a mustache script output was made configurable. H…owever, the setting was not registered. This commit registers the setting so that it can be set in elasticsearch.yml.

---

<div class="post-metadata">

**Author:** ![praveen4bv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praveen4bv/32/45595_2.png) [@praveen4bv](https://discuss.elastic.co/u/praveen4bv)\
**Post date:** [December 26, 2024, 5:43pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/9 "2024-12-26T17:43:48Z")

</div>

Thanks Stephen. I know it is a bit early to ask, do you have any timeline on when this will be fixed?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [December 26, 2024, 5:47pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/10 "2024-12-26T17:47:56Z")

</div>

No and I do not control that, and Elastic does not announce release dates ahead of time.

I would suggest to follow the PR it is already in the process of being merged....

It is tagged for

 ![Screenshot 2024-12-26 at 9.45.51 AM](https://us1.discourse-cdn.com/elastic/original/3X/7/f/7f72a9d899c894ca323edc43ca53eaa0b50f1522.png)

Keep an eye out for the 7.17.27 release...

---

<div class="post-metadata">

**Author:** ![Arun\_Kumar8](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arun_kumar8/32/132827_2.png) [@Arun\_Kumar8](https://discuss.elastic.co/u/Arun_Kumar8)\
**Post date:** [February 11, 2025, 8:26am UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/11 "2025-02-11T08:26:27Z")

</div>

Hi stephen,

This bug got fixed in the new version 7.21.27, we can be able to set the limit in node setting as mustache.max\_output\_size\_bytes: 1024mb.

After setting it to this much size still getting the same exception as

```auto
"type": "size_limit_exceeded_exception",
            "reason": "String [{ \"_source\" : [\"id\",...] has exceeded the size limit [1073741824]

```

The request is quiet long but it should not exceed 1GB of size.

Can you please suggest on this?

Am i missing anything here?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [February 12, 2025, 2:55pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/12 "2025-02-12T14:55:37Z")

</div>

@Arun_Kumar8

First there is no `7.21.27` only `7.17.27` so please check your versions.

> [@Arun\_Kumar8](#):
>
> The request is quiet long but it should not exceed 1GB of size.

Are you sure? How did you validate the length?

@rjernst Sorry to bug you any thoughts? this refers to this...

> <https://github.com/elastic/elasticsearch/pull/119291>
>
> In #114002 the maximum size of a mustache script output was made configurable. H…owever, the setting was not registered. This commit registers the setting so that it can be set in elasticsearch.yml.

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [February 12, 2025, 4:49pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/13 "2025-02-12T16:49:18Z")

</div>

I would verify the length of the script. I will also separately adjust the error message to make clear what length we see.

---

<div class="post-metadata">

**Author:** ![Arun\_Kumar8](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arun_kumar8/32/132827_2.png) [@Arun\_Kumar8](https://discuss.elastic.co/u/Arun_Kumar8)\
**Post date:** [February 12, 2025, 6:24pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/14 "2025-02-12T18:24:58Z")

</div>

Hi Stephen,

My bad, it is 7.17.27.

Tried to calculate the request length via postman API hit, it is coming around 2mb only.

Is there any other setting is required?

the setting should be mustache.max\_output\_size\_bytes: 1024mb or 1024m ?

---

<div class="post-metadata">

**Author:** ![Arun\_Kumar8](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arun_kumar8/32/132827_2.png) [@Arun\_Kumar8](https://discuss.elastic.co/u/Arun_Kumar8)\
**Post date:** [February 18, 2025, 6:05am UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/15 "2025-02-18T06:05:22Z")

</div>

Hi @stephenb

Could you provide any suggestion on this?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [February 18, 2025, 6:59am UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/16 "2025-02-18T06:59:45Z")

</div>

Hi @rjernst any thoughts on this? ^

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [February 18, 2025, 2:41pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/17 "2025-02-18T14:41:35Z")

</div>

Both `m` and `mb` work for megabytes.

I'm not sure why you are seeing ~2mb limit if setting 1024mb. Could you please open an issue in Elasticsearch github?

---

<div class="post-metadata">

**Author:** ![Arun\_Kumar8](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arun_kumar8/32/132827_2.png) [@Arun\_Kumar8](https://discuss.elastic.co/u/Arun_Kumar8)\
**Post date:** [February 19, 2025, 12:18pm UTC](https://discuss.elastic.co/t/unable-to-set-mustache-max-output-size-bytes-in-elasticsearch-yml-version-7-17-25/372412/18 "2025-02-19T12:18:15Z")

</div>

Hi @rjernst,

The 2mb which i mentioned is the request size which i calculated, in elastic log it is showing 1024mb(has exceeded the size limit [1073741824]) in the exception.  
my query is even we set the mustache size to 1024mb, it is still throwing the exception, i tired to increase till 2Gb, but getting same exception.
