Can someone please explain to me the next error ?
"error": {
"type": "illegal_argument_exception",
"reason": "failed to execute script",
"caused_by": {
"type": "general_script_exception",
"reason": "Failed to compile stored script [simple-test-script] using lang [painless]",
"caused_by": {
"type": "circuit_breaking_exception",
"reason": "[script] Too many dynamic script compilations within, max: [1/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.context.update.max_compilations_rate] setting",
"bytes_wanted": 0,
"bytes_limit": 0,
"durability": "TRANSIENT"
}
}
}
To reproduce it you can easily follow the next steps on Elastic Cloud:
PUT _cluster/settings
{
"persistent": {
"script.context.update.max_compilations_rate": "1/5m"
}
}
PUT /_scripts/simple-test-script
{
"script": {
"lang": "painless",
"source": """
ctx._source['test_field'] = 'test value'
"""
}
}
PUT /test-index
POST /test-index/_bulk
{"update":{"_id":"1"}}
{"script":{"id": "simple-test-script"}, "upsert": {}, "scripted_upsert": true}
{"update":{"_id":"2"}}
{"script":{"id": "simple-test-script"}, "upsert": {}, "scripted_upsert": true}
Why does simple-test-script dynamic at this point ? And what does dynamic mean in this situation ?