{"record":{"id":"66974faee52dd953","repo":"crewAIInc/crewAI","slug":"bucket-self-bucket-name-does-not-exist-please","errorCode":null,"errorMessage":"Bucket {self.bucket_name} does not exist.  Please create the bucket before searching.","messagePattern":"Bucket (.+?) does not exist\\.  Please create the bucket before searching\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/couchbase_tool/couchbase_tool.py","lineNumber":162,"sourceCode":"        Raises:\n            ValueError: If required parameters are missing, the Couchbase cluster\n                        cannot be reached, or the specified bucket, scope,\n                        collection, or index does not exist.\n        \"\"\"\n        super().__init__(**kwargs)\n        if COUCHBASE_AVAILABLE:\n            try:\n                self._bucket = self.cluster.bucket(self.bucket_name)\n                self._scope = self._bucket.scope(self.scope_name)\n                self._collection = self._scope.collection(self.collection_name)\n            except Exception as e:\n                raise ValueError(\n                    \"Error connecting to couchbase. \"\n                    \"Please check the connection and credentials\"\n                ) from e\n\n            if not self._check_bucket_exists():\n                raise ValueError(\n                    f\"Bucket {self.bucket_name} does not exist. \"\n                    \" Please create the bucket before searching.\"\n                )\n\n            self._check_scope_and_collection_exists()\n            self._check_index_exists()\n        else:\n            import click\n\n            if click.confirm(\n                \"The 'couchbase' package is required to use the CouchbaseFTSVectorSearchTool. \"\n                \"Would you like to install it?\"\n            ):\n                import subprocess\n\n                subprocess.run([\"uv\", \"add\", \"couchbase\"], check=True)  # noqa: S607\n            else:\n                raise ImportError(","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/couchbase_tool/couchbase_tool.py#L144-L180","documentation":"CouchbaseFTSVectorSearchTool raises this ValueError during __init__ after it successfully connects and authenticates to the Couchbase cluster, but before searching, when _check_bucket_exists() reports the configured bucket_name is not present on the cluster. The tool needs the bucket (plus its scope/collection and a search index) to run vector queries. It means your connection string and credentials are fine; the bucket itself is the problem.","triggerScenarios":"Instantiating CouchbaseFTSVectorSearchTool(bucket_name=\"travel-sample\", ...) against a cluster where that bucket was dropped or never created, or where the bucket name has a typo/case mismatch. Also happens when connecting to the wrong cluster/environment (e.g. production connection string in a dev run) or when using Capella with a bucket that exists in another project.","commonSituations":"Typo in bucket_name; bucket deleted by a teammate or cleanup job; connecting to the wrong Capella project/cluster via CREWAI env vars or connection string; assuming the travel-sample bucket is loaded when the cluster is fresh.","solutions":["Open the Couchbase UI (or Capella console) for the cluster you are connecting to and confirm the bucket exists; create it or load the travel-sample dataset if that is what you intended.","Double-check the exact bucket_name string (case-sensitive) passed to CouchbaseFTSVectorSearchTool against the cluster.","Verify your connection string / credentials point at the cluster that actually holds the bucket (dev vs prod vs Capella project).","Create the bucket programmatically: cluster.bucket_manager().create_bucket(CreateBucketSettings(name=\"...\", ram_quota_mb=100)) before instantiating the tool."],"exampleFix":"# before\ntool = CouchbaseFTSVectorSearchTool(\n    bucket_name=\"Travel-Sample\",  # wrong case; bucket is 'travel-sample'\n    ...\n)\n\n# after\ntool = CouchbaseFTSVectorSearchTool(\n    bucket_name=\"travel-sample\",\n    ...\n)","handlingStrategy":"validation","validationCode":"from couchbase.cluster import Cluster\n\ndef bucket_exists(cluster: \"Cluster\", bucket_name: str) -> bool:\n    try:\n        return any(b.name == bucket_name for b in cluster.buckets().get_all())\n    except Exception:\n        return False\n\n# before constructing the tool:\nassert bucket_exists(cluster, \"travel-sample\"), \"create the bucket first\"","typeGuard":null,"tryCatchPattern":"try:\n    tool = CouchbaseFTSVectorSearchTool(bucket_name=b, ...)\nexcept ValueError as e:\n    if \"does not exist\" in str(e):\n        # create bucket or fix name, then retry construction\n        ...\n    raise","preventionTips":["Provision buckets (or load travel-sample) as part of environment setup before agent startup.","Keep bucket names in one config source so typos cannot diverge from the cluster.","Run a startup health check that lists buckets and fails fast with a clear message."],"tags":["couchbase","configuration","vector-search","database","init"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}