apache/hadoop · error · IOException

addDelegationTokens returned no tokens

Error message

addDelegationTokens returned no tokens

What it means

Thrown by DelegationTokenRenewer.renew inside its recovery path: renewing the existing token failed with IOException, so it called fs.addDelegationTokens to acquire a fresh token, but that returned an empty array. The renewal fallback exhausted itself.

Solutions

  1. Check that the filesystem actually issues delegation tokens; some FileSystem implementations return none.
  2. Verify the user has Kerberos credentials and the service is reachable.
  3. Review the filesystem's addDelegationTokens implementation and logs for why no token was returned.
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegationTokenRenewer.java:138 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/095ace463c647059. Report an issue: GitHub.

Appendix: source

Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/DelegationTokenRenewer.java:138

    /**
     * Renew or replace the delegation token for this file system.
     * It can only be called when the action is not in the queue.
     * @return
     * @throws IOException
     */
    private boolean renew() throws IOException, InterruptedException {
      final T fs = weakFs.get();
      final boolean b = fs != null;
      if (b) {
        synchronized(fs) {
          try {
            long expires = token.renew(fs.getConf());
            updateRenewalTime(expires - Time.now());
          } catch (IOException ie) {
            try {
              Token<?>[] tokens = fs.addDelegationTokens(null, null);
              if (tokens.length == 0) {
                throw new IOException("addDelegationTokens returned no tokens");
              }
              token = tokens[0];
              updateRenewalTime(renewCycle);
              fs.setDelegationToken(token);
            } catch (IOException ie2) {
              isValid = false;
              throw new IOException("Can't renew or get new delegation token ", ie);
            }
          }
        }
      }
      return b;
    }

    private void cancel() throws IOException, InterruptedException {
      final T fs = weakFs.get();
      if (fs != null) {
        token.cancel(fs.getConf());

View on GitHub (pinned to 2add963021)