{"record":{"id":"44c2891cf19fc5b6","repo":"langchain-ai/langgraph","slug":"invalid-build-tool-pack-must-be-one-of-j","errorCode":null,"errorMessage":"Invalid build tool: {pack}; must be one of {', '.join(_BUILD_TOOLS)}","messagePattern":"Invalid build tool: (.+?); must be one of (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/cli/langgraph_cli/config.py","lineNumber":106,"sourceCode":"\n\ndef _get_pip_cleanup_lines(\n    install_cmd: str,\n    to_uninstall: tuple[str] | None,\n    pip_installer: Literal[\"uv\", \"pip\"],\n) -> str:\n    commands = [\n        f\"\"\"# -- Ensure user deps didn't inadvertently overwrite langgraph-api\nRUN mkdir -p /api/langgraph_api /api/langgraph_runtime /api/langgraph_license && \\\ntouch /api/langgraph_api/__init__.py /api/langgraph_runtime/__init__.py /api/langgraph_license/__init__.py\nRUN PYTHONDONTWRITEBYTECODE=1 {install_cmd} --no-cache-dir --no-deps -e /api\n# -- End of ensuring user deps didn't inadvertently overwrite langgraph-api --\n# -- Removing build deps from the final image ~<:===~~~ --\"\"\"\n    ]\n    if to_uninstall:\n        for pack in to_uninstall:\n            if pack not in _BUILD_TOOLS:\n                raise ValueError(\n                    f\"Invalid build tool: {pack}; must be one of {', '.join(_BUILD_TOOLS)}\"\n                )\n        packs_str = \" \".join(sorted(to_uninstall))\n        commands.append(f\"RUN pip uninstall -y {packs_str}\")\n        # Ensure the directories are removed entirely\n        packages_rm = \" \".join(\n            f\"/usr/local/lib/python*/site-packages/{pack}*\" for pack in to_uninstall\n        )\n        if \"pip\" in to_uninstall:\n            packages_rm += ' && find /usr/local/bin -name \"pip*\" -delete || true'\n        commands.append(f\"RUN rm -rf {packages_rm}\")\n        wolfi_packages_rm = \" \".join(\n            f\"/usr/lib/python*/site-packages/{pack}*\" for pack in to_uninstall\n        )\n        if \"pip\" in to_uninstall:\n            wolfi_packages_rm += ' && find /usr/bin -name \"pip*\" -delete || true'\n        commands.append(f\"RUN rm -rf {wolfi_packages_rm}\")\n        if pip_installer == \"uv\":","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/cli/langgraph_cli/config.py#L88-L124","documentation":"Validation in the CLI's Dockerfile generator (via _get_pip_cleanup_lines / keep_pkg_tools handling): a value in the keep_pkg_tools list is not one of the recognized build tools 'pip', 'setuptools', 'wheel' (_BUILD_TOOLS). The offending tool name and the allowed set are printed; unknown values would leave broken cleanup RUN lines in the generated image.","triggerScenarios":"Thrown at libs/cli/langgraph_cli/config.py:106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set keep_pkg_tools to a subset of ['pip','setuptools','wheel'], e.g. keep_pkg_tools: ['pip','setuptools']","Use a boolean (true) to keep all three tools if you need any of them at runtime","Remove misspelled entries from the keep_pkg_tools array in langgraph.json"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","contentChangedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}