crewAIInc/crewAI · error · ValueError

project_name is required to find a deployment

Error message

project_name is required to find a deployment

What it means

Raised by _check_index_exists when scoped_index is false, a cluster handle IS present, but index_name is not in cluster.search_indexes().get_all_indexes(). Identical message to the scoped branch (line 116) but fired against cluster-level Search indexes; the cluster guard (line 122) has already passed, so the cluster connection itself is fine.

Source

Thrown at lib/cli/src/crewai_cli/deploy/main.py:337

            _display_git_remote_help()
            deployment_uuid = self._deployment_uuid_by_name()
            env_vars = fetch_and_json_env_file()
            response = self._update_crew_from_zip(
                deployment_uuid,
                repository,
                env_vars,
            )
        else:
            self._standard_no_param_error_message()
            return

        self._validate_response(response)
        self._display_deployment_info(response.json())

    def _deployment_uuid_by_name(self) -> str:
        """Resolve the current project's deployment UUID by project name."""
        if not self.project_name:
            raise ValueError("project_name is required to find a deployment")

        response = self.plus_api_client.crew_status_by_name(self.project_name)
        self._validate_response(response)
        json_response = response.json()
        uuid = json_response.get("uuid")
        if not uuid:
            raise ValueError("Deployment status response did not include a uuid")
        return str(uuid)

    def create_crew(
        self,
        confirm: bool = False,
        skip_validate: bool = False,
        source: DeploySource = "cli",
    ) -> None:
        """
        Create a new crew deployment.

View on GitHub (pinned to 754d7323be)

Solutions

  1. List cluster indexes and use an exact name: [i.name for i in cluster.search_indexes().get_all_indexes()].
  2. If the index actually lives in a scope, switch to scoped_index=True with the right scope_name.
  3. Create the missing index via the Couchbase UI (Search -> Add index) or the REST/management API.

Example fix

# before
tool = CouchbaseFTSVectorSearchTool(cluster=cluster, bucket_name='travel', scope_name='inventory', collection_name='hotel', index_name='travel-hotels', scoped_index=False)  # ValueError
# after
# index exists only scoped -> use scoped mode
tool = CouchbaseFTSVectorSearchTool(bucket_name='travel', scope_name='inventory', collection_name='hotel', index_name='travel-hotels', scoped_index=True)
Defensive patterns

Strategy: validation

Validate before calling

names = {i.name for i in cluster.search_indexes().get_all_indexes()}
if index_name not in names:
    raise ValueError(f"index '{index_name}' not found at cluster level; available: {sorted(names)}")

Prevention

When it happens

Trigger: Constructing the tool with scoped_index=False and an index_name that exists nowhere at cluster level — never created, typo'd, or created only as a scoped index.

Common situations: Couchbase 7.6+ scoped Search indexes exist but the tool is looking at cluster-level indexes (or vice versa), index deleted, or wrong cluster environment (dev index name on prod cluster).

Related errors


AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15). Data as JSON: /api/errors/2b83449f825769bf. Report an issue: GitHub.