{"record":{"id":"7613574b8ad2fa40","repo":"apache/beam","slug":"message-specifies-an-invalid-destination-dest-please-make","errorCode":null,"errorMessage":"{message} specifies an invalid destination '{dest}'. Please make sure the destination is an existing directory.","messagePattern":"(.+?) specifies an invalid destination '(.+?)'\\. Please make sure the destination is an existing directory\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/gen_xlang_wrappers.py","lineNumber":201,"sourceCode":"        f\"# configuration in {input_services.replace(PROJECT_ROOT, '')}.\\n\")\n    f.write(\"# Refer to gen_xlang_wrappers.py for more info.\\n\")\n    dt = datetime.datetime.now().date()\n    f.write(f\"#\\n# Last updated on: {dt}\\n\\n\")\n    yaml.dump(transform_list, f)\n  logging.info(\"Successfully wrote transform configs to file: %s\", output_file)\n\n\ndef validate_sdks_destinations(sdk, dest, service, identifier=None):\n  if identifier:\n    message = f\"Identifier '{identifier}'\"\n  else:\n    message = f\"Service '{service}'\"\n  if sdk not in SUPPORTED_SDK_DESTINATIONS:\n    raise ValueError(\n        message + \" specifies a destination for an invalid SDK:\"\n        f\" '{sdk}'. The supported SDKs are {SUPPORTED_SDK_DESTINATIONS}\")\n  if not os.path.isdir(os.path.join(PYTHON_SDK_ROOT, *dest.split('/'))):\n    raise ValueError(\n        message + f\" specifies an invalid destination '{dest}'.\"\n        \" Please make sure the destination is an existing directory.\")\n\n\ndef pretty_type(tp):\n  \"\"\"\n  Takes a type and returns a tuple containing a pretty string representing it\n  and a bool signifying if it is nullable or not.\n\n  For optional types, the contained type is unwrapped and returned. This does\n  not recurse however, so inner Optional types are not affected.\n  E.g. the input typing.Optional[typing.Dict[int, typing.Optional[str]]] will\n  return (Dict[int, Union[str, NoneType]], True)\n  \"\"\"\n  nullable = False\n  if (typing.get_origin(tp) is Union and type(None) in typing.get_args(tp)):\n    nullable = True\n    # only unwrap if it's a single nullable type. if the type is truly a union","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/gen_xlang_wrappers.py#L183-L219","documentation":"validate_sdks_destinations verifies that each destination path exists as a directory under PYTHON_SDK_ROOT. If os.path.isdir fails for the configured destination, ValueError reports the invalid destination so wrappers are not written to nonexistent locations.","triggerScenarios":"A destinations entry maps an SDK to a path that does not exist under sdks/python (wrong path, renamed directory, or created only after generation) during generate_transforms_config.","commonSituations":"Directory restructures that invalidate configured paths; typos in destination paths; pointing at directories outside sdks/python.","solutions":["Fix the destination path in the YAML so it matches an existing directory under sdks/python.","Create the missing directory if it is genuinely the intended output location (git add with a placeholder if needed).","Re-run gen_xlang_wrappers.py after correcting."],"exampleFix":"// before\n  destinations:\n    python: sdks/python/apache_beam/transforms/xlang\n// after\n  destinations:\n    python: sdks/python/apache_beam/transforms","handlingStrategy":"validation","validationCode":"import os\nfrom gen_xlang_wrappers import PYTHON_SDK_ROOT\nfor svc in services:\n    for sdk, dest in svc['destinations'].items():\n        assert os.path.isdir(os.path.join(PYTHON_SDK_ROOT, *dest.split('/'))), \\\n            f\"destination does not exist: {dest}\"","typeGuard":"def destination_exists(dest):\n    import os\n    from gen_xlang_wrappers import PYTHON_SDK_ROOT\n    return os.path.isdir(os.path.join(PYTHON_SDK_ROOT, *dest.split('/')))","tryCatchPattern":"try:\n    generate_transforms_config(services_yaml, ...)\nexcept ValueError as e:\n    if 'invalid destination' in str(e):\n        print('Fix the destination path or create the directory')","preventionTips":["Verify destination directories exist before editing the services YAML.","Commit empty output directories (with .gitkeep) if paths are new.","Re-check paths after any sdks/python directory restructuring."],"tags":["yaml","validation","path","code-generation"],"backgroundTag":"directory-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"}