{"record":{"id":"45b69425731840d4","repo":"apache/beam","slug":"f-error-loading-providers-from-include-path-included-at","errorCode":null,"errorMessage":"f\"Error loading providers from {include_path} included at {source_path}:{SafeLineLoader.get_line(provider_spec)}\\n{str(exn)}\"","messagePattern":"f\"Error loading providers from (.+?) included at (.+?):(.+?)\\\\n(.+?)\"","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/yaml/yaml_provider.py","lineNumber":1673,"sourceCode":"\n@_as_list\ndef parse_providers(source_path,\n                    provider_specs: Iterable[Mapping]) -> Iterable[Provider]:\n  from apache_beam.yaml.yaml_transform import SafeLineLoader\n  for provider_spec in provider_specs:\n    if 'include' in provider_spec:\n      if len(SafeLineLoader.strip_metadata(provider_spec)) != 1:\n        raise ValueError(\n            f\"When using include, it must be the only parameter: \"\n            f\"{provider_spec} \"\n            f\"at {source_path}:{SafeLineLoader.get_line(provider_spec)}\")\n      include_path = _join_url_or_filepath(\n          source_path, provider_spec['include'])\n      try:\n        yield from load_providers(include_path)\n\n      except Exception as exn:\n        raise ValueError(\n            f\"Error loading providers from {include_path} included at \"\n            f\"{source_path}:{SafeLineLoader.get_line(provider_spec)}\\n\" +\n            str(exn)) from exn\n    else:\n      yield ExternalProvider.provider_from_spec(source_path, provider_spec)\n\n\ndef merge_providers(*provider_sets) -> Mapping[str, Iterable[Provider]]:\n  result = collections.defaultdict(list)\n  for provider_set in provider_sets:\n    if isinstance(provider_set, Provider):\n      provider = provider_set\n      provider_set = {\n          transform_type: [provider]\n          for transform_type in provider.provided_transforms()\n      }\n    elif isinstance(provider_set, list):\n      provider_set = merge_providers(*provider_set)","sourceCodeStart":1655,"sourceCodeEnd":1691,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/yaml/yaml_provider.py#L1655-L1691","documentation":"When a provider spec uses 'include', parse_providers recursively calls load_providers on the included file. If that nested load fails for any reason, the exception is wrapped in a ValueError that names the include file, the including file, and the line of the include directive, chained from the original exception.","triggerScenarios":"An 'include: path.yaml' directive where the included file is missing, unreadable, malformed YAML, or itself fails provider validation (e.g. not a list).","commonSituations":"Relative include paths resolved incorrectly against the parent file's location, typos in the include path, or cascading failures when an included file was edited and broke.","solutions":["Read the chained 'Caused by' exception for the root cause.","Fix the path in the include directive relative to the including provider file's location.","Verify the included file exists, is readable, and has a top-level list of provider specs.","Load the included file standalone with load_providers() to isolate the failure."],"exampleFix":"# before\n- include: ./providrs.yaml\n\n# after\n- include: ./providers.yaml","handlingStrategy":"try-catch","validationCode":"import os, yaml\ninc = spec['include']\nfull = os.path.join(os.path.dirname(source_path), inc)\nif not os.path.exists(full):\n    raise FileNotFoundError(f'included provider file missing: {full}')","typeGuard":null,"tryCatchPattern":"try:\n    yield from load_providers(include_path)\nexcept ValueError as e:\n    logging.error('Include failed (check nested cause): %s', e.__cause__)\n    raise","preventionTips":["Use paths relative to the including file","Load included files standalone before wiring them in","Keep included files valid lists of provider specs"],"tags":["yaml","python","apache-beam","provider-config","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}