{"record":{"id":"63b4aec82f6c6ce2","repo":"apache/hadoop","slug":"name-serial-number-i-does-not-exist","errorCode":null,"errorMessage":"${name}: serial number ${i} does not exist","messagePattern":"(.+?): serial number (.+?) does not exist","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SerialNumberMap.java","lineNumber":90,"sourceCode":"          Integer old = t2i.putIfAbsent(t, sn);\n          if (old != null) {\n            current.getAndDecrement();\n            return old;\n          }\n          i2t.put(sn, t);\n        }\n      }\n    }\n    return sn;\n  }\n\n  public T get(int i) {\n    if (i == 0) {\n      return null;\n    }\n    T t = i2t.get(i);\n    if (t == null) {\n      throw new IllegalStateException(\n          name + \": serial number \" + i + \" does not exist\");\n    }\n    return t;\n  }\n\n  int getMax() {\n    return max;\n  }\n\n  Set<Map.Entry<Integer, T>> entrySet() {\n    return new HashSet<>(i2t.entrySet());\n  }\n\n  public int size() {\n    return i2t.size();\n  }\n\n  @Override","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SerialNumberMap.java#L72-L108","documentation":"The reverse lookup SerialNumberMap.get(int i) throws IllegalStateException when asked for a serial number that was never assigned (i2t miss). During fsimage load this means the serialized data references a serial id that the loaded string table does not contain — data that is internally inconsistent.","triggerScenarios":"Image load or edits replay calls getString(id)/get(i) with an id that has no entry: truncated string-table section, an fsimage paired with edits/alias data from a different namespace, or bit-corrupted id fields.","commonSituations":"Mixing storage files from two clusters or two layout generations during manual recovery; image copied incompletely (network/disk interruption); NameNode storage damaged by a failing disk.","solutions":["Restore from a consistent checkpoint or bootstrap the node from a healthy peer's storage","Validate the fsimage .md5 checksum before every manual copy or restore","Never hand-mix fsimage/edits files from different directories or clusters; recover via -bootstrapStandby or a full checkpoint instead","Check the underlying volume/filesystem for errors (dmesg, smartctl, storage logs)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  fsImage.loadFSImage(file, dstNamesystem);\n} catch (IllegalStateException e) { // \"serial number N does not exist\"\n  // internally inconsistent image — fall back to previous good checkpoint\n  // or bootstrap from peer; do not attempt partial recovery\n}","preventionTips":["Never mix fsimage/edits files from different nodes or clusters during recovery","Checksum-verify (md5) every image you copy before loading it","Prefer built-in recovery (-bootstrapStandby, -recover) over manual file surgery"],"tags":["hdfs","namenode","serial-number","data-corruption","image-load","illegal-state"],"backgroundTag":"data-corruption","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}