{"record":{"id":"46ed6b06514e5fcc","repo":"apache/hadoop","slug":"xattr-had-no-val-or-valhex-entry","errorCode":null,"errorMessage":"<xattr> had no <val> or <valHex> entry.","messagePattern":"<xattr> had no <val> or <valHex> entry\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageReconstructor.java","lineNumber":899,"sourceCode":"      Node xattr = xattrs.removeChild(INODE_SECTION_XATTR);\n      if (xattr == null) {\n        break;\n      }\n      INodeSection.XAttrCompactProto.Builder b =\n          INodeSection.XAttrCompactProto.newBuilder();\n      String ns = xattr.removeChildStr(INODE_SECTION_NS);\n      if (ns == null) {\n        throw new IOException(\"<xattr> had no <ns> entry.\");\n      }\n      int nsIdx = XAttrProtos.XAttrProto.\n          XAttrNamespaceProto.valueOf(ns).ordinal();\n      String name = xattr.removeChildStr(SECTION_NAME);\n      String valStr = xattr.removeChildStr(INODE_SECTION_VAL);\n      byte[] val = null;\n      if (valStr == null) {\n        String valHex = xattr.removeChildStr(INODE_SECTION_VAL_HEX);\n        if (valHex == null) {\n          throw new IOException(\"<xattr> had no <val> or <valHex> entry.\");\n        }\n        val = new HexBinaryAdapter().unmarshal(valHex);\n      } else {\n        val = valStr.getBytes(StandardCharsets.UTF_8);\n      }\n      b.setValue(ByteString.copyFrom(val));\n\n      // The XAttrCompactProto name field uses a fairly complex format\n      // to encode both the string table ID of the xattr name and the\n      // namespace ID.  See the protobuf file for details.\n      int nameId = registerStringId(name);\n      int encodedName = (nameId << XATTR_NAME_OFFSET) |\n          ((nsIdx & XATTR_NAMESPACE_MASK) << XATTR_NAMESPACE_OFFSET) |\n          (((nsIdx >> 2) & XATTR_NAMESPACE_EXT_MASK)\n              << XATTR_NAMESPACE_EXT_OFFSET);\n      b.setName(encodedName);\n      xattr.verifyNoRemainingKeys(\"xattr\");\n      bld.addXAttrs(b);","sourceCodeStart":881,"sourceCodeEnd":917,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageReconstructor.java#L881-L917","documentation":"Error \"<xattr> had no <val> or <valHex> entry.\" thrown in apache/hadoop.","triggerScenarios":"Thrown by oiv -r when an <xattr> stanza has neither a <val> nor a <valHex> entry, so the extended attribute value cannot be reconstructed.","commonSituations":"See trigger scenarios.","solutions":["Add a <val> or <valHex> element to the <xattr> stanza in the fsimage XML.","Regenerate the fsimage XML with 'hdfs oiv' from a valid fsimage."],"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-23T01:17:44.959Z"}