{"record":{"id":"87635354d542e175","repo":"apache/seatunnel","slug":"retention-delete-failed-file-expirebefore","errorCode":null,"errorMessage":"Retention delete failed: file={}, expireBefore={}","messagePattern":"Retention delete failed: file=(.+?), expireBefore=(.+?)","errorType":"console","errorClass":null,"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":1261,"sourceCode":"                continue;\n            }\n            if (!status.isFile()) {\n                continue;\n            }\n            if (!BACKUP_VERSION_SUFFIX_PATTERN.matcher(status.getPath().getName()).matches()) {\n                continue;\n            }\n            if (resolveBackupCreatedTimeMillis(status) > expireBefore) {\n                continue;\n            }\n            try {\n                fs.deleteFile(status.getPath().toString());\n                result.deletedFiles++;\n                incCounter(retentionDeletedCounter);\n            } catch (Exception e) {\n                result.failedOperations++;\n                incCounter(retentionFailedCounter);\n                log.warn(\n                        \"Retention delete failed: file={}, expireBefore={}\",\n                        maskUriUserInfo(status.getPath().toString()),\n                        expireBefore,\n                        e);\n            }\n        }\n    }\n\n    private long resolveBackupCreatedTimeMillis(FileStatus status) {\n        java.util.regex.Matcher matcher =\n                BACKUP_VERSION_SUFFIX_PATTERN.matcher(status.getPath().getName());\n        if (matcher.matches() && matcher.group(3) != null) {\n            try {\n                return Long.parseLong(matcher.group(3));\n            } catch (NumberFormatException ignored) {\n                // Fall through to filesystem mtime for malformed legacy file names.\n            }\n        }","sourceCodeStart":1243,"sourceCodeEnd":1279,"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#L1243-L1279","documentation":"Logged by ContinuousMultipleTableFileSourceSplitEnumerator during per-file retention cleanup when deleting an expired backup version file fails. The file is counted as a failed operation and skipped; the scan continues instead of aborting.","triggerScenarios":"Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/ContinuousMultipleTableFileSourceSplitEnumerator.java:1261 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check filesystem permissions on the backup files","Verify files still exist / are not locked by other processes","Retry on the next retention scan cycle; investigate recurring failures"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}