{"record":{"id":"98e12b9a848c1362","repo":"apache/seatunnel","slug":"post-sync-cannot-restore-staged-source-while-wa","errorCode":null,"errorMessage":"Post-sync {} cannot restore staged source while waiting for sink target; operation will be retried with staged file intact: source={}, staging={}, checkpointId={}","messagePattern":"Post-sync (.+?) cannot restore staged source while waiting for sink target; operation will be retried with staged file intact: source=(.+?), staging=(.+?), checkpointId=(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/split/ContinuousMultipleTableFileSourceSplitEnumerator.java","lineNumber":1111,"sourceCode":"                op.getSplitId(),\n                maskUriUserInfo(op.getSourcePath()),\n                maskUriUserInfo(stagedPath),\n                checkpointId);\n        return OpCommitResult.STALE_SKIPPED;\n    }\n\n    private OpCommitResult handleRetryableStagedOperation(\n            TableScanContext ctx,\n            FileSourceOperationState op,\n            long checkpointId,\n            String stagedPath,\n            String actionLabel,\n            FileStatus stagedStatus)\n            throws IOException {\n        RestoreStagedFileResult restoreResult =\n                restoreStagedSource(ctx, op, stagedPath, stagedStatus, actionLabel);\n        if (restoreResult == RestoreStagedFileResult.FAILED) {\n            log.warn(\n                    \"Post-sync {} cannot restore staged source while waiting for sink target; \"\n                            + \"operation will be retried with staged file intact: source={}, staging={}, \"\n                            + \"checkpointId={}\",\n                    actionLabel,\n                    maskUriUserInfo(op.getSourcePath()),\n                    maskUriUserInfo(stagedPath),\n                    checkpointId);\n        }\n        return OpCommitResult.FAILED_RETRYABLE;\n    }\n\n    private RestoreStagedFileResult restoreStagedSource(\n            TableScanContext ctx,\n            FileSourceOperationState op,\n            String stagedPath,\n            FileStatus stagedStatus,\n            String actionLabel)\n            throws IOException {","sourceCodeStart":1093,"sourceCodeEnd":1129,"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#L1093-L1129","documentation":"In handleRetryableStagedOperation(), when the sink target is not yet committed, the enumerator restores the staged file back to the source path to avoid hiding data while waiting. This WARN fires when that restore fails; the operation still returns FAILED_RETRYABLE and will be retried with the staged file left intact in staging. It is a degraded but safe state — data exists only under the staging path until a retry succeeds.","triggerScenarios":"isSinkTargetCommitted() returns false (sink target absent or content mismatched) and restoreStagedSource() during the wait returns RestoreStagedFileResult.FAILED for the staged file.","commonSituations":"Slow sink committer keeps the sink target uncommitted for many checkpoints while source-directory permissions block the restore; a writer recreated the source path so the restore rename refuses; transient FS errors during restore; FTP filesystems where the discovery root was moved into staging.","solutions":["Fix the root cause of the restore failure (permissions, pre-existing file at source path) using nearby log details","Check why the sink target is not committing (sink committer logs); the longer the wait, the more restore attempts occur","Verify no other process recreated the source path while the file is staged; remove the duplicate if the staged file is authoritative","Allow the built-in retry to proceed — the staged file is intentionally kept intact; do not delete the staging path manually"],"exampleFix":"null","handlingStrategy":"retry","validationCode":"// Check the source path is clear before attempting a restore:\nif (fs.exists(sourcePath)) {\n    // restore would collide; resolve manually instead of failing repeatedly\n}","typeGuard":null,"tryCatchPattern":"try {\n    restoreStagedToSource(stagedPath, sourcePath);\n} catch (IOException e) {\n    // staged file remains intact; schedule bounded retry, keep monitoring sink commit progress\n}","preventionTips":["Investigate slow sink committers — prolonged waits repeatedly exercise the restore path","Never manually delete staging files while a job is retrying","Ensure only one pipeline writes to a given source path to avoid restore collisions"],"tags":["hadoop","file-source","staging","restore-failed","retryable"],"backgroundTag":"file-write-failed","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"}