{"record":{"id":"f3a2d790cf01b5ed","repo":"apache/flink","slug":"error-opening-the-input-split","errorCode":null,"errorMessage":"Error opening the Input Split {} [{},{}]: {}","messagePattern":"Error opening the Input Split (.+?) \\[(.+?),(.+?)\\]: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"flink-core/src/main/java/org/apache/flink/api/common/io/FileInputFormat.java","lineNumber":818,"sourceCode":"            LOG.debug(\n                    \"Opening input split \"\n                            + fileSplit.getPath()\n                            + \" [\"\n                            + this.splitStart\n                            + \",\"\n                            + this.splitLength\n                            + \"]\");\n        }\n\n        // open the split in an asynchronous thread\n        final InputSplitOpenThread isot = new InputSplitOpenThread(fileSplit, this.openTimeout);\n        isot.start();\n\n        try {\n            this.stream = isot.waitForCompletion();\n            this.stream = decorateInputStream(this.stream, fileSplit);\n        } catch (Throwable t) {\n            throw new IOException(\n                    \"Error opening the Input Split \"\n                            + fileSplit.getPath()\n                            + \" [\"\n                            + splitStart\n                            + \",\"\n                            + splitLength\n                            + \"]: \"\n                            + t.getMessage(),\n                    t);\n        }\n\n        // get FSDataInputStream\n        if (this.splitStart != 0) {\n            this.stream.seek(this.splitStart);\n        }\n    }\n\n    /**","sourceCodeStart":800,"sourceCodeEnd":836,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-core/src/main/java/org/apache/flink/api/common/io/FileInputFormat.java#L800-L836","documentation":"Wraps any Throwable raised while opening an input split in FileInputFormat.open(FileInputSplit). The split is opened in an async InputSplitOpenThread; if that thread throws (file missing, permission denied, decompression failure, FS error), the original error is rethrown as an IOException with the split path and [start,length] range and the underlying cause attached.","triggerScenarios":"The file referenced by a FileInputSplit no longer exists or moved between split computation and open; read permissions are missing; the underlying FileSystem.open fails; decorateInputStream fails because the file's compression codec is not on the classpath; stream.seek(splitStart) fails for a non-zero offset.","commonSituations":"Files deleted/archived by an upstream pipeline mid-job; permissions/ACLs tightened between planning and execution; reading compressed (.gz/.bz2) files without the corresponding Hadoop compression dependency; kerberos ticket expiry on a secured HDFS cluster; transient S3/network errors during open.","solutions":["Inspect the nested cause (getCause()) in the thrown IOException — it carries the real reason (FileNotFoundException, AccessControlException, etc.).","Confirm the file still exists at the path and the split range is within file bounds before retrying.","For compressed inputs, ensure the compression codec jar (e.g., hadoop-gz) is on the classpath and the extension is registered.","For kerberized clusters, verify ticket/TGT lifetime covers the job; increase token renewal.","Retry the job once transient FS/network issues clear; for object stores check endpoint and credentials."],"exampleFix":"// before: decompression codec missing → wrapped error with no clear cause\nformat.setFilePath(\"hdfs:///data/events.log.gz\");\n\n// after: add the codec dependency and confirm the cause\ncatch (IOException e) {\n  Throwable root = e.getCause() != null ? e.getCause() : e;\n  LOG.error(\"split open failed, root cause: {}\", root);\n}","handlingStrategy":"try-catch","validationCode":"// Pre-flight: confirm split files exist and are readable\nPath p = split.getPath();\nFileSystem fs = p.getFileSystem();\nif (!fs.exists(p)) {\n    throw new FileNotFoundException(\"Split path missing before open: \" + p);\n}","typeGuard":null,"tryCatchPattern":"try {\n    format.open(split);\n} catch (IOException e) {\n    Throwable root = e.getCause() != null ? e.getCause() : e;\n    LOG.error(\"Failed to open split {} [{},{}]: {}\", split.getPath(), split.getStart(), split.getLength(), root);\n    throw e;\n}","preventionTips":["Always inspect getCause() — the wrapped root reason drives the fix.","Keep input files stable across the job lifecycle.","Add compression codec jars to the classpath for compressed inputs.","Verify kerberos tickets cover the job duration on secured clusters."],"tags":["flink","file-input","ioexception-wrapper","filesystem","compression"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}