{"record":{"id":"e7cff5ce1ffdba27","repo":"apache/seatunnel","slug":"fallback-content-comparison-failed-fallback-to-co","errorCode":null,"errorMessage":"Fallback content comparison failed, fallback to COPY. source={}, target={}","messagePattern":"Fallback content comparison failed, fallback to COPY\\. source=(.+?), target=(.+?)","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/reader/AbstractReadStrategy.java","lineNumber":981,"sourceCode":"                            log.warn(\n                                    \"File checksum is not available, fallback to content comparison. source={}, target={}\",\n                                    maskUriUserInfo(sourceFilePath),\n                                    maskUriUserInfo(targetFilePath),\n                                    checksumException);\n                        }\n                        checksumUnavailableWarned = true;\n                    }\n                    try {\n                        boolean sameContent = fileContentEquals(sourceFilePath, targetFilePath);\n                        if (sameContent) {\n                            logUpdateModeSkip(\n                                    sourceFilePath,\n                                    targetFilePath,\n                                    \"strict checksum: content equal (checksum unavailable)\");\n                        }\n                        return !sameContent;\n                    } catch (Exception e) {\n                        log.warn(\n                                \"Fallback content comparison failed, fallback to COPY. source={}, target={}\",\n                                maskUriUserInfo(sourceFilePath),\n                                maskUriUserInfo(targetFilePath),\n                                e);\n                        return true;\n                    }\n                }\n                if (checksumEquals(sourceChecksum, targetChecksum)) {\n                    logUpdateModeSkip(\n                            sourceFilePath, targetFilePath, \"strict checksum: checksum equal\");\n                    return false;\n                }\n                return true;\n            }\n        }\n\n        return true;\n    }","sourceCodeStart":963,"sourceCodeEnd":999,"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/reader/AbstractReadStrategy.java#L963-L999","documentation":"Warning logged when even the fallback content comparison (byte-stream equality check after checksums were unavailable) throws an Exception. To stay safe, the reader returns true (files treated as different) and falls back to performing a full COPY of the file.","triggerScenarios":"During strict checksum sync mode: checksums unavailable → content comparison via stream reading fails — read permission errors, file deleted/modified mid-comparison, or network I/O errors while streaming either file.","commonSituations":"Files being rewritten concurrently by another writer during sync; missing read permissions on target; transient HDFS/S3 read failures; very large files timing out mid-stream.","solutions":["Check the logged exception; fix the underlying read problem (permissions, connectivity, concurrent writes).","Re-run the sync job — the fallback already re-copied the file, so subsequent runs may compare cleanly.","Avoid mutating source files while a sync job is running (freeze writes or snapshot first).","If content comparison keeps failing on large files, disable strict checksum mode to skip the comparison path."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-check readability of both files before comparison\nfs.open(srcPath).close();\ntargetFs.open(dstPath).close();","typeGuard":null,"tryCatchPattern":"try {\n    boolean same = contentEquals(src, dst);\n    return !same;\n} catch (Exception e) {\n    log.warn(\"content comparison failed, copying anyway\", e);\n    return true; // safe default: full copy\n}","preventionTips":["Ensure read permissions on both source and target before sync.","Avoid concurrent writes to files being compared.","Re-run sync after a comparison failure — the fallback copy already re-synchronized the file."],"tags":["file-sync","io","fallback","copy"],"backgroundTag":"checksum-mismatch","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"}