{"record":{"id":"6a77bb96381598db","repo":"apache/seatunnel","slug":"file-read-failed","errorCode":"FILE_READ_FAILED","errorMessage":"Read data from this file [%s] failed","messagePattern":"Read data from this file \\[(.+?)\\] failed","errorType":"error_code","errorClass":"FileConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/source/reader/MultipleTableFileSourceReader.java","lineNumber":110,"sourceCode":"                                    + split.getTableId()\n                                    + \"]\");\n                }\n                try {\n                    readStrategy.read(split, output);\n                } catch (Exception e) {\n                    boolean markdownKnowledgeSyncMetadataEnabled =\n                            markdownKnowledgeSyncMetadataTableIds.contains(split.getTableId());\n                    String sourceContext = split.splitId();\n                    Throwable cause = e;\n                    if (markdownKnowledgeSyncMetadataEnabled) {\n                        sourceContext =\n                                MarkdownKnowledgeSyncMetadata.safeSourceContext(\n                                        split.getFilePath());\n                        cause = MarkdownKnowledgeSyncMetadata.copyStackTraceOnly(e);\n                    }\n                    String errorMsg =\n                            String.format(\"Read data from this file [%s] failed\", sourceContext);\n                    throw new FileConnectorException(FILE_READ_FAILED, errorMsg, cause);\n                }\n            }\n        }\n\n        if (split != null) {\n            if (Boundedness.UNBOUNDED.equals(context.getBoundedness())) {\n                ReadStrategy readStrategy = readStrategyMap.get(split.getTableId());\n                SourceEvent event =\n                        new FileSplitFinishedEvent(\n                                split.splitId(),\n                                readStrategy == null\n                                        ? null\n                                        : readStrategy.getLastReadFingerprint());\n                context.sendSourceEventToEnumerator(event);\n            }\n            return;\n        }\n","sourceCodeStart":92,"sourceCodeEnd":128,"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/MultipleTableFileSourceReader.java#L92-L128","documentation":"Wraps any exception thrown while reading a file's data into FILE_READ_FAILED. When pollNext() reads rows from a split and the underlying read strategy throws, the reader reports the source file (via safeSourceContext, falling back to the raw path) and copies the original stack trace as the cause. It is a generic read failure envelope, so diagnose via the cause.","triggerScenarios":"Any exception inside the per-split read loop in pollNext(); e.g. deserialization errors, corrupted files, IO errors, or schema mismatches surfaced by the strategy's read() call.","commonSituations":"Files truncated or corrupted in object storage; permission/IO errors on the underlying filesystem; a record failing schema validation; transient network failure reading from HDFS/S3.","solutions":["Inspect the 'cause' stack trace in the exception to find the root failure (IO, parse, schema).","Verify the file at the path in the message is readable and not truncated (checksum/size check).","Fix the offending record or align the configured schema with the file content.","For transient storage/network errors, enable restart/retry of the job."],"exampleFix":"// before: unreadable file in path\n// after: verify access and file integrity before job\nhdfs dfs -test -e /data/file.json && hdfs dfs -cat /data/file.json | head","handlingStrategy":"try-catch","validationCode":"// precheck file readability before job\nhdfs dfs -test -e <path> && hdfs dfs -cat <path> | head -1","typeGuard":null,"tryCatchPattern":"try { reader.pollNext(); } catch (FileConnectorException e) { if (e.getErrorCode() == FILE_READ_FAILED) { log.error(\"File read failed: {} — root cause:\", e.getMessage(), e.getCause()); } throw e; }","preventionTips":["Always inspect the cause, not the wrapper message","Verify file integrity and permissions before running jobs","Enable job-level restart for transient storage errors","Monitor source directories for truncated or in-flight files"],"tags":["file-source","file-read","io","wrapper-exception"],"backgroundTag":"file-read-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}