{"record":{"id":"897a391b82aa6a22","repo":"crewAIInc/crewAI","slug":"project-name-is-required-to-update-a-zip-deploymen","errorCode":null,"errorMessage":"project_name is required to update a ZIP deployment","messagePattern":"project_name is required to update a ZIP deployment","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/cli/src/crewai_cli/deploy/main.py","lineNumber":484,"sourceCode":"            self._confirm_zip_input(env_vars, confirm)\n            console.print(\"Uploading project ZIP...\", style=\"bold blue\")\n            return self.plus_api_client.create_crew_from_zip(\n                zip_file_path,\n                name=self.project_name,\n                env=env_vars,\n            )\n        finally:\n            zip_file_path.unlink(missing_ok=True)\n\n    def _update_crew_from_zip(\n        self,\n        uuid: str,\n        repository: git.Repository | None,\n        env_vars: dict[str, str],\n    ) -> Any:\n        \"\"\"Update an existing deployment by uploading a project ZIP archive.\"\"\"\n        if not self.project_name:\n            raise ValueError(\"project_name is required to update a ZIP deployment\")\n\n        console.print(\"Preparing project ZIP...\", style=\"bold blue\")\n        zip_file_path = create_project_zip(self.project_name, repository=repository)\n        try:\n            console.print(\"Uploading project ZIP...\", style=\"bold blue\")\n            return self.plus_api_client.update_crew_from_zip(\n                uuid,\n                zip_file_path,\n                env=env_vars,\n            )\n        finally:\n            zip_file_path.unlink(missing_ok=True)\n\n    def _confirm_input(\n        self, env_vars: dict[str, str], remote_repo_url: str, confirm: bool\n    ) -> None:\n        \"\"\"\n        Confirm input parameters with the user.","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/cli/src/crewai_cli/deploy/main.py#L466-L502","documentation":"Raised by CrewAI CLI's deployment command when _update_crew_from_zip is called on a deployment whose project_name attribute is empty or None. The ZIP update flow needs a project directory name to build the archive via create_project_zip, so an empty name cannot proceed. It surfaces as an uncaught ValueError from `crewai deploy update` (ZIP mode).","triggerScenarios":"Running `crewai deploy update <uuid> --zip` (or the plus-api ZIP update path) from a directory where the CLI failed to detect a project name, or calling DeploymentCommand._update_crew_from_zip directly with project_name unset (e.g. the CrewAI object was constructed without a valid pyproject.toml/package name).","commonSituations":"Running the deploy command outside a crew project root (no pyproject.toml), a pyproject.toml missing the crewai project metadata, or a renamed/moved project directory so name auto-detection returns empty.","solutions":["Verify you are in the project root that contains the pyproject.toml used at creation time and re-run `crewai deploy update <uuid> --zip`","Check that pyproject.toml still exposes a valid project name; fix or restore it if the file was renamed/edited","If invoking DeploymentCommand programmatically, pass the project name explicitly (e.g. via the constructor/CrewAI object) so self.project_name is set before calling update"],"exampleFix":"# before\ncrew.update_crew_from_zip(uuid=uuid, repository=repo, env_vars=env)\n# after (ensure project name resolves first)\nif not crew.project_name:\n    raise SystemExit(\"Run this from the project root containing pyproject.toml\")\ncrew.update_crew_from_zip(uuid=uuid, repository=repo, env_vars=env)","handlingStrategy":"validation","validationCode":"from pathlib import Path\nimport tomllib\n\ndef project_name_resolves(root: str = \".\") -> bool:\n    py = Path(root) / \"pyproject.toml\"\n    if not py.exists():\n        return False\n    data = tomllib.loads(py.read_text())\n    return bool(data.get(\"project\", {}).get(\"name\") or data.get(\"tool\", {}).get(\"poetry\", {}).get(\"name\"))","typeGuard":null,"tryCatchPattern":"try:\n    deployment.update_crew_from_zip(uuid=uuid, repository=repo, env_vars=env)\nexcept ValueError as e:\n    if \"project_name is required\" in str(e):\n        raise SystemExit(\"Run from the crew project root (pyproject.toml required)\") from e\n    raise","preventionTips":["Always run deploy commands from the directory containing pyproject.toml","Keep the project name field present and non-empty in pyproject.toml","In scripts, assert cmd.project_name is truthy before any deploy call"],"tags":["cli","deployment","validation","zip"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}