{"record":{"id":"4ef29eb1137dce7e","repo":"microsoft/autogen","slug":"no-such-file-or-directory-autogen-repo-base","errorCode":null,"errorMessage":"No such file or directory: '{autogen_repo_base}'","messagePattern":"No such file or directory: '(.+?)'","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"python/packages/agbench/src/agbench/run_cmd.py","lineNumber":588,"sourceCode":"\n# Run the global finalize script if it exists\nif [ -f global_finalize.sh ] ; then\n    . ./global_finalize.sh\nfi\n\necho RUN.SH COMPLETE !#!#\n\"\"\"\n        )\n\n    # Figure out what folders to mount\n    volumes = {str(pathlib.Path(work_dir).absolute()): {\"bind\": \"/workspace\", \"mode\": \"rw\"}}\n\n    # Add the autogen repo if we can find it\n    autogen_repo_base = os.environ.get(\"AUTOGEN_REPO_BASE\")\n    if autogen_repo_base is None:\n        autogen_repo_base = find_autogen_repo(os.getcwd())\n    elif not os.path.isdir(autogen_repo_base):\n        raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), autogen_repo_base)\n\n    if autogen_repo_base is None:\n        raise ValueError(\n            \"Could not find AutoGen repo base. Please set the environment variable AUTOGEN_REPO_BASE to the correct value.\"\n        )\n\n    autogen_repo_base = os.path.join(autogen_repo_base, \"python\")\n    volumes[str(pathlib.Path(autogen_repo_base).absolute())] = {\"bind\": \"/autogen_python\", \"mode\": \"rw\"}\n\n    # Add the Docker socket if we are running on Linux\n    # This allows docker-out-of-docker to work, but provides access to the Docker daemon on the host.\n    # This maintains good isolation for experiment purposes (e.g., ensuring consistent initial conditions),\n    # but deminishes the security benefits of using Docker (e.g., when facing a deliberately malicious agent).\n    # since it would allow clients to mount privalaged images, volumes, etc.\n    docker_host = os.environ.get(\"DOCKER_HOST\", \"unix:///var/run/docker.sock\")\n    if docker_host.startswith(\"unix://\"):\n        docker_socket = os.path.abspath(docker_host[7:])\n        if os.path.exists(docker_socket):","sourceCodeStart":570,"sourceCodeEnd":606,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/agbench/src/agbench/run_cmd.py#L570-L606","documentation":"agbench's run command raises FileNotFoundError(ENOENT) when the AUTOGEN_REPO_BASE environment variable is set but does not point to an existing directory. The value is trusted as-is; only when the variable is unset does the code fall back to searching for the repo.","triggerScenarios":"Exporting AUTOGEN_REPO_BASE to a stale, moved, or misspelled path (e.g. pointing at a deleted checkout or a file rather than a directory) and then running the benchmark.","commonSituations":"Repo checkout moved after the env var was set in shell profile/CI, container builds where the mount path differs from the host path, or trailing characters/typos in the export.","solutions":["Verify the directory exists: `ls \"$AUTOGEN_REPO_BASE\"` and fix the export to the actual checkout root (the folder containing the 'python' subdirectory).","If unsure, unset the variable (`unset AUTOGEN_REPO_BASE`) to let the automatic find_autogen_repo() search locate it from cwd.","In CI, derive it dynamically: export AUTOGEN_REPO_BASE=$(git rev-parse --show-toplevel)."],"exampleFix":"# before\nexport AUTOGEN_REPO_BASE=~/src/autogen  # stale path\n\n# after\nexport AUTOGEN_REPO_BASE=\"$(git -C ~/src/autogen rev-parse --show-toplevel)\"\n# or simply:\nunset AUTOGEN_REPO_BASE","handlingStrategy":"validation","validationCode":"import os\nbase = os.environ.get(\"AUTOGEN_REPO_BASE\")\nif base is not None and not os.path.isdir(base):\n    raise SystemExit(f\"AUTOGEN_REPO_BASE={base!r} is not a directory; unset it or fix the path\")","typeGuard":null,"tryCatchPattern":"try:\n    run_benchmark(...)\nexcept FileNotFoundError as e:\n    if e.errno == errno.ENOENT and \"AUTOGEN_REPO_BASE\" in os.environ:\n        sys.exit(\"AUTOGEN_REPO_BASE points to a missing directory; update or unset it\")\n    raise","preventionTips":["Derive AUTOGEN_REPO_BASE from git: export AUTOGEN_REPO_BASE=$(git rev-parse --show-toplevel).","In CI, assert the directory exists in a setup step before running benchmarks."],"tags":["environment","path","docker","agbench"],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}