{"record":{"id":"a13e1ab6126b7a09","repo":"elastic/elasticsearch","slug":"unrecognized-compile-time-parameter-s","errorCode":null,"errorMessage":"Unrecognized compile-time parameter(s): {}","messagePattern":"Unrecognized compile-time parameter\\(s\\): (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessScriptEngine.java","lineNumber":453,"sourceCode":"            }\n\n            value = copy.remove(CompilerSettings.INITIAL_CALL_SITE_DEPTH);\n            if (value != null) {\n                compilerSettings.setInitialCallSiteDepth(Integer.parseInt(value));\n            }\n\n            value = copy.remove(CompilerSettings.REGEX_ENABLED.getKey());\n            if (value != null) {\n                throw new IllegalArgumentException(\"[painless.regex.enabled] can only be set on node startup.\");\n            }\n\n            value = copy.remove(CompilerSettings.REGEX_LIMIT_FACTOR.getKey());\n            if (value != null) {\n                throw new IllegalArgumentException(\"[painless.regex.limit-factor] can only be set on node startup.\");\n            }\n\n            if (copy.isEmpty() == false) {\n                throw new IllegalArgumentException(\"Unrecognized compile-time parameter(s): \" + copy);\n            }\n        }\n        return compilerSettings;\n    }\n\n    private static ScriptException convertToScriptException(String scriptSource, Throwable t) {\n        // create a script stack: this is just the script portion\n        List<String> scriptStack = new ArrayList<>();\n        ScriptException.Position pos = null;\n        for (StackTraceElement element : t.getStackTrace()) {\n            if (WriterConstants.CLASS_NAME.equals(element.getClassName())) {\n                // found the script portion\n                int originalOffset = element.getLineNumber();\n                if (originalOffset == -1) {\n                    scriptStack.add(\"<<< unknown portion of script >>>\");\n                } else {\n                    int offset = --originalOffset; // offset is 1 based, line numbers must be!\n                    int startOffset = getPreviousStatement(offset);","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/lang-painless/src/main/java/org/elasticsearch/painless/PainlessScriptEngine.java#L435-L471","documentation":"PainlessScriptEngine.buildCompilerSettings throws this IllegalArgumentException when, after stripping all recognized compile-time parameters from the params map, entries remain. Recognized keys are: max_loop_counter, painless.picky, painless.initial_call_site_depth (and the explicitly-rejected regex keys). Any other key is unknown to Painless and indicates a typo, a deprecated parameter, or a parameter belonging to a different scripting language.","triggerScenarios":"Passing script params like {'painless.max_compilations_rate': ...}, {'lang': 'painless'}, or any key not in the recognized set. Mixing Painless params with params meant for mustache or expressions. Typos such as 'painless.pick' instead of 'painless.picky'.","commonSituations":"Copy-pasting settings from docs for a different ES version where parameter names changed. Confusing the script 'params' (runtime variables accessible in the script) with compile-time settings. Using deprecated parameter names after an upgrade.","solutions":["Check the remaining keys in the error message (the 'copy' map is printed) and remove or correct each one.","Ensure only these compile-time keys are used: painless.picky, painless.max_loop_counter, painless.initial_call_site_depth (regex keys are node-only).","Move runtime variables into the script's runtime params (the separate params object), not the compile-time settings map."],"exampleFix":"// before\n{\"source\": \"...\", \"params\": {\"painless.pick\": true}}\n// after\n{\"source\": \"...\", \"params\": {\"painless.picky\": true}}","handlingStrategy":"validation","validationCode":"// Only pass recognized compile-time keys in script params:\n// // Valid: painless.picky, painless.max_loop_counter, painless.initial_call_site_depth\n// // Validate before submitting: ensure no unknown keys remain","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict script params to recognized Painless compile-time keys.","Do not confuse runtime params (script variables) with compile-time settings.","Check parameter names against the ES version's Painless docs after upgrades."],"tags":["painless","elasticsearch","configuration","settings","compile-time","invalid-param"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T11:17:21.771Z"}