apache/beam · error · java.lang.IllegalArgumentException

Allow list file does not exist

Error message

Allow list file  does not exist

What it means

Thrown by AllowList.create when the configured allowlist file path is neither the wildcard '*' nor an existing file on disk. The service validates file existence up front with File.exists() so it can fail with a clear message instead of a FileNotFoundException later.

Solutions

  1. Verify the path exists: run 'ls -l <path>' and correct any typo or relative-path issue (use an absolute path).
  2. Create the allowlist file if it was never written, e.g. with an 'allowlist:' YAML mapping.
  3. If everything should be allowed, pass '*' instead of a file path.

Example fix

// before
--allowListFile=./configs/allowlist.yml   # file not present
// after
--allowListFile=/opt/expansion/allowlist.yml  # absolute path to an existing file
Defensive patterns

Strategy: validation

Validate before calling

String allowListFile = options.as(ExpansionServiceOptions.class).getAllowListFile();
if (allowListFile != null && !allowListFile.equals("*") && !new File(allowListFile).exists()) {
  throw new IllegalStateException("Allowlist file does not exist: " + allowListFile);
}

Try / catch

try {
  startExpansionService(options);
} catch (IllegalArgumentException e) {
  if (e.getMessage().contains("Allow list file") && e.getMessage().contains("does not exist")) { /* fix path or create file */ }
  throw e;
}

Prevention

When it happens

Trigger: Starting ExpansionService with an allowlist path (via --allowListFile or equivalent option) that points to a non-existent file or a typo'd relative path.

Common situations: Running the service from a different working directory than assumed, so a relative path no longer resolves; file deleted or renamed; container image missing the mounted config file.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/27f8bd6d6300de2e. Report an issue: GitHub.

Appendix: source

Thrown at sdks/java/expansion-service/src/main/java/org/apache/beam/sdk/expansion/service/ExpansionServiceOptions.java:91

  void setUseConfigDependenciesForManaged(boolean useConfigDependenciesForManaged);

  /**
   * Loads the allow list from {@link #getJavaClassLookupAllowlistFile}, defaulting to an empty
   * {@link JavaClassLookupTransformProvider.AllowList}.
   */
  class JavaClassLookupAllowListFactory implements DefaultValueFactory<AllowList> {

    @Override
    public AllowList create(PipelineOptions options) {
      String allowListFile =
          options.as(ExpansionServiceOptions.class).getJavaClassLookupAllowlistFile();
      if (allowListFile != null) {
        if (allowListFile.equals("*")) {
          return AllowList.everything();
        }
        File allowListFileObj = new File(allowListFile);
        if (!allowListFileObj.exists()) {
          throw new IllegalArgumentException(
              "Allow list file " + allowListFile + " does not exist");
        }
        try (InputStream stream = new FileInputStream(allowListFileObj)) {
          return AllowList.parseFromYamlStream(stream);
        } catch (FileNotFoundException e) {
          throw new RuntimeException(
              "Could not parse the provided allowlist file " + allowListFile, e);
        } catch (IOException e) {
          throw new RuntimeException(
              "Could not parse the provided allowlist file " + allowListFile, e);
        }
      }

      // By default produces an empty allow-list.
      return AllowList.nothing();
    }
  }

View on GitHub (pinned to 12126d8942)