{"record":{"id":"26cda59227cbaec1","repo":"apache/hadoop","slug":"failed-to-update-token-sequence-number-in-sql-secr","errorCode":null,"errorMessage":"Failed to update token sequence number in SQL secret manager","messagePattern":"Failed to update token sequence number 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":296,"sourceCode":"  public int getDelegationTokenSeqNum() {\n    try {\n      return selectSequenceNum();\n    } catch (SQLException e) {\n      throw new RuntimeException(\n          \"Failed to get token sequence number in SQL secret manager\", e);\n    }\n  }\n\n  /**\n   * Updates the value of the last reserved sequence number.\n   * @param seqNum Value to update the sequence number to.\n   */\n  @Override\n  public void setDelegationTokenSeqNum(int seqNum) {\n    try {\n      updateSequenceNum(seqNum);\n    } catch (SQLException e) {\n      throw new RuntimeException(\n          \"Failed to update token sequence number in SQL secret manager\", e);\n    }\n  }\n\n  /**\n   * Obtains the next available sequence number that can be allocated to a Token.\n   * Sequence numbers need to be reserved using the shared sequenceNumberCounter once\n   * the local batch has been exhausted, which handles sequenceNumber allocation\n   * concurrently with other secret managers.\n   * This method ensures that sequence numbers are incremental in a single secret manager,\n   * but not across secret managers.\n   * @return Next available sequence number.\n   */\n  @Override\n  public synchronized int incrementDelegationTokenSeqNum() {\n    if (currentSeqNum >= currentMaxSeqNum) {\n      try {\n        // Request a new batch of sequence numbers and use the","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/SQLDelegationTokenSecretManager.java#L278-L314","documentation":"Error \"Failed to update token sequence number 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:296 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Updating the token sequence number row failed. Verify the counter row exists and the connection is writable; check 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-23T01:17:44.959Z"}