{"record":{"id":"2e8fd2d159c11019","repo":"apache/seatunnel","slug":"common-error-code-14","errorCode":"COMMON_ERROR_CODE-14","errorMessage":"Create orc reader for this file [%s] failed","messagePattern":"Create orc reader for this file \\[(.+?)\\] failed","errorType":"exception","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/OrcReadStrategy.java","lineNumber":202,"sourceCode":"                    throw new FileConnectorException(\n                            CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED,\n                            String.format(\n                                    \"Column [%s] does not exists in table schema [%s]\",\n                                    readColumns.get(i), String.join(\",\", fieldNames)));\n                }\n                types[i] =\n                        orcDataType2SeaTunnelDataType(\n                                schema.getChildren().get(index),\n                                configRowType != null && configRowType.getTotalFields() > i\n                                        ? configRowType.getFieldType(i)\n                                        : null);\n            }\n            seaTunnelRowType = new SeaTunnelRowType(fields, types);\n            seaTunnelRowTypeWithPartition = mergePartitionTypes(path, seaTunnelRowType);\n            return getActualSeaTunnelRowTypeInfo();\n        } catch (IOException e) {\n            String errorMsg = String.format(\"Create orc reader for this file [%s] failed\", path);\n            throw new FileConnectorException(\n                    CommonErrorCodeDeprecated.READER_OPERATION_FAILED, errorMsg, e);\n        }\n    }\n\n    @Override\n    boolean checkFileType(String path) {\n        try {\n            boolean checkResult;\n            FSDataInputStream in = hadoopFileSystemProxy.getInputStream(path);\n            // try to get Postscript in orc file\n            long size = hadoopFileSystemProxy.getFileStatus(path).getLen();\n            int readSize = (int) Math.min(size, MIN_SIZE);\n            in.seek(size - readSize);\n            ByteBuffer buffer = ByteBuffer.allocate(readSize);\n            in.readFully(\n                    buffer.array(), buffer.arrayOffset() + buffer.position(), buffer.remaining());\n            int psLen = buffer.get(readSize - 1) & 0xff;\n            int len = OrcFile.MAGIC.length();","sourceCodeStart":184,"sourceCodeEnd":220,"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/OrcReadStrategy.java#L184-L220","documentation":"While building the row type for an ORC file, opening the ORC Reader itself threw an IOException; it is rewrapped as READER_OPERATION_FAILED ('Create orc reader for this file [%s] failed'). This happens during schema inference / type resolution before any rows are read, so the file could not even be opened as ORC.","triggerScenarios":"getSeaTunnelRowTypeInfoWithUserConfigRowType() constructing the ORC Reader for path; IOException from the underlying ORC library (file not found, unreadable, corrupt footer, unsupported filesystem).","commonSituations":"Wrong path or file deleted between split enumeration and read; missing Hadoop/S3 credentials for the filesystem; corrupt or truncated ORC file with unreadable footer; permission denied on the file.","solutions":["Check the cause stack trace for the underlying IOException (path not found, auth, corruption).","Verify the file path exists and is accessible from the job's runtime environment.","Validate the ORC file footer with orc-tools (orcmeta/orcfiledump).","Confirm filesystem credentials/config (e.g. S3/HDFS) are present in the job environment."],"exampleFix":"// before: path typo\npath = \"/data/events.orc\" // file actually at /data/event.orc\n// after\npath = \"/data/event.orc\"","handlingStrategy":"try-catch","validationCode":"// verify the file opens as ORC before job submission\norc-tools meta /path/file.orc > /dev/null && echo ok","typeGuard":null,"tryCatchPattern":"try { rowType = strategy.getSeaTunnelRowTypeInfo(path); } catch (FileConnectorException e) { if (e.getMessage().startsWith(\"Create orc reader\")) { log.error(\"Cannot open ORC file {} due to:\", path, e.getCause()); } throw e; }","preventionTips":["Confirm paths and credentials before running the job","Validate ORC footers with orc-tools after each upstream write","Watch for files deleted between enumeration and read","Ensure Hadoop/S3 configs are present in the runtime classpath"],"tags":["orc","file-open","io","schema-inference"],"backgroundTag":"file-open-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"}