apache/hadoop · error · IOException

Empty token file found at specified path

Error message

Empty token file found at specified path: {}

What it means

Thrown when the workload-identity federated token file was read successfully but contained only whitespace, so no client assertion can be produced for AAD authentication.

Solutions

  1. Ensure the token file at the configured path contains a valid JWT; wait for the token projector to populate it.
  2. Verify the pod/service account setup so the token file is refreshed and non-empty.
Defensive patterns

Strategy: validation

When it happens

Trigger: The workload identity token file exists but is empty, usually a race before the token is projected.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/WorkloadIdentityTokenProvider.java:73

    }

    @Override
    public void initialize(Configuration configuration, String accountName) throws IOException {
      // No initialization needed for file-based provider
    }

    @Override
    public String getClientAssertion() throws IOException {
      String clientAssertion = EMPTY_STRING;
      try {
        File file = new File(tokenFile);
        clientAssertion = FileUtils.readFileToString(file, StandardCharsets.UTF_8);
      } catch (Exception e) {
        throw new IOException(TOKEN_FILE_READ_ERROR + tokenFile, e);
      }
      clientAssertion = clientAssertion.trim();
      if (Strings.isNullOrEmpty(clientAssertion)) {
        throw new IOException(EMPTY_TOKEN_FILE_ERROR + tokenFile);
      }
      return clientAssertion;
    }
  }

  private final String authEndpoint;
  private final String clientId;
  private final ClientAssertionProvider clientAssertionProvider;
  private long tokenFetchTime = -1;

  /**
   * Constructor with custom ClientAssertionProvider.
   * Use this for custom token retrieval mechanisms like Kubernetes Token Request API.
   *
   * @param authority OAuth authority URL
   * @param tenantId Azure AD tenant ID
   * @param clientId Azure AD client ID
   * @param clientAssertionProvider Custom provider for client assertions

View on GitHub (pinned to 2add963021)