Couchbase "bucket ... not found" / does not exist in CI
Couchbase fails to open a bucket that does not exist on the cluster. A freshly initialized CI node has no buckets unless you create them, so opening app before creating it returns a bucket-not-found error.
What this error means
The SDK fails opening the bucket with a message that the bucket was not found, or couchbase-cli reports the bucket does not exist on the cluster.
ERROR: Bucket not found
Specified bucket "app" does not exist on the clusterCommon causes
The bucket was never created
After cluster-init, no buckets exist until bucket-create runs; opening one before that fails.
The bucket name does not match the app config
The setup created one bucket name while the test opens another, so the lookup fails.
How to fix it
Create the bucket before opening it
- Run
couchbase-cli bucket-createin setup. - Wait until the bucket is ready.
- Use the exact same bucket name in the test.
couchbase-cli bucket-create -c 127.0.0.1 \
-u Administrator -p password \
--bucket app --bucket-type couchbase --bucket-ramsize 256Align the bucket name in the app
Make the SDK open the same bucket the setup created.
bucket = cluster.bucket("app")How to prevent it
- Create buckets in setup before tests open them.
- Use one bucket name in setup and the app.
- Wait for the bucket to be ready before bootstrapping.