{"record":{"id":"9104049815f4768a","repo":"crewAIInc/crewAI","slug":"collection-self-collection-name-not-found-in-sco","errorCode":null,"errorMessage":"Collection {self.collection_name} not found in scope {self.scope_name} in Couchbase bucket {self.bucket_name}","messagePattern":"Collection (.+?) not found in scope (.+?) 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":100,"sourceCode":"        \"\"\"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 = [\n                index.name for index in self._scope.search_indexes().get_all_indexes()\n            ]\n            if self.index_name not in all_indexes:\n                raise ValueError(\n                    f\"Index {self.index_name} does not exist. \"\n                    \" Please create the index before searching.\"","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/couchbase_tool/couchbase_tool.py#L82-L118","documentation":"Error \"Collection {self.collection_name} not found in scope {self.scope_name} 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:100 when the library encounters an invalid state.","commonSituations":"Occurs when the configured collection does not exist in the Couchbase scope. Create the collection or correct the collection name in the tool configuration.","solutions":["Create the collection in the specified scope before searching.","Check the collection 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"}