crewAIInc/crewAI · error · ValueError

Scope not found in Couchbase bucket

Error message

Scope {self.scope_name} not found in Couchbase bucket {self.bucket_name}

What it means

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

Solutions

  1. Create the scope in the Couchbase bucket before searching.
  2. Check the scope name spelling in your tool configuration.

When it happens

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

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


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

Appendix: source

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

            bucket_manager.get_bucket(self.bucket_name)
            return True
        except Exception:
            return False

    def _check_scope_and_collection_exists(self) -> bool:
        """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 = [

View on GitHub (pinned to 754d7323be)