{"record":{"id":"07aa8e236eb480eb","repo":"apache/seatunnel","slug":"failed-to-parse-file-modified-date-format-yyyy-mm-07aa8e","errorCode":null,"errorMessage":"Failed to parse file modified date format: yyyy-MM-dd HH:mm:ss, please check file_filter_modified_start or file_filter_modified_end format.","messagePattern":"Failed to parse file modified date format: yyyy-MM-dd HH:mm:ss, please check file_filter_modified_start or file_filter_modified_end format\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/ContinuousMultipleTableFileSourceSplitEnumerator.java","lineNumber":2014,"sourceCode":"        @Override\n        public void close() throws IOException {\n            if (!shareTargetFs && targetFs != null) {\n                targetFs.close();\n            }\n            if (sourceFs != null) {\n                sourceFs.close();\n            }\n        }\n\n        private static Date parseModifiedDate(String modifiedDate) {\n            if (modifiedDate == null) {\n                return null;\n            }\n            SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n            try {\n                return dateFormat.parse(modifiedDate);\n            } catch (ParseException e) {\n                throw new IllegalArgumentException(\n                        \"Failed to parse file modified date format: yyyy-MM-dd HH:mm:ss, please check file_filter_modified_start or file_filter_modified_end format.\");\n            }\n        }\n    }\n\n    private static HadoopConf buildTargetHadoopConf(\n            HadoopConf sourceConf, String targetPath, Map<String, String> targetHadoopConf) {\n        Map<String, String> extraOptions =\n                targetHadoopConf == null\n                        ? new LinkedHashMap<>()\n                        : new LinkedHashMap<>(targetHadoopConf);\n\n        String fsDefaultNameKey = sourceConf.getFsDefaultNameKey();\n        String targetDefaultFs = extraOptions.remove(fsDefaultNameKey);\n\n        if (StringUtils.isBlank(targetDefaultFs)) {\n            targetDefaultFs = tryDeriveDefaultFsFromPath(targetPath);\n        }","sourceCodeStart":1996,"sourceCodeEnd":2032,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/ContinuousMultipleTableFileSourceSplitEnumerator.java#L1996-L2032","documentation":"File modified-time filtering (file_filter_modified_start / file_filter_modified_end) accepts dates only in the fixed pattern 'yyyy-MM-dd HH:mm:ss'. When SimpleDateFormat cannot parse the supplied string, the enumerator throws an IllegalArgumentException with this message. There is no lenient alternate format; the value must match the pattern exactly.","triggerScenarios":"A user supplies file_filter_modified_start or file_filter_modified_end in a different format, e.g. '2024-01-01', ISO-8601 '2024-01-01T00:00:00', '01/01/2024', or with timezone suffixes; dateFormat.parse throws ParseException and is wrapped in IllegalArgumentException.","commonSituations":"Using dates copied from log files or JSON APIs (ISO format); forgetting the time component; locale-dependent date strings; typos like two-digit years or wrong separators.","solutions":["Rewrite the filter values as 'yyyy-MM-dd HH:mm:ss', e.g. '2024-01-01 00:00:00'.","If converting from ISO-8601, drop the 'T' and trailing timezone: '2024-01-01T00:00:00Z' -> '2024-01-01 00:00:00'.","Validate the string with SimpleDateFormat in a quick local test before running the job.","Keep both start and end in the same exact format."],"exampleFix":"// before\nfile_filter_modified_start = \"2024-01-01T00:00:00Z\"\n// after\nfile_filter_modified_start = \"2024-01-01 00:00:00\"","handlingStrategy":"validation","validationCode":"new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").parse(fileFilterModifiedStart); // throws if invalid","typeGuard":"boolean isValidModifiedDate(String s) { try { new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").parse(s); return true; } catch (ParseException e) { return false; } }","tryCatchPattern":"try { dateFormat.parse(value); } catch (ParseException e) { throw new IllegalArgumentException(\"file_filter_modified_* must use yyyy-MM-dd HH:mm:ss\", e); }","preventionTips":["Always write filter dates as 'yyyy-MM-dd HH:mm:ss'.","Convert ISO-8601 inputs before placing them in config.","Validate date options with a parser before job submission.","Keep start and end in identical format."],"tags":["config","date-parsing","file-filter","format"],"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-14T05:17:10.506Z"}