{"record":{"id":"2f239cb82b50bf52","repo":"apache/seatunnel","slug":"invalid-error-handler-boolean-value-for-s-s","errorCode":null,"errorMessage":"Invalid error handler boolean value for '%s': %s","messagePattern":"Invalid error handler boolean 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":242,"sourceCode":"\n    private static boolean getBoolean(\n            Map<String, Object> stage,\n            Map<String, Object> global,\n            String key,\n            boolean defaultValue) {\n        Object value = stage.getOrDefault(key, global.get(key));\n        if (value instanceof Boolean) {\n            return (Boolean) value;\n        }\n        if (value != null) {\n            String booleanValue = value.toString().trim();\n            if (\"true\".equalsIgnoreCase(booleanValue)) {\n                return true;\n            }\n            if (\"false\".equalsIgnoreCase(booleanValue)) {\n                return false;\n            }\n            throw new IllegalArgumentException(\n                    \"Invalid error handler boolean value for '\" + key + \"': \" + value);\n        }\n        return defaultValue;\n    }\n\n    private static int getNonNegativeInt(\n            Map<String, Object> stage, Map<String, Object> global, String key, int defaultValue) {\n        long value = getLong(stage, global, key, defaultValue);\n        if (value < 0 || value > Integer.MAX_VALUE) {\n            throw new IllegalArgumentException(\n                    \"error handler \"\n                            + key\n                            + \" must be between 0 and \"\n                            + Integer.MAX_VALUE\n                            + \", but was \"\n                            + value);\n        }\n        return (int) value;","sourceCodeStart":224,"sourceCodeEnd":260,"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#L224-L260","documentation":"ErrorHandlerConfigUtil.getBoolean parses an error-handler option as a boolean. Only exact 'true' or 'false' (case-insensitive) are accepted; any other string throws IllegalArgumentException naming the key and offending value. This prevents ambiguous truthy values in error-handler configuration.","triggerScenarios":"Calling getBoolean (via includeStacktrace or includeOriginalData) with values like 'yes', '1', 'on', 'TRUE ' with trailing whitespace is fine only for case, but 'yes'/'1'/'on' throw.","commonSituations":"Users coming from YAML/JSON habits set 'include-stacktrace: yes' or 'includeOriginalData = 1', both of which are rejected.","solutions":["Change the value to literal 'true' or 'false' (any letter case).","Strip surrounding whitespace/quotes from the value in the config file.","If generating config programmatically, convert language-native booleans to 'true'/'false' strings before inserting."],"exampleFix":"// before\nincludeStacktrace = \"yes\"\n// after\nincludeStacktrace = \"true\"","handlingStrategy":"validation","validationCode":"Object v = cfg.get(\"includeStacktrace\");\nif (v != null && !(v instanceof Boolean)\n        && !\"true\".equalsIgnoreCase(v.toString())\n        && !\"false\".equalsIgnoreCase(v.toString())) {\n    throw new IllegalArgumentException(\"includeStacktrace must be true/false, got: \" + v);\n}","typeGuard":"boolean isValidBoolean(Object v) {\n    return v instanceof Boolean\n        || (v != null && (\"true\".equalsIgnoreCase(v.toString()) || \"false\".equalsIgnoreCase(v.toString())));\n}","tryCatchPattern":"try {\n    boolean b = ErrorHandlerConfigUtil.includeStacktrace(...);\n} catch (IllegalArgumentException e) {\n    log.error(\"Bad boolean config: {}\", e.getMessage());\n}","preventionTips":["Only use literal true/false for boolean options","Avoid YAML-style 'yes'/'no' or numeric 0/1","Trim whitespace and quotes around values"],"tags":["config","boolean","error-handler"],"backgroundTag":"invalid-config-value","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"}