{"record":{"id":"eaa6ea409a142f8a","repo":"apache/hadoop","slug":"failed-to-update-token-in-sql-secret-manager","errorCode":null,"errorMessage":"Failed to update token in SQL secret manager","messagePattern":"Failed to update token in SQL secret manager","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/SQLDelegationTokenSecretManager.java","lineNumber":144,"sourceCode":"  /**\n   * Updates the TokenInformation of an existing TokenIdentifier in\n   * the SQL database.\n   * @param ident Existing TokenIdentifier in the SQL database.\n   * @param tokenInfo Updated DelegationTokenInformation associated with the TokenIdentifier.\n   */\n  @Override\n  protected void updateToken(TokenIdent ident,\n      DelegationTokenInformation tokenInfo) throws IOException {\n    try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) {\n      try (DataOutputStream dos = new DataOutputStream(bos)) {\n        tokenInfo.write(dos);\n        // Update token in SQL database\n        updateToken(ident.getSequenceNumber(), ident.getBytes(), bos.toByteArray());\n        // Update token in local cache\n        super.updateToken(ident, tokenInfo);\n      }\n    } catch (SQLException e) {\n      throw new IOException(\"Failed to update token in SQL secret manager\", e);\n    }\n  }\n\n  /**\n   * Cancels a token by removing it from the SQL database. This will\n   * call the corresponding method in {@link AbstractDelegationTokenSecretManager}\n   * to perform validation and remove the token from the cache.\n   * @return Identifier of the canceled token\n   */\n  @Override\n  public synchronized TokenIdent cancelToken(Token<TokenIdent> token,\n      String canceller) throws IOException {\n    TokenIdent id = createTokenIdent(token.getIdentifier());\n\n    // Calling getTokenInfo to load token into local cache if not present.\n    // super.cancelToken() requires token to be present in local cache.\n    getTokenInfo(id);\n","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/SQLDelegationTokenSecretManager.java#L126-L162","documentation":"Error \"Failed to update token 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:144 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The SQL UPDATE of the token row failed. Verify the token row still exists, the database connection is healthy, and the schema matches the expected columns; 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-23T01:17:44.959Z"}