{"record":{"id":"892fc4b00c7a80ce","repo":"apache/seatunnel","slug":"illegal-format-s","errorCode":null,"errorMessage":"Illegal format [%s]","messagePattern":"Illegal format \\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-common/src/main/java/org/apache/seatunnel/common/utils/DateTimeUtils.java","lineNumber":371,"sourceCode":"        private final String value;\n\n        Formatter(String value) {\n            this.value = value;\n        }\n\n        public String getValue() {\n            return value;\n        }\n\n        public static Formatter parse(String format) {\n            Formatter[] formatters = Formatter.values();\n            for (Formatter formatter : formatters) {\n                if (formatter.getValue().equals(format)) {\n                    return formatter;\n                }\n            }\n            String errorMsg = String.format(\"Illegal format [%s]\", format);\n            throw new IllegalArgumentException(errorMsg);\n        }\n    }\n}\n","sourceCodeStart":353,"sourceCodeEnd":375,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-common/src/main/java/org/apache/seatunnel/common/utils/DateTimeUtils.java#L353-L375","documentation":"DateTimeUtils.parse resolves a Formatter enum by exact match against the user-supplied date-time format string. If the format does not correspond to any supported formatter, it throws IllegalArgumentException 'Illegal format [x]'.","triggerScenarios":"Calling DateTimeUtils.parse(value, format) with a format string that is not one of the enumerated supported values (e.g. an unsupported pattern instead of 'yyyy-MM-dd HH:mm:ss').","commonSituations":"Sink/source config uses a datetime_format pattern the parser does not recognize; copied a Java SimpleDateFormat pattern that is not in the Formatter enum; typo or different casing in the configured format.","solutions":["Use one of the supported formats listed by DateTimeUtils.Formatter enum values","Check exact spelling/casing of the configured format string","If a new pattern is required, add a Formatter enum entry for it and submit/patch the code"],"exampleFix":"// before\ndatetime_format = \"dd/MM/yyyy HH:mm\" // unsupported\n// after\ndatetime_format = \"yyyy-MM-dd HH:mm:ss\"","handlingStrategy":"validation","validationCode":"boolean ok = Arrays.stream(DateTimeUtils.Formatter.values()).anyMatch(f -> f.getValue().equals(userFormat));","typeGuard":null,"tryCatchPattern":"try { return DateTimeUtils.parse(value, format); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(\"Unsupported datetime_format: \" + format, e); }","preventionTips":["Copy supported format strings from the Formatter enum, not arbitrary patterns","Validate datetime_format in connector option parsing","Write a config-validation test covering each supported format"],"tags":["datetime","format-parsing","argument-validation"],"backgroundTag":"invalid-date-format","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"}