apache/beam · error · IllegalArgumentException

Config file + configFile + does not exist

Error message

Config file + configFile + does not exist

What it means

TransformServiceConfigFactory.create loads the Transform service configuration from the file given via TransformServiceOptions. If the configured config file path does not exist on the filesystem, this guard throws — the option points to a missing file, so the service config cannot be constructed and pipeline submission fails at options-processing time.

Solutions

  1. Verify the path exists with an absolute path instead of a relative one.
  2. When launching on a runner with separate workers, ensure the config file is staged/accessible on the worker (or embed config content via another mechanism).
  3. Check the option value passed on the command line for typos.

Example fix

// before
--transformServiceConfigFile=./configs/tsvc.yaml
// after (absolute, verified path)
--transformServiceConfigFile=/etc/beam/tsvc.yaml
Defensive patterns

Strategy: validation

Validate before calling

import java.io.File;
static void requireConfigFile(String path) {
  File f = new File(path);
  if (!f.isFile() || !f.canRead()) {
    throw new IllegalArgumentException("Transform service config not found/readable: " + f.getAbsolutePath());
  }
}

Type guard

boolean configFileExists(String path) {
  File f = new File(path);
  return f.isFile() && f.canRead();
}

Try / catch

try {
  config = TransformServiceConfig.from(options);
} catch (IllegalArgumentException e) {
  if (e.getMessage() != null && e.getMessage().contains("does not exist")) {
    throw new IllegalStateException(
        "Set --transformServiceConfigFile to an existing file; got: "
        + options.as(TransformServiceOptions.class).getTransformServiceConfigFile(), e);
  }
  throw e;
}

Prevention

When it happens

Trigger: Setting --transformServiceConfigFile (or the equivalent PipelineOptions setter) to a path that does not exist, including wrong relative path (relative to the process CWD, not the pipeline code directory).

Common situations: Typo in the path; running the job from a different working directory than expected; file deleted or not mounted on a Dataflow/cluster worker; wrong container image.

Understand the failure class

Background: "Config file not found": what it means and how to fix it in docker-sync, Maven, Vagrant, Turborepo and other tools — this error's family across 60 libraries.

Related errors


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

Appendix: source

Thrown at sdks/java/transform-service/src/main/java/org/apache/beam/sdk/transformservice/TransformServiceOptions.java:57

  void setTransformServiceConfigFile(String configFile);

  @Description("Transform service configuration.")
  @Default.InstanceFactory(TransformServiceConfigFactory.class)
  TransformServiceConfig getTransformServiceConfig();

  void setTransformServiceConfig(TransformServiceConfig configFile);

  /** Loads the TransformService config. */
  class TransformServiceConfigFactory implements DefaultValueFactory<TransformServiceConfig> {

    @Override
    public TransformServiceConfig create(PipelineOptions options) {
      String configFile = options.as(TransformServiceOptions.class).getTransformServiceConfigFile();
      if (configFile != null) {
        File configFileObj = new File(configFile);
        if (!configFileObj.exists()) {
          throw new IllegalArgumentException("Config file " + configFile + " does not exist");
        }
        try (InputStream stream = new FileInputStream(configFileObj)) {
          return TransformServiceConfig.parseFromYamlStream(stream);
        } catch (FileNotFoundException e) {
          throw new RuntimeException(
              "Could not parse the provided Transform Service config file " + configFile, e);
        } catch (IOException e) {
          throw new RuntimeException(
              "Could not parse the provided Transform Service config file " + configFile, e);
        }
      }

      return TransformServiceConfig.empty();
    }
  }
}

View on GitHub (pinned to 12126d8942)