{"record":{"id":"11ff3e3ad31feff1","repo":"apache/hadoop","slug":"offset-is-outside-of-file-0","errorCode":null,"errorMessage":"Offset {} is outside of file (0..{})","messagePattern":"Offset (.+?) is outside of file \\(0\\.\\.(.+?)\\)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/FileInputFormat.java","lineNumber":431,"sourceCode":"  }\n\n  protected long computeSplitSize(long goalSize, long minSize,\n                                       long blockSize) {\n    return Math.max(minSize, Math.min(goalSize, blockSize));\n  }\n\n  protected int getBlockIndex(BlockLocation[] blkLocations, \n                              long offset) {\n    for (int i = 0 ; i < blkLocations.length; i++) {\n      // is the offset inside this block?\n      if ((blkLocations[i].getOffset() <= offset) &&\n          (offset < blkLocations[i].getOffset() + blkLocations[i].getLength())){\n        return i;\n      }\n    }\n    BlockLocation last = blkLocations[blkLocations.length -1];\n    long fileLength = last.getOffset() + last.getLength() -1;\n    throw new IllegalArgumentException(\"Offset \" + offset + \n                                       \" is outside of file (0..\" +\n                                       fileLength + \")\");\n  }\n\n  /**\n   * Sets the given comma separated paths as the list of inputs \n   * for the map-reduce job.\n   * \n   * @param conf Configuration of the job\n   * @param commaSeparatedPaths Comma separated paths to be set as \n   *        the list of inputs for the map-reduce job.\n   */\n  public static void setInputPaths(JobConf conf, String commaSeparatedPaths) {\n    setInputPaths(conf, StringUtils.stringToPath(\n                        getPathStrings(commaSeparatedPaths)));\n  }\n\n  /**","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/FileInputFormat.java#L413-L449","documentation":"Error \"Offset {} is outside of file (0..{})\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/FileInputFormat.java:431 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the split start offset and length fall within the file length; regenerate input splits if the file changed after splits were computed.","Avoid modifying input files while the job is running so offsets remain valid."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}