apache/seatunnel · warning
Invalid runtime field configuration
Error message
Invalid runtime field configuration: {}, skipping What it means
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.
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
Example fix
// before
runtime_fields = [{
name = "double_age"
script = "emit(doc['age'].value * 2)" // missing type
}]
// after
runtime_fields = [{
name = "double_age"
type = "long"
script = "emit(doc['age'].value * 2)"
}] Defensive patterns
Strategy: validation
Validate before calling
// validate runtime fields before job submission
config.getList("runtime_fields").forEach(f -> {
if (f.get("name") == null || f.get("type") == null || f.get("script") == null)
throw new IllegalArgumentException("runtime field needs name, type and script: " + f);
}); Type guard
java.util.function.Predicate<java.util.Map<String,Object>> validRuntimeField =
f -> f.get("name") instanceof String && f.get("type") instanceof String && f.get("script") instanceof String; Prevention
- 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
When it happens
Trigger: 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).
Common situations: Malformed YAML/HOCON where script is written as an object instead of a string; typo in key names like 'field_name' instead of 'name'.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Elasticsearch Source config warn: when both 'index' and…
- SQL search_type does not support slicing. slice_max will be…
- SQL search_type does not support slicing. slice_max will be…
- The schema config in ElasticSearch source/sink is…
- accessId and accesskey must be provided when sts_token is…
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/0ea1abe6e4b58472.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/source/ElasticsearchSource.java:228
/**
* Parse runtime fields configuration from list of maps to Elasticsearch runtime_mappings format
*
* @param runtimeFieldsList List of runtime field configurations
* @return Runtime mappings in Elasticsearch format
*/
private Map<String, Object> parseRuntimeFields(List<Map<String, Object>> runtimeFieldsList) {
if (runtimeFieldsList == null || runtimeFieldsList.isEmpty()) {
return null;
}
Map<String, Object> runtimeMappings = new java.util.LinkedHashMap<>();
for (Map<String, Object> fieldConfig : runtimeFieldsList) {
String name = (String) fieldConfig.get("name");
String type = (String) fieldConfig.get("type");
String script = (String) fieldConfig.get("script");
if (name == null || type == null || script == null) {
log.warn("Invalid runtime field configuration: {}, skipping", fieldConfig);
continue;
}
Map<String, Object> fieldDef = new java.util.LinkedHashMap<>();
fieldDef.put("type", type);
Map<String, Object> scriptDef = new java.util.LinkedHashMap<>();
scriptDef.put("source", script);
// Optional: script language (default is painless)
if (fieldConfig.containsKey("script_lang")) {
scriptDef.put("lang", fieldConfig.get("script_lang"));
}
// Optional: script parameters
if (fieldConfig.containsKey("script_params")) {
scriptDef.put("params", fieldConfig.get("script_params"));
}View on GitHub (pinned to cf67b549a7)