{"record":{"id":"b748abf943d71291","repo":"apache/hadoop","slug":"invalid-version-expected","errorCode":null,"errorMessage":"Invalid version {} expected {}","messagePattern":"Invalid version (.+?) expected (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFileSystem.java","lineNumber":1185,"sourceCode":"      Text line = new Text();\n      long read;\n      FSDataInputStream in = null;\n      LineReader lin = null;\n\n      try {\n        in = fs.open(masterIndexPath);\n        FileStatus masterStat = fs.getFileStatus(masterIndexPath);\n        masterIndexTimestamp = masterStat.getModificationTime();\n        lin = new LineReader(in, getConf());\n        read = lin.readLine(line);\n\n        // the first line contains the version of the index file\n        String versionLine = line.toString();\n        String[] arr = versionLine.split(\" \");\n        version = Integer.parseInt(arr[0]);\n        // make it always backwards-compatible\n        if (this.version > HarFileSystem.VERSION) {\n          throw new IOException(\"Invalid version \" + \n              this.version + \" expected \" + HarFileSystem.VERSION);\n        }\n\n        // each line contains a hashcode range and the index file name\n        String[] readStr;\n        while(read < masterStat.getLen()) {\n          int b = lin.readLine(line);\n          read += b;\n          readStr = line.toString().split(\" \");\n          stores.add(new Store(Long.parseLong(readStr[2]), \n              Long.parseLong(readStr[3])));\n          line.clear();\n        }\n      } catch (IOException ioe) {\n        LOG.warn(\"Encountered exception \", ioe);\n        throw ioe;\n      } finally {\n        IOUtils.cleanupWithLogger(LOG, lin, in);","sourceCodeStart":1167,"sourceCodeEnd":1203,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFileSystem.java#L1167-L1203","documentation":"Error \"Invalid version {} expected {}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/HarFileSystem.java:1185 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the archive with a Hadoop version matching the archive's format version.","Re-create the archive with the current Hadoop version."],"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"}