Skip to content
Latchkey

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.

couchbase-cli
ERROR: Bucket not found
Specified bucket "app" does not exist on the cluster

Common 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

  1. Run couchbase-cli bucket-create in setup.
  2. Wait until the bucket is ready.
  3. Use the exact same bucket name in the test.
Terminal
couchbase-cli bucket-create -c 127.0.0.1 \
  -u Administrator -p password \
  --bucket app --bucket-type couchbase --bucket-ramsize 256

Align the bucket name in the app

Make the SDK open the same bucket the setup created.

python
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.

Frequently asked questions

What causes ""bucket ... not found""?
After cluster-init, no buckets exist until bucket-create runs; opening one before that fails.
How do I fix "bucket ... not found"?
Create the bucket before opening it

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card