{"record":{"id":"8218d58764af8d8f","repo":"testcontainers/testcontainers-java","slug":"bucket-quota-cannot-be-less-than-100mb","errorCode":null,"errorMessage":"Bucket quota cannot be less than 100MB!","messagePattern":"Bucket quota cannot be less than 100MB!","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/couchbase/src/main/java/org/testcontainers/couchbase/BucketDefinition.java","lineNumber":77,"sourceCode":"     * Enables flush for this bucket (disabled by default).\n     *\n     * @param flushEnabled if true, the bucket can be flushed.\n     * @return this {@link BucketDefinition} for chaining purposes.\n     */\n    public BucketDefinition withFlushEnabled(final boolean flushEnabled) {\n        this.flushEnabled = flushEnabled;\n        return this;\n    }\n\n    /**\n     * Sets a custom bucket quota (100MiB by default).\n     *\n     * @param quota the quota to set for the bucket in mebibytes.\n     * @return this {@link BucketDefinition} for chaining purposes.\n     */\n    public BucketDefinition withQuota(final int quota) {\n        if (quota < 100) {\n            throw new IllegalArgumentException(\"Bucket quota cannot be less than 100MB!\");\n        }\n        this.quota = quota;\n        return this;\n    }\n\n    /**\n     * Allows to disable creating a primary index for this bucket (enabled by default).\n     *\n     * @param create if false, a primary index will not be created.\n     * @return this {@link BucketDefinition} for chaining purposes.\n     */\n    public BucketDefinition withPrimaryIndex(final boolean create) {\n        this.queryPrimaryIndex = create;\n        return this;\n    }\n\n    public String getName() {\n        return name;","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/modules/couchbase/src/main/java/org/testcontainers/couchbase/BucketDefinition.java#L59-L95","documentation":"BucketDefinition.withQuota rejects quota values below 100 MiB with an IllegalArgumentException. Couchbase enforces a 100MB minimum memory quota per bucket, so a smaller value would fail server-side; Testcontainers fails fast instead. The unit is mebibytes.","triggerScenarios":"Calling bucketDefinition.withQuota(q) with q < 100, e.g. withQuota(50).","commonSituations":"Setting a small quota to save memory on a dev machine; mixing up MB and GB units; assuming the same minimum as another database.","solutions":["Pass a quota of at least 100 (MiB).","If memory-constrained, create fewer buckets each at 100 MiB rather than shrinking below the minimum.","Note Couchbase Server's cluster-level minimum bucket quota may be higher on some versions; use >= 100 and increase if the server rejects it."],"exampleFix":"// before\nnew BucketDefinition(\"mybucket\").withQuota(50)\n// after\nnew BucketDefinition(\"mybucket\").withQuota(100)","handlingStrategy":"validation","validationCode":"if (quotaMb < 100) {\n    throw new IllegalArgumentException(\"quota must be >= 100 MiB\");\n}\nbucket.withQuota(quotaMb);","typeGuard":null,"tryCatchPattern":"try {\n    bucket.withQuota(q);\n} catch (IllegalArgumentException e) {\n    bucket.withQuota(100);\n}","preventionTips":["Treat 100 MiB as the hard floor for bucket quota.","Watch units: the API expects mebibytes, not bytes or GB.","Prefer fewer buckets over sub-minimum quotas on memory-constrained hosts."],"tags":["testcontainers","couchbase","validation","quota"],"backgroundTag":"value-out-of-range","analyzedSha":"8e549514e3f01c57d70546fbb8599d138f3903e5","analyzedAt":"2026-09-12T14:56:41.227Z","contentChangedAt":"2026-09-12T14:56:41.227Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}