apache/beam · error · RuntimeError

Could not find the provided transforms config source

Error message

Could not find the provided transforms config source: {transforms_config_source}

What it means

gen_xlang_wrappers.py generates Python wrapper classes for cross-language transforms from a YAML transforms config. When the config source path was supplied by the caller (rather than generated internally), the script checks os.path.exists() on it and raises RuntimeError if the file is absent, because it cannot proceed without the transform definitions.

Solutions

  1. Verify the path passed as transforms_config_source exists (os.path.exists) before invoking the script
  2. If you intended auto-generation, omit the config source so the script generates it into output_transforms_config
  3. Run the generation from the repository root so relative paths resolve correctly
  4. Check out/pull the file (e.g. standard_external_transforms.yaml) if it lives in another directory of the repo

Example fix

# before
subprocess.run(['python', 'gen_xlang_wrappers.py', '--transforms_config_source', 'standard_external_transforms.yaml'])
# after
import os
cfg = os.path.join(sdk_dir, 'standard_external_transforms.yaml')
assert os.path.exists(cfg), f'missing transforms config: {cfg}'
subprocess.run(['python', 'gen_xlang_wrappers.py', '--transforms_config_source', cfg])
Defensive patterns

Strategy: validation

Validate before calling

import os
if not os.path.exists(transforms_config_source):
    raise FileNotFoundError(f'transforms config missing: {transforms_config_source}')

Type guard

def is_valid_config_source(path: str) -> bool:
    return isinstance(path, str) and os.path.isfile(path)

Prevention

When it happens

Trigger: Running gen_xlang_wrappers.py (or calling run_script) with a --transforms_config_source path that does not exist on disk, e.g. a typo'd path, a file deleted before the run, or a config only present after a prior generation step that never ran.

Common situations: Developers wiring xlang wrapper generation into build scripts point at a YAML file in a different repo checkout or a path relative to the wrong cwd; CI caches miss the config file; Beam SDK version change renames standard_external_transforms.yaml.

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/d52a37d1f4df95c1. Report an issue: GitHub.

Appendix: source

Thrown at sdks/python/gen_xlang_wrappers.py:391

    input_expansion_services,
    transforms_config_source):
  # Cleanup first if requested. This is needed to remove outdated wrappers.
  if cleanup:
    delete_generated_files(PY_WRAPPER_OUTPUT_DIR)

  # This step requires the expansion service.
  # Only generate a transforms config file if none are provided
  if not transforms_config_source:
    output_transforms_config = os.path.join(
        PROJECT_ROOT, 'sdks', 'standard_external_transforms.yaml')
    generate_transforms_config(
        input_services=input_expansion_services,
        output_file=output_transforms_config)

    transforms_config_source = output_transforms_config
  else:
    if not os.path.exists(transforms_config_source):
      raise RuntimeError(
          "Could not find the provided transforms config "
          f"source: {transforms_config_source}")

  if generate_config_only:
    return

  wrappers_grouped_by_destination = get_wrappers_from_transform_configs(
      transforms_config_source)

  write_wrappers_to_destinations(wrappers_grouped_by_destination)


if __name__ == '__main__':
  parser = argparse.ArgumentParser()
  parser.add_argument(
      '--cleanup',
      dest='cleanup',
      action='store_true',

View on GitHub (pinned to 12126d8942)