crewAIInc/crewAI · error · ValueError

Collection not found in scope in Couchbase bucket

Error message

Collection {self.collection_name} not found in scope {self.scope_name} in Couchbase bucket {self.bucket_name}

What it means

Error "Collection {self.collection_name} not found in scope {self.scope_name} in Couchbase bucket {self.bucket_name}" thrown in crewAIInc/crewAI.

Solutions

  1. Create the collection in the specified scope before searching.
  2. Check the collection name spelling in your tool configuration.

When it happens

Trigger: Thrown at lib/crewai-tools/src/crewai_tools/tools/couchbase_tool/couchbase_tool.py:100 when the library encounters an invalid state.

Common situations: Occurs when the configured collection does not exist in the Couchbase scope. Create the collection or correct the collection name in the tool configuration.


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

Appendix: source

Thrown at lib/crewai-tools/src/crewai_tools/tools/couchbase_tool/couchbase_tool.py:100

        """Check if the scope and collection exists in the linked Couchbase bucket
        Raises a ValueError if either is not found.
        """
        scope_collection_map: dict[str, Any] = {}

        for scope in self._bucket.collections().get_all_scopes():
            scope_collection_map[scope.name] = []

            for collection in scope.collections:
                scope_collection_map[scope.name].append(collection.name)

        if self.scope_name not in scope_collection_map:
            raise ValueError(
                f"Scope {self.scope_name} not found in Couchbase "
                f"bucket {self.bucket_name}"
            )

        if self.collection_name not in scope_collection_map[self.scope_name]:
            raise ValueError(
                f"Collection {self.collection_name} not found in scope "
                f"{self.scope_name} in Couchbase bucket {self.bucket_name}"
            )

        return True

    def _check_index_exists(self) -> bool:
        """Check if the Search index exists in the linked Couchbase cluster
        Raises a ValueError if the index does not exist.
        """
        if self.scoped_index:
            all_indexes = [
                index.name for index in self._scope.search_indexes().get_all_indexes()
            ]
            if self.index_name not in all_indexes:
                raise ValueError(
                    f"Index {self.index_name} does not exist. "
                    " Please create the index before searching."

View on GitHub (pinned to 754d7323be)