apache/hadoop · error · NoSuchElementException

Token not found in SQL secret manager: {ident}

Error message

Token not found in SQL secret manager: {ident}

What it means

Error "Token not found in SQL secret manager: {ident}" thrown in apache/hadoop.

Source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/SQLDelegationTokenSecretManager.java:244

    } catch (Exception e) {
      LOG.warn("Could not remove token {}", ident, e);
    }
  }

  /**
   * Obtains the DelegationTokenInformation associated with the given
   * TokenIdentifier in the SQL database.
   * @param ident Existing TokenIdentifier in the SQL database.
   * @return DelegationTokenInformation that matches the given TokenIdentifier or
   *         null if it doesn't exist in the database.
   */
  @VisibleForTesting
  protected DelegationTokenInformation getTokenInfoFromSQL(TokenIdent ident) {
    try {
      byte[] tokenInfoBytes = selectTokenInfo(ident.getSequenceNumber(), ident.getBytes());
      if (tokenInfoBytes == null) {
        // Throw exception so value is not added to cache
        throw new NoSuchElementException("Token not found in SQL secret manager: " + ident);
      }
      return createTokenInfo(tokenInfoBytes);
    } catch (SQLException | IOException e) {
      LOG.error("Failed to get token in SQL secret manager", e);
      throw new RuntimeException(e);
    }
  }

  private TokenIdent createTokenIdent(byte[] tokenIdentBytes) throws IOException {
    try (ByteArrayInputStream bis = new ByteArrayInputStream(tokenIdentBytes);
        DataInputStream din = new DataInputStream(bis)) {
      TokenIdent id = createIdentifier();
      id.readFields(din);
      return id;
    }
  }

  private DelegationTokenInformation createTokenInfo(byte[] tokenInfoBytes) throws IOException {

View on GitHub (pinned to 2add963021)

Solutions

  1. 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.

When it happens

Trigger: 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.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/d954676903d8276f. Report an issue: GitHub.