{"record":{"id":"d954676903d8276f","repo":"apache/hadoop","slug":"token-not-found-in-sql-secret-manager-ident","errorCode":null,"errorMessage":"Token not found in SQL secret manager: {ident}","messagePattern":"Token not found in SQL secret manager: (.+?)","errorType":"exception","errorClass":"NoSuchElementException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/SQLDelegationTokenSecretManager.java","lineNumber":244,"sourceCode":"    } catch (Exception e) {\n      LOG.warn(\"Could not remove token {}\", ident, e);\n    }\n  }\n\n  /**\n   * Obtains the DelegationTokenInformation associated with the given\n   * TokenIdentifier in the SQL database.\n   * @param ident Existing TokenIdentifier in the SQL database.\n   * @return DelegationTokenInformation that matches the given TokenIdentifier or\n   *         null if it doesn't exist in the database.\n   */\n  @VisibleForTesting\n  protected DelegationTokenInformation getTokenInfoFromSQL(TokenIdent ident) {\n    try {\n      byte[] tokenInfoBytes = selectTokenInfo(ident.getSequenceNumber(), ident.getBytes());\n      if (tokenInfoBytes == null) {\n        // Throw exception so value is not added to cache\n        throw new NoSuchElementException(\"Token not found in SQL secret manager: \" + ident);\n      }\n      return createTokenInfo(tokenInfoBytes);\n    } catch (SQLException | IOException e) {\n      LOG.error(\"Failed to get token in SQL secret manager\", e);\n      throw new RuntimeException(e);\n    }\n  }\n\n  private TokenIdent createTokenIdent(byte[] tokenIdentBytes) throws IOException {\n    try (ByteArrayInputStream bis = new ByteArrayInputStream(tokenIdentBytes);\n        DataInputStream din = new DataInputStream(bis)) {\n      TokenIdent id = createIdentifier();\n      id.readFields(din);\n      return id;\n    }\n  }\n\n  private DelegationTokenInformation createTokenInfo(byte[] tokenInfoBytes) throws IOException {","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/SQLDelegationTokenSecretManager.java#L226-L262","documentation":"Error \"Token not found in SQL secret manager: {ident}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/SQLDelegationTokenSecretManager.java:244 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Token {ident} has no row in the SQL token store: it expired and was removed, or was never persisted. Request a new token; if this is a recovery path, verify the store contains the expected tokens."],"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"}