apache/hadoop · error · IOException
Delegation key stanza <delegationKey> lacked an <id> field.
Error message
Delegation key stanza <delegationKey> lacked an <id> field.
What it means
Error "Delegation key stanza <delegationKey> lacked an <id> field." thrown in apache/hadoop.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageReconstructor.java:975
}
b.setNumTokens(expectedNumTokens);
secretHeader.verifyNoRemainingKeys("SecretManager");
b.build().writeDelimitedTo(out);
for (int actualNumKeys = 0; actualNumKeys < expectedNumKeys;
actualNumKeys++) {
try {
expectTag(SECRET_MANAGER_SECTION_DELEGATION_KEY, false);
} catch (IOException e) {
throw new IOException("Only read " + actualNumKeys +
" delegation keys out of " + expectedNumKeys, e);
}
SecretManagerSection.DelegationKey.Builder dbld =
SecretManagerSection.DelegationKey.newBuilder();
Node dkey = new Node();
loadNodeChildren(dkey, "Delegation key fields");
Integer id = dkey.removeChildInt(SECTION_ID);
if (id == null) {
throw new IOException("Delegation key stanza <delegationKey> " +
"lacked an <id> field.");
}
dbld.setId(id);
String expiry = dkey.removeChildStr(SECRET_MANAGER_SECTION_EXPIRY);
if (expiry == null) {
throw new IOException("Delegation key stanza <delegationKey> " +
"lacked an <expiry> field.");
}
dbld.setExpiryDate(dateStrToLong(expiry));
String keyHex = dkey.removeChildStr(SECRET_MANAGER_SECTION_KEY);
if (keyHex == null) {
throw new IOException("Delegation key stanza <delegationKey> " +
"lacked a <key> field.");
}
byte[] key = new HexBinaryAdapter().unmarshal(keyHex);
dkey.verifyNoRemainingKeys(SECRET_MANAGER_SECTION_DELEGATION_KEY);
dbld.setKey(ByteString.copyFrom(key));
dbld.build().writeDelimitedTo(out);View on GitHub (pinned to 2add963021)
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.
When it happens
Trigger: Thrown by oiv -r when a <delegationKey> stanza is missing its <id> field.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/07e148589e75ff9b.
Report an issue: GitHub.