{"record":{"id":"cec47bf7fe787236","repo":"apache/seatunnel","slug":"invalid-error-handler-numeric-value-for-s-s","errorCode":null,"errorMessage":"Invalid error handler numeric value for '%s': %s","messagePattern":"Invalid error handler numeric value for '(.+?)': (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/error/ErrorHandlerConfigUtil.java","lineNumber":198,"sourceCode":"            Map<String, Object> stage,\n            Map<String, Object> global,\n            String key,\n            String defaultValue) {\n        Object value = stage.getOrDefault(key, global.get(key));\n        return value == null ? defaultValue : value.toString();\n    }\n\n    private static long getLong(\n            Map<String, Object> stage, Map<String, Object> global, String key, long defaultValue) {\n        Object value = stage.getOrDefault(key, global.get(key));\n        if (value instanceof Number) {\n            return ((Number) value).longValue();\n        }\n        if (value != null) {\n            try {\n                return Long.parseLong(value.toString());\n            } catch (NumberFormatException ignore) {\n                throw new IllegalArgumentException(\n                        \"Invalid error handler numeric value for '\" + key + \"': \" + value, ignore);\n            }\n        }\n        return defaultValue;\n    }\n\n    private static double getDouble(\n            Map<String, Object> stage,\n            Map<String, Object> global,\n            String key,\n            double defaultValue) {\n        Object value = stage.getOrDefault(key, global.get(key));\n        if (value instanceof Number) {\n            return ((Number) value).doubleValue();\n        }\n        if (value != null) {\n            try {\n                return Double.parseDouble(value.toString());","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/task/error/ErrorHandlerConfigUtil.java#L180-L216","documentation":"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.","triggerScenarios":"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.","commonSituations":"Thousands separators or units in numbers (\"10,000\", \"10k\"); quoted strings around values where the parser does numeric coercion; YAML/HOCON type surprises.","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."],"exampleFix":"// before\nerror-handler { max_error_records = \"10,000\" }\n// after\nerror-handler { max_error_records = 10000 }","handlingStrategy":"type-guard","validationCode":"Object v = config.getValue(key);\nif (!(v instanceof Number) && !isParsableLong(v)) throw new IllegalArgumentException(key + \" must be a plain integer, got \" + v);","typeGuard":"boolean isParsableLong(Object v) { if (v instanceof Number) return true; try { Long.parseLong(String.valueOf(v)); return true; } catch (NumberFormatException e) { return false; } }","tryCatchPattern":"try { buildStageConfig(stage, global); } catch (IllegalArgumentException e) { if (e.getMessage().contains(\"Invalid error handler numeric value\")) { coerceNumericConfig(); } }","preventionTips":["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"],"tags":["config","type-error","parsing"],"backgroundTag":"config-type-mismatch","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"}