{"record":{"id":"ade7e4cc542e2569","repo":"apache/hadoop","slug":"no-entry-found-for","errorCode":null,"errorMessage":"no entry found for {}","messagePattern":"no entry found for (.+?)","errorType":"exception","errorClass":"InvalidXmlException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/util/XMLUtils.java","lineNumber":299,"sourceCode":"     * @param name        entry to look for\n     * \n     * @return            true if the entry was found\n     */\n    public boolean hasChildren(String name) {\n      return subtrees.containsKey(name);\n    }\n    \n    /** \n     * Pull an entry from a stanza.\n     *\n     * @param name        entry to look for\n     * \n     * @return            the entry\n     */\n    public List<Stanza> getChildren(String name) throws InvalidXmlException {\n      LinkedList <Stanza> children = subtrees.get(name);\n      if (children == null) {\n        throw new InvalidXmlException(\"no entry found for \" + name);\n      }\n      return children;\n    }\n    \n    /** \n     * Pull a string entry from a stanza.\n     *\n     * @param name        entry to look for\n     * \n     * @return            the entry\n     */\n    public String getValue(String name) throws InvalidXmlException {\n      String ret = getValueOrNull(name);\n      if (ret == null) {\n        throw new InvalidXmlException(\"no entry found for \" + name);\n      }\n      return ret;\n    }","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/util/XMLUtils.java#L281-L317","documentation":"Stanza is the tree model the OfflineImageViewer XML processor builds from an fsimage XML dump. getChildren(name) returns the list of sub-stanzas registered under that element name; when subtrees.get(name) is null it throws InvalidXmlException(\"no entry found for \" + name). This almost always means the XML lacks an element the reader's Hadoop version expects.","triggerScenarios":"XMLLoader walking a stanza calls getChildren(\"INODE\"), getChildren(\"BLOCK\"), etc. on a stanza whose XML parent lacks that element — typically an fsimage XML written by a different Hadoop version, or one that was hand-edited, filtered, or truncated.","commonSituations":"Parsing an fsimage XML dump produced by a newer/older release with a changed layout; scripts that reformat or sanitize OIV XML output and drop elements; partially written or corrupted dumps.","solutions":["Regenerate the XML with `hdfs oiv -p XML -i fsimage_...` using the same Hadoop version that will parse it","Inspect the stanza's actual element names (dump the surrounding XML) and diff against what the reader expects","Catch InvalidXmlException and surface the missing element name — the message names exactly which entry was absent"],"exampleFix":"// before\nList<Stanza> inodes = stanza.getChildren(\"INODE\"); // throws if absent\n\n// after\nList<Stanza> inodes;\ntry {\n  inodes = stanza.getChildren(\"INODE\");\n} catch (InvalidXmlException e) {\n  throw new IOException(\"fsimage XML lacks INODE under \" + parentName, e);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  List<Stanza> kids = stanza.getChildren(name);\n} catch (InvalidXmlException e) {\n  // element absent from this stanza: version drift or edited XML\n  LOG.warn(\"missing element {} in stanza\", name);\n}","preventionTips":["Generate and parse fsimage XML with the same Hadoop version","Never hand-filter OIV XML output that a Stanza-based reader will consume","Treat InvalidXmlException as an input-format error, not a code bug"],"tags":["xml","fsimage","offline-image-viewer","hdfs","parsing"],"backgroundTag":"missing-xml-element","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}