{"record":{"id":"56510b21d1329a2a","repo":"apache/hadoop","slug":"secretmanager-section-had-no-numtokens","errorCode":null,"errorMessage":"SecretManager section had no <numTokens>","messagePattern":"SecretManager section had no <numTokens>","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":955,"sourceCode":"      b.setCurrentId(currentId);\n      Integer tokenSequenceNumber = secretHeader.removeChildInt(\n          SECRET_MANAGER_SECTION_TOKEN_SEQUENCE_NUMBER);\n      if (tokenSequenceNumber == null) {\n        throw new IOException(\"SecretManager section had no \" +\n            \"<tokenSequenceNumber>\");\n      }\n      b.setTokenSequenceNumber(tokenSequenceNumber);\n      Integer expectedNumKeys = secretHeader.removeChildInt(\n          SECRET_MANAGER_SECTION_NUM_DELEGATION_KEYS);\n      if (expectedNumKeys == null) {\n        throw new IOException(\"SecretManager section had no \" +\n            \"<numDelegationKeys>\");\n      }\n      b.setNumKeys(expectedNumKeys);\n      Integer expectedNumTokens =\n          secretHeader.removeChildInt(SECRET_MANAGER_SECTION_NUM_TOKENS);\n      if (expectedNumTokens == null) {\n        throw new IOException(\"SecretManager section had no \" +\n            \"<numTokens>\");\n      }\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);","sourceCodeStart":937,"sourceCodeEnd":973,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineImageViewer/OfflineImageReconstructor.java#L937-L973","documentation":"Error \"SecretManager section had no <numTokens>\" thrown in apache/hadoop.","triggerScenarios":"Thrown by oiv -r when the SecretManager section header lacks the <numTokens> element.","commonSituations":"See trigger scenarios.","solutions":["Add the missing <numTokens> element to the SecretManager section of 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-22T20:17:22.307Z"}