# Strange error message. To many dynamic script

**URL:** <https://discuss.elastic.co/t/strange-error-message-to-many-dynamic-script/207730>\
**Category:** Elasticsearch\
**Created:** [November 13, 2019, 3:38pm UTC](https://discuss.elastic.co/t/strange-error-message-to-many-dynamic-script/207730 "2019-11-13T15:38:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![iukea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iukea/32/49083_2.png) [@iukea](https://discuss.elastic.co/u/iukea)\
**Post date:** [November 13, 2019, 3:38pm UTC](https://discuss.elastic.co/t/strange-error-message-to-many-dynamic-script/207730/1 "2019-11-13T15:38:34Z")

</div>

Hello, guys, I am using the Palo Alto and Cisco ASA module in file beats and I suddenly started getting the following error message.

> error.message [script] Too many dynamic script compilations within, max: [100/1m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max\_compilations\_rate] setting

Any recommendations? Also suddenly none of my visualizations work anymore.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/f/2fc5695b3d42c215c695bed45ad4e12f530cb173.png)

---

<div class="post-metadata">

**Author:** ![iukea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iukea/32/49083_2.png) [@iukea](https://discuss.elastic.co/u/iukea)\
**Post date:** [November 13, 2019, 3:40pm UTC](https://discuss.elastic.co/t/strange-error-message-to-many-dynamic-script/207730/2 "2019-11-13T15:40:30Z")

</div>

The logs from the kibana

`message":"Failed to poll for work: [circuit_breaking_exception] [script] Too many dynamic script compilations within, max: [100/1m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting, with { bytes_wanted=0 & bytes_limit=0 & durability=\"TRANSIENT\" } :: {\"path\":\"/.kibana_task_manager/_search\",\"query\":{\"ignore_unavailable\":true},\"body\":\"{\\\"query\\\":{\\\"bool\\\":{\\\"must\\\":[{\\\"term\\\":{\\\"type\\\":\\\"task\\\"}},{\\\"bool\\\":{\\\"must\\\":[{\\\"bool\\\":{\\\"should\\\":[{\\\"bool\\\":{\\\"must\\\":[{\\\"term\\\":{\\\"task.status\\\":\\\"idle\\\"}},{\\\"range\\\":{\\\"task.runAt\\\":{\\\"lte\\\":\\\"now\\\"}}}]}},{\\\"bool\\\":{\\\"must\\\":[{\\\"term\\\":{\\\"task.status\\\":\\\"running\\\"}},{\\\"range\\\":{\\\"task.retryAt\\\":{\\\"lte\\\":\\\"now\\\"}}}]}}]}},{\\\"bool\\\":{\\\"should\\\":[{\\\"exists\\\":{\\\"field\\\":\\\"task.interval\\\"}},{\\\"bool\\\":{\\\"must\\\":[{\\\"term\\\":{\\\"task.taskType\\\":\\\"maps_telemetry\\\"}},{\\\"range\\\":{\\\"task.attempts\\\":{\\\"lt\\\":3}}}]}},{\\\"bool\\\":{\\\"must\\\":[{\\\"term\\\":{\\\"task.taskType\\\":\\\"vis_telemetry\\\"}},{\\\"range\\\":{\\\"task.attempts\\\":{\\\"lt\\\":3}}}]}}]}}]}}]}},\\\"size\\\":10,\\\"sort\\\":{\\\"_script\\\":{\\\"type\\\":\\\"number\\\",\\\"order\\\":\\\"asc\\\",\\\"script\\\":{\\\"lang\\\":\\\"expression\\\",\\\"source\\\":\\\"doc['task.retryAt'].value || doc['task.runAt'].value\\\"}}},\\\"seq_no_primary_term\\\":true}\",\"statusCode\":500,\"response\":\"{\\\"error\\\":{\\\"root_cause\\\":[{\\\"type\\\":\\\"circuit_breaking_exception\\\",\\\"reason\\\":\\\"[script] Too many dynamic script compilations within, max: [100/1m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting\\\",\\\"bytes_wanted\\\":0,\\\"bytes_limit\\\":0,\\\"durability\\\":\\\"TRANSIENT\\\"}],\\\"type\\\":\\\"search_phase_execution_exception\\\",\\\"reason\\\":\\\"all shards failed\\\",\\\"phase\\\":\\\"query\\\",\\\"grouped\\\":true,\\\"failed_shards\\\":[{\\\"shard\\\":0,\\\"index\\\":\\\".kibana_task_manager_1\\\",\\\"node\\\":\\\"NE2b-0XkQSCcAQprVycfoQ\\\",\\\"reason\\\":{\\\"type\\\":\\\"general_script_exception\\\",\\\"reason\\\":\\\"Failed to compile inline script [doc['task.retryAt'].value || doc['task.runAt'].value] using lang [expression]\\\",\\\"caused_by\\\":{\\\"type\\\":\\\"circuit_breaking_exception\\\",\\\"reason\\\":\\\"[script] Too many dynamic script compilations within, max: [100/1m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting\\\",\\\"bytes_wanted\\\":0,\\\"bytes_limit\\\":0,\\\"durability\\\":\\\"TRANSIENT\\\"}}}],\\\"caused_by\\\":{\\\"type\\\":\\\"circuit_breaking_exception\\\",\\\"reason\\\":\\\"[script] Too many dynamic script compilations within, max: [100/1m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting\\\",\\\"bytes_wanted\\\":0,\\\"bytes_limit\\\":0,\\\"durability\\\":\\\"TRANSIENT\\\"}},\\\"status\\\":500}\"}"}`

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [November 14, 2019, 9:02am UTC](https://discuss.elastic.co/t/strange-error-message-to-many-dynamic-script/207730/3 "2019-11-14T09:02:06Z")

</div>

The issue is that elasticsearch servers are rejecting requests to prevent overload caused by excessive compilation of user scripts.  
I'm not sure where the scripts come from but that is what elasticsearch is objecting to.

---

<div class="post-metadata">

**Author:** ![iukea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iukea/32/49083_2.png) [@iukea](https://discuss.elastic.co/u/iukea)\
**Post date:** [November 14, 2019, 5:56pm UTC](https://discuss.elastic.co/t/strange-error-message-to-many-dynamic-script/207730/5 "2019-11-14T17:56:25Z")

</div>

Is there a way to increase the scripts limit?  
Would that help?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [November 14, 2019, 8:09pm UTC](https://discuss.elastic.co/t/strange-error-message-to-many-dynamic-script/207730/6 "2019-11-14T20:09:54Z")

</div>

Yes, the relevant [setting](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting-using.html) is mentioned in the error message.  
The error message also warns about the cost of excessive compilations and how to avoid that by using parameters with your scripts

---

<div class="post-metadata">

**Author:** ![iukea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iukea/32/49083_2.png) [@iukea](https://discuss.elastic.co/u/iukea)\
**Post date:** [November 15, 2019, 9:49pm UTC](https://discuss.elastic.co/t/strange-error-message-to-many-dynamic-script/207730/7 "2019-11-15T21:49:29Z")

</div>

Eh the documentation isn't very helpful.

Getting this error from one of Filebeats modules (the Palo Alto one)

---

<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:** [December 13, 2019, 9:49pm UTC](https://discuss.elastic.co/t/strange-error-message-to-many-dynamic-script/207730/8 "2019-12-13T21:49:32Z")

</div>

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