apache/seatunnel · error · IllegalArgumentException
Invalid error handler numeric value for
Error message
Invalid error handler numeric value for '%s': %s
What it means
IllegalArgumentException from ErrorHandlerConfigUtil.getLong when a numeric error-handler option (e.g. max_error_records) has a value that is neither a Number nor parseable as a long. The offending key and raw value are included in the message so the bad config entry can be located.
Solutions
- Change the value to a plain integer literal (e.g. 10000, no quotes/commas/units).
- Check the exact key name in the message against your error-handler config block.
- Validate all error-handler numeric options (max_error_records, queue_capacity, etc.) before submitting.
Example fix
// before
error-handler { max_error_records = "10,000" }
// after
error-handler { max_error_records = 10000 } Defensive patterns
Strategy: type-guard
Validate before calling
Object v = config.getValue(key); if (!(v instanceof Number) && !isParsableLong(v)) throw new IllegalArgumentException(key + " must be a plain integer, got " + v);
Type guard
boolean isParsableLong(Object v) { if (v instanceof Number) return true; try { Long.parseLong(String.valueOf(v)); return true; } catch (NumberFormatException e) { return false; } } Try / catch
try { buildStageConfig(stage, global); } catch (IllegalArgumentException e) { if (e.getMessage().contains("Invalid error handler numeric value")) { coerceNumericConfig(); } } Prevention
- Write numeric config values as bare integers with no quotes, commas, or unit suffixes
- Validate all numeric error-handler options before job submission
- Beware HOCON/YAML quoted-string coercion for numeric fields
When it happens
Trigger: Setting a numeric option to a non-numeric string, e.g. max_error_records = "ten" or "1,000", in global or stage error-handler config.
Common situations: Thousands separators or units in numbers ("10,000", "10k"); quoted strings around values where the parser does numeric coercion; YAML/HOCON type surprises.
Related errors
- Invalid endpoint: , expected format host:port
- Invalid endpoint port in endpoint
- Invalid SNMP source OID
- ROUTING_FAILED
- 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/cec47bf7fe787236.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/error/ErrorHandlerConfigUtil.java:198
Map<String, Object> stage,
Map<String, Object> global,
String key,
String defaultValue) {
Object value = stage.getOrDefault(key, global.get(key));
return value == null ? defaultValue : value.toString();
}
private static long getLong(
Map<String, Object> stage, Map<String, Object> global, String key, long defaultValue) {
Object value = stage.getOrDefault(key, global.get(key));
if (value instanceof Number) {
return ((Number) value).longValue();
}
if (value != null) {
try {
return Long.parseLong(value.toString());
} catch (NumberFormatException ignore) {
throw new IllegalArgumentException(
"Invalid error handler numeric value for '" + key + "': " + value, ignore);
}
}
return defaultValue;
}
private static double getDouble(
Map<String, Object> stage,
Map<String, Object> global,
String key,
double defaultValue) {
Object value = stage.getOrDefault(key, global.get(key));
if (value instanceof Number) {
return ((Number) value).doubleValue();
}
if (value != null) {
try {
return Double.parseDouble(value.toString());View on GitHub (pinned to cf67b549a7)