apache/seatunnel · error · IllegalArgumentException

Param [ ] is not set in error message [ ]

Error message

Param [%s] is not set in error message [%s]

What it means

SeaTunnelErrorCode descriptions are templates with named placeholders (e.g. {key}). ExceptionParamsUtil.assertParamsMatchWithDescription verifies that every placeholder in the template is present in the supplied params map, throwing IllegalArgumentException if any placeholder is missing — i.e. the error message would render with an unfilled parameter.

Solutions

  1. Add the missing key to the params map with the intended value
  2. Fix the param key spelling so it matches the placeholder exactly (placeholders are the {name} tokens extracted from the template)
  3. If the param is genuinely unnecessary, edit the error-code description template to remove the placeholder

Example fix

// before
throw new SeaTunnelException(SEATUNNEL_ERROR_0001, Collections.emptyMap()); // missing {table}
// after
throw new SeaTunnelException(SEATUNNEL_ERROR_0001, Collections.singletonMap("table", tableName));
Defensive patterns

Strategy: validation

Validate before calling

Set<String> required = ExceptionParamsUtil.getParams(descriptionTemplate);
if (!params.keySet().containsAll(required)) throw new IllegalArgumentException("missing: " + new HashSet<>(required).removeAll(params.keySet()));

Try / catch

try { return new SeaTunnelException(code, params); } catch (IllegalArgumentException e) { log.error("error params incomplete for {}: {}", code, e.getMessage()); throw e; }

Prevention

When it happens

Trigger: Building a SeaTunnelException/SeaTunnelSqlException whose error-code description contains a {param} placeholder that is absent from the params map passed alongside it.

Common situations: Adding a new placeholder to an error-code description without updating every throw site; misspelling a param key so it does not match the placeholder; passing an empty map to an error code that requires parameters.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/fbfe9e3f4747fdaf. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-common/src/main/java/org/apache/seatunnel/common/exception/ExceptionParamsUtil.java:64

    }

    public static String getDescription(String descriptionTemplate, Map<String, String> params) {
        assertParamsMatchWithDescription(descriptionTemplate, params);
        String description = descriptionTemplate;
        for (String param : getParams(descriptionTemplate)) {
            String value = params.get(param);
            description = description.replace(String.format("<%s>", param), value);
        }
        return description;
    }

    public static void assertParamsMatchWithDescription(
            String descriptionTemplate, Map<String, String> params) {
        getParams(descriptionTemplate)
                .forEach(
                        param -> {
                            if (!params.containsKey(param)) {
                                throw new IllegalArgumentException(
                                        String.format(
                                                "Param [%s] is not set in error message [%s]",
                                                param, descriptionTemplate));
                            }
                        });
    }
}

View on GitHub (pinned to cf67b549a7)