{"record":{"id":"b066794175449aa2","repo":"apache/beam","slug":"external-transform-wrappers-have-not-been-generated-and-the","errorCode":null,"errorMessage":"External transform wrappers have not been generated and the generation script `gen_xlang_wrappers.py` and/or the standard external transforms config could not be found","messagePattern":"External transform wrappers have not been generated and the generation script `gen_xlang_wrappers\\.py` and/or the standard external transforms config could not be found","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"sdks/python/setup.py","lineNumber":304,"sourceCode":"        os.path.join(\n            os.path.dirname(sdk_dir), 'standard_external_transforms.yaml'))\n    # we need both the script and the standard transforms config file.\n    # at build time, we don't have access to apache_beam to discover and\n    # retrieve external transforms, so the config file has to already exist\n    if not script_exists or not config_exists:\n      generated_transforms_dir = os.path.join(\n          sdk_dir, 'apache_beam', 'transforms', 'xlang')\n\n      # if exists, this directory will have at least its __init__.py file\n      if (not os.path.exists(generated_transforms_dir) or\n          len(os.listdir(generated_transforms_dir)) <= 1):\n        message = 'External transform wrappers have not been generated '\n        if not script_exists:\n          message += 'and the generation script `gen_xlang_wrappers.py`'\n        if not config_exists:\n          message += 'and the standard external transforms config'\n        message += ' could not be found'\n        raise RuntimeError(message)\n      else:\n        logging.info(\n            'Skipping external transform wrapper generation as they '\n            'are already generated.')\n      return\n    subprocess.run([\n        sys.executable,\n        os.path.join(sdk_dir, 'gen_xlang_wrappers.py'),\n        '--cleanup',\n        '--transforms-config-source',\n        os.path.join(\n            os.path.dirname(sdk_dir), 'standard_external_transforms.yaml')\n    ],\n                   capture_output=True,\n                   check=True)\n  except subprocess.CalledProcessError as err:\n    raise RuntimeError(\n        'Could not generate external transform wrappers due to '","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/setup.py#L286-L322","documentation":"setup.py's generate_external_transform_wrappers checks for both the gen_xlang_wrappers.py script and the standard external transforms config YAML. If wrappers haven't been generated and either file is missing, it raises RuntimeError naming whichever pieces could not be found, because it cannot create the wrapper modules needed for cross-language transforms.","triggerScenarios":"Building apache_beam from a source tree missing sdks/python/gen_xlang_wrappers.py or the sibling standard_external_transforms.yaml, with no pre-generated wrapper modules present under apache_beam/transforms/xlang_wrapper (or equivalent).","commonSituations":"Partial/incomplete checkouts or sdists; files deleted by clean scripts; building a slimmed-down fork where the YAML config was removed; wrong sdk_dir resolution pointing at a nonexistent path.","solutions":["Restore the missing file: git checkout -- sdks/python/gen_xlang_wrappers.py and/or standard_external_transforms.yaml","Generate wrappers first by running gen_xlang_wrappers.py directly so the skip branch succeeds","Build from a complete Beam source tree or use the released sdist which includes generated wrappers","Fix path resolution if sdk_dir is computed incorrectly in your environment"],"exampleFix":"# before\n$ python setup.py build\nRuntimeError: External transform wrappers have not been generated ... could not be found\n# after\n$ git checkout -- sdks/python/gen_xlang_wrappers.py standard_external_transforms.yaml\n$ python sdks/python/gen_xlang_wrappers.py\n$ python setup.py build","handlingStrategy":"validation","validationCode":"import os\nscript = os.path.join(sdk_dir, 'gen_xlang_wrappers.py')\nconfig = os.path.join(os.path.dirname(sdk_dir), 'standard_external_transforms.yaml')\nassert os.path.exists(script) and os.path.exists(config), 'xlang wrapper inputs missing'\nassert glob.glob(os.path.join(sdk_dir, 'apache_beam', 'transforms', 'xlang_wrapper*')), 'wrappers not generated'","typeGuard":null,"tryCatchPattern":"try:\n    build()\nexcept RuntimeError as e:\n    if 'External transform wrappers have not been generated' in str(e):\n        restore_missing_files_or_run_gen_xlang_wrappers()\n        build()\n    else:\n        raise","preventionTips":["Build from a complete Beam checkout (verify with git status)","Don't git-clean files matching gen_xlang_wrappers.py or the transforms YAML","Run gen_xlang_wrappers.py once before repeated offline builds"],"tags":["python","build","xlang","missing-file"],"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-20T03:17:13.778Z"}