{"record":{"id":"095ace463c647059","repo":"apache/hadoop","slug":"adddelegationtokens-returned-no-tokens","errorCode":null,"errorMessage":"addDelegationTokens returned no tokens","messagePattern":"addDelegationTokens returned no tokens","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegationTokenRenewer.java","lineNumber":138,"sourceCode":"    /**\n     * Renew or replace the delegation token for this file system.\n     * It can only be called when the action is not in the queue.\n     * @return\n     * @throws IOException\n     */\n    private boolean renew() throws IOException, InterruptedException {\n      final T fs = weakFs.get();\n      final boolean b = fs != null;\n      if (b) {\n        synchronized(fs) {\n          try {\n            long expires = token.renew(fs.getConf());\n            updateRenewalTime(expires - Time.now());\n          } catch (IOException ie) {\n            try {\n              Token<?>[] tokens = fs.addDelegationTokens(null, null);\n              if (tokens.length == 0) {\n                throw new IOException(\"addDelegationTokens returned no tokens\");\n              }\n              token = tokens[0];\n              updateRenewalTime(renewCycle);\n              fs.setDelegationToken(token);\n            } catch (IOException ie2) {\n              isValid = false;\n              throw new IOException(\"Can't renew or get new delegation token \", ie);\n            }\n          }\n        }\n      }\n      return b;\n    }\n\n    private void cancel() throws IOException, InterruptedException {\n      final T fs = weakFs.get();\n      if (fs != null) {\n        token.cancel(fs.getConf());","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegationTokenRenewer.java#L120-L156","documentation":"Error \"addDelegationTokens returned no tokens\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegationTokenRenewer.java:138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the filesystem actually issues delegation tokens; some FileSystem implementations return none.","Verify the user has Kerberos credentials and the service is reachable.","Review the filesystem's addDelegationTokens implementation and logs for why no token was returned."],"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"}