{"record":{"id":"90b8e2aa1e433442","repo":"apache/hadoop","slug":"failed-to-increment-delegation-key-id-in-sql-secre","errorCode":null,"errorMessage":"Failed to increment delegation key id in SQL secret manager","messagePattern":"Failed to increment delegation key id in SQL secret manager","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/SQLDelegationTokenSecretManager.java","lineNumber":453,"sourceCode":"      updateKeyId(keyId);\n    } catch (SQLException e) {\n      throw new RuntimeException(\n          \"Failed to set delegation key id in SQL secret manager\", e);\n    }\n  }\n\n  /**\n   * Obtains the next available delegation key id that can be allocated to a DelegationKey.\n   * Delegation key id need to be reserved using the shared delegationKeyIdCounter,\n   * which handles keyId allocation concurrently with other secret managers.\n   * @return Next available delegation key id.\n   */\n  @Override\n  public int incrementCurrentKeyId() {\n    try {\n      return incrementKeyId(1) + 1;\n    } catch (SQLException e) {\n      throw new RuntimeException(\n          \"Failed to increment delegation key id in SQL secret manager\", e);\n    }\n  }\n\n  // Token operations in SQL database\n  protected abstract byte[] selectTokenInfo(int sequenceNum, byte[] tokenIdentifier)\n      throws SQLException;\n  protected abstract Map<byte[], byte[]> selectStaleTokenInfos(long maxModifiedTime,\n      int maxResults) throws SQLException;\n  protected abstract void insertToken(int sequenceNum, byte[] tokenIdentifier, byte[] tokenInfo)\n      throws SQLException;\n  protected abstract void updateToken(int sequenceNum, byte[] tokenIdentifier, byte[] tokenInfo)\n      throws SQLException;\n  protected abstract void deleteToken(int sequenceNum, byte[] tokenIdentifier)\n      throws SQLException;\n  // Delegation key operations in SQL database\n  protected abstract byte[] selectDelegationKey(int keyId) throws SQLException;\n  protected abstract void insertDelegationKey(int keyId, byte[] delegationKey)","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/SQLDelegationTokenSecretManager.java#L435-L471","documentation":"Error \"Failed to increment delegation key id in SQL secret manager\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/SQLDelegationTokenSecretManager.java:453 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Incrementing the delegation key id in SQL failed. Check for concurrent writers or connection failure; see the chained SQLException."],"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"}