{"record":{"id":"cf48edeb848dfe5e","repo":"apache/hadoop","slug":"failed-to-store-delegation-key-in-sql-secret-manag","errorCode":null,"errorMessage":"Failed to store delegation key in SQL secret manager","messagePattern":"Failed to store delegation key 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":343,"sourceCode":"  }\n\n  /**\n   * Persists a DelegationKey into the SQL database. The delegation keyId\n   * is expected to be unique and any duplicate key attempts will result\n   * in an IOException.\n   * @param key DelegationKey to persist into the SQL database.\n   */\n  @Override\n  protected void storeDelegationKey(DelegationKey key) throws IOException {\n    try (ByteArrayOutputStream bos = new ByteArrayOutputStream();\n        DataOutputStream dos = new DataOutputStream(bos)) {\n      key.write(dos);\n      // Add delegation key to SQL database\n      insertDelegationKey(key.getKeyId(), bos.toByteArray());\n      // Add delegation key to local cache\n      super.storeDelegationKey(key);\n    } catch (SQLException e) {\n      throw new IOException(\"Failed to store delegation key in SQL secret manager\", e);\n    }\n  }\n\n  /**\n   * Updates an existing DelegationKey in the SQL database.\n   * @param key Updated DelegationKey.\n   */\n  @Override\n  protected void updateDelegationKey(DelegationKey key) throws IOException {\n    try (ByteArrayOutputStream bos = new ByteArrayOutputStream();\n        DataOutputStream dos = new DataOutputStream(bos)) {\n      key.write(dos);\n      // Update delegation key in SQL database\n      updateDelegationKey(key.getKeyId(), bos.toByteArray());\n      // Update delegation key in local cache\n      super.updateDelegationKey(key);\n    } catch (SQLException e) {\n      throw new IOException(\"Failed to update delegation key in SQL secret manager\", e);","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/SQLDelegationTokenSecretManager.java#L325-L361","documentation":"Error \"Failed to store delegation key 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:343 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Storing the delegation key in SQL failed. Verify the keys table schema and database connectivity; 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"}