{"record":{"id":"0ea1abe6e4b58472","repo":"apache/seatunnel","slug":"invalid-runtime-field-configuration-skipping","errorCode":null,"errorMessage":"Invalid runtime field configuration: {}, skipping","messagePattern":"Invalid runtime field configuration: (.+?), skipping","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/source/ElasticsearchSource.java","lineNumber":228,"sourceCode":"    /**\n     * Parse runtime fields configuration from list of maps to Elasticsearch runtime_mappings format\n     *\n     * @param runtimeFieldsList List of runtime field configurations\n     * @return Runtime mappings in Elasticsearch format\n     */\n    private Map<String, Object> parseRuntimeFields(List<Map<String, Object>> runtimeFieldsList) {\n        if (runtimeFieldsList == null || runtimeFieldsList.isEmpty()) {\n            return null;\n        }\n\n        Map<String, Object> runtimeMappings = new java.util.LinkedHashMap<>();\n        for (Map<String, Object> fieldConfig : runtimeFieldsList) {\n            String name = (String) fieldConfig.get(\"name\");\n            String type = (String) fieldConfig.get(\"type\");\n            String script = (String) fieldConfig.get(\"script\");\n\n            if (name == null || type == null || script == null) {\n                log.warn(\"Invalid runtime field configuration: {}, skipping\", fieldConfig);\n                continue;\n            }\n\n            Map<String, Object> fieldDef = new java.util.LinkedHashMap<>();\n            fieldDef.put(\"type\", type);\n\n            Map<String, Object> scriptDef = new java.util.LinkedHashMap<>();\n            scriptDef.put(\"source\", script);\n\n            // Optional: script language (default is painless)\n            if (fieldConfig.containsKey(\"script_lang\")) {\n                scriptDef.put(\"lang\", fieldConfig.get(\"script_lang\"));\n            }\n\n            // Optional: script parameters\n            if (fieldConfig.containsKey(\"script_params\")) {\n                scriptDef.put(\"params\", fieldConfig.get(\"script_params\"));\n            }","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/source/ElasticsearchSource.java#L210-L246","documentation":"parseRuntimeFields iterates the runtime_field config entries expecting each to contain 'name', 'type', and 'script' string keys. If any is missing or null, the entry is skipped and this warning is logged; the runtime field is not added to the query.","triggerScenarios":"A runtime_fields entry in the source config missing 'name', 'type', or 'script', or the values being non-strings (e.g. nested maps for script definitions).","commonSituations":"Malformed YAML/HOCON where script is written as an object instead of a string; typo in key names like 'field_name' instead of 'name'.","solutions":["Ensure every runtime field entry has string keys 'name', 'type', and 'script'","If a script needs parameters, inline them into the script source string","Check the logged fieldConfig object to see which key is missing"],"exampleFix":"// before\nruntime_fields = [{\n  name = \"double_age\"\n  script = \"emit(doc['age'].value * 2)\" // missing type\n}]\n// after\nruntime_fields = [{\n  name = \"double_age\"\n  type = \"long\"\n  script = \"emit(doc['age'].value * 2)\"\n}]","handlingStrategy":"validation","validationCode":"// validate runtime fields before job submission\nconfig.getList(\"runtime_fields\").forEach(f -> {\n    if (f.get(\"name\") == null || f.get(\"type\") == null || f.get(\"script\") == null)\n        throw new IllegalArgumentException(\"runtime field needs name, type and script: \" + f);\n});","typeGuard":"java.util.function.Predicate<java.util.Map<String,Object>> validRuntimeField =\n    f -> f.get(\"name\") instanceof String && f.get(\"type\") instanceof String && f.get(\"script\") instanceof String;","tryCatchPattern":null,"preventionTips":["Always include name, type, and script as plain strings in each entry","Inline script parameters into the script source string","Check the warn output to identify malformed entries early"],"tags":["elasticsearch","config","runtime-fields"],"backgroundTag":"schema-validation-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}