{"record":{"id":"31d764d6d8d3acff","repo":"crewAIInc/crewAI","slug":"scope-self-scope-name-not-found-in-couchbase-buc","errorCode":null,"errorMessage":"Scope {self.scope_name} not found in Couchbase bucket {self.bucket_name}","messagePattern":"Scope (.+?) not found in Couchbase bucket (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/couchbase_tool/couchbase_tool.py","lineNumber":94,"sourceCode":"            bucket_manager.get_bucket(self.bucket_name)\n            return True\n        except Exception:\n            return False\n\n    def _check_scope_and_collection_exists(self) -> bool:\n        \"\"\"Check if the scope and collection exists in the linked Couchbase bucket\n        Raises a ValueError if either is not found.\n        \"\"\"\n        scope_collection_map: dict[str, Any] = {}\n\n        for scope in self._bucket.collections().get_all_scopes():\n            scope_collection_map[scope.name] = []\n\n            for collection in scope.collections:\n                scope_collection_map[scope.name].append(collection.name)\n\n        if self.scope_name not in scope_collection_map:\n            raise ValueError(\n                f\"Scope {self.scope_name} not found in Couchbase \"\n                f\"bucket {self.bucket_name}\"\n            )\n\n        if self.collection_name not in scope_collection_map[self.scope_name]:\n            raise ValueError(\n                f\"Collection {self.collection_name} not found in scope \"\n                f\"{self.scope_name} in Couchbase bucket {self.bucket_name}\"\n            )\n\n        return True\n\n    def _check_index_exists(self) -> bool:\n        \"\"\"Check if the Search index exists in the linked Couchbase cluster\n        Raises a ValueError if the index does not exist.\n        \"\"\"\n        if self.scoped_index:\n            all_indexes = [","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/couchbase_tool/couchbase_tool.py#L76-L112","documentation":"Error \"Scope {self.scope_name} not found in Couchbase bucket {self.bucket_name}\" thrown in crewAIInc/crewAI.","triggerScenarios":"Thrown at lib/crewai-tools/src/crewai_tools/tools/couchbase_tool/couchbase_tool.py:94 when the library encounters an invalid state.","commonSituations":"Occurs when the configured scope does not exist in the Couchbase bucket. Create the scope or correct the scope name in the tool configuration.","solutions":["Create the scope in the Couchbase bucket before searching.","Check the scope name spelling in your tool configuration."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}