{"record":{"id":"8180584e949fdfb9","repo":"apache/hadoop","slug":"empty-token-file-found-at-specified-path","errorCode":null,"errorMessage":"Empty token file found at specified path: {}","messagePattern":"Empty token file found at specified path: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/WorkloadIdentityTokenProvider.java","lineNumber":73,"sourceCode":"    }\n\n    @Override\n    public void initialize(Configuration configuration, String accountName) throws IOException {\n      // No initialization needed for file-based provider\n    }\n\n    @Override\n    public String getClientAssertion() throws IOException {\n      String clientAssertion = EMPTY_STRING;\n      try {\n        File file = new File(tokenFile);\n        clientAssertion = FileUtils.readFileToString(file, StandardCharsets.UTF_8);\n      } catch (Exception e) {\n        throw new IOException(TOKEN_FILE_READ_ERROR + tokenFile, e);\n      }\n      clientAssertion = clientAssertion.trim();\n      if (Strings.isNullOrEmpty(clientAssertion)) {\n        throw new IOException(EMPTY_TOKEN_FILE_ERROR + tokenFile);\n      }\n      return clientAssertion;\n    }\n  }\n\n  private final String authEndpoint;\n  private final String clientId;\n  private final ClientAssertionProvider clientAssertionProvider;\n  private long tokenFetchTime = -1;\n\n  /**\n   * Constructor with custom ClientAssertionProvider.\n   * Use this for custom token retrieval mechanisms like Kubernetes Token Request API.\n   *\n   * @param authority OAuth authority URL\n   * @param tenantId Azure AD tenant ID\n   * @param clientId Azure AD client ID\n   * @param clientAssertionProvider Custom provider for client assertions","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/WorkloadIdentityTokenProvider.java#L55-L91","documentation":"Error \"Empty token file found at specified path: {}\" thrown in apache/hadoop.","triggerScenarios":"The workload identity token file exists but is empty, usually a race before the token is projected.","commonSituations":"See trigger scenarios.","solutions":["Ensure the token file at the configured path contains a valid JWT; wait for the token projector to populate it.","Verify the pod/service account setup so the token file is refreshed and non-empty."],"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-22T20:17:22.307Z"}