{"record":{"id":"07e148589e75ff9b","repo":"apache/hadoop","slug":"delegation-key-stanza-delegationkey-lacked-an-i","errorCode":null,"errorMessage":"Delegation key stanza <delegationKey> lacked an <id> field.","messagePattern":"Delegation key stanza <delegationKey> lacked an <id> field\\.","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":975,"sourceCode":"      }\n      b.setNumTokens(expectedNumTokens);\n      secretHeader.verifyNoRemainingKeys(\"SecretManager\");\n      b.build().writeDelimitedTo(out);\n      for (int actualNumKeys = 0; actualNumKeys < expectedNumKeys;\n           actualNumKeys++) {\n        try {\n          expectTag(SECRET_MANAGER_SECTION_DELEGATION_KEY, false);\n        } catch (IOException e) {\n          throw new IOException(\"Only read \" + actualNumKeys +\n              \" delegation keys out of \" + expectedNumKeys, e);\n        }\n        SecretManagerSection.DelegationKey.Builder dbld =\n            SecretManagerSection.DelegationKey.newBuilder();\n        Node dkey = new Node();\n        loadNodeChildren(dkey, \"Delegation key fields\");\n        Integer id = dkey.removeChildInt(SECTION_ID);\n        if (id == null) {\n          throw new IOException(\"Delegation key stanza <delegationKey> \" +\n              \"lacked an <id> field.\");\n        }\n        dbld.setId(id);\n        String expiry = dkey.removeChildStr(SECRET_MANAGER_SECTION_EXPIRY);\n        if (expiry == null) {\n          throw new IOException(\"Delegation key stanza <delegationKey> \" +\n              \"lacked an <expiry> field.\");\n        }\n        dbld.setExpiryDate(dateStrToLong(expiry));\n        String keyHex = dkey.removeChildStr(SECRET_MANAGER_SECTION_KEY);\n        if (keyHex == null) {\n          throw new IOException(\"Delegation key stanza <delegationKey> \" +\n              \"lacked a <key> field.\");\n        }\n        byte[] key = new HexBinaryAdapter().unmarshal(keyHex);\n        dkey.verifyNoRemainingKeys(SECRET_MANAGER_SECTION_DELEGATION_KEY);\n        dbld.setKey(ByteString.copyFrom(key));\n        dbld.build().writeDelimitedTo(out);","sourceCodeStart":957,"sourceCodeEnd":993,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageReconstructor.java#L957-L993","documentation":"Error \"Delegation key stanza <delegationKey> lacked an <id> field.\" thrown in apache/hadoop.","triggerScenarios":"Thrown by oiv -r when a <delegationKey> stanza is missing its <id> field.","commonSituations":"See trigger scenarios.","solutions":["Add the missing <id> field to the <delegationKey> 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"}