{"record":{"id":"2950576cd8a7ccfd","repo":"testcontainers/testcontainers-java","slug":"the-analytics-service-is-only-supported-with-the-enterprise","errorCode":null,"errorMessage":"The Analytics Service is only supported with the Enterprise version","messagePattern":"The Analytics Service is only supported with the Enterprise version","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"modules/couchbase/src/main/java/org/testcontainers/couchbase/CouchbaseContainer.java","lineNumber":395,"sourceCode":"        new HttpWaitStrategy().forPort(MGMT_PORT).forPath(\"/pools\").forStatusCode(200).waitUntilReady(this);\n    }\n\n    /**\n     * Fetches edition (enterprise or community) of started container.\n     */\n    private void initializeIsEnterprise() {\n        @Cleanup\n        Response response = doHttpRequest(MGMT_PORT, \"/pools\", \"GET\", null, true);\n\n        try {\n            isEnterprise = MAPPER.readTree(response.body().string()).get(\"isEnterprise\").asBoolean();\n        } catch (IOException e) {\n            throw new IllegalStateException(\"Couchbase /pools did not return valid JSON\");\n        }\n\n        if (!isEnterprise) {\n            if (enabledServices.contains(CouchbaseService.ANALYTICS)) {\n                throw new IllegalStateException(\"The Analytics Service is only supported with the Enterprise version\");\n            }\n            if (enabledServices.contains(CouchbaseService.EVENTING)) {\n                throw new IllegalStateException(\"The Eventing Service is only supported with the Enterprise version\");\n            }\n        }\n    }\n\n    /**\n     * Initializes the {@link #hasTlsPorts} flag.\n     * <p>\n     * Community Edition might support TLS one happy day, so use a \"supports TLS\" flag separate from\n     * the \"enterprise edition\" flag.\n     */\n    private void initializeHasTlsPorts() {\n        @Cleanup\n        Response response = doHttpRequest(MGMT_PORT, \"/pools/default/nodeServices\", \"GET\", null, true);\n\n        try {","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/modules/couchbase/src/main/java/org/testcontainers/couchbase/CouchbaseContainer.java#L377-L413","documentation":"initializeIsEnterprise() determines whether the running image is Couchbase Enterprise by reading isEnterprise from /pools. If it is the Community edition and the ANALYTICS service was requested via withServiceQuota/withServices, the container throws IllegalStateException, because the Analytics Service exists only in Enterprise Edition.","triggerScenarios":"Building a CouchbaseContainer from a Community image (e.g. couchbase:community) while calling .withServiceQuota(CouchbaseService.ANALYTICS, quota) or enabling ANALYTICS in the service set.","commonSituations":"Switching the image to a community tag to avoid licensing; CI images pinned to community; forgetting ANALYTICS was enabled when downgrading images.","solutions":["Use an Enterprise Edition image, e.g. couchbase:enterprise-7.x.","Remove ANALYTICS from the enabled services / delete the withServiceQuota(CouchbaseService.ANALYTICS, ...) call.","If Analytics is needed but only Community is allowed, redesign the test to not use the Analytics Service."],"exampleFix":"// before\nnew CouchbaseContainer(DockerImageName.parse(\"couchbase:community-7.0.2\"))\n    .withServiceQuota(CouchbaseService.ANALYTICS, 1024)\n// after\nnew CouchbaseContainer(DockerImageName.parse(\"couchbase:enterprise-7.1.1\"))\n    .withServiceQuota(CouchbaseService.ANALYTICS, 1024)","handlingStrategy":"validation","validationCode":"if (!image.contains(\"enterprise\") && services.contains(CouchbaseService.ANALYTICS)) {\n    throw new IllegalStateException(\"ANALYTICS requires an Enterprise image\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    container.start();\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"Analytics Service is only supported with the Enterprise\")) {\n        // rebuild container without ANALYTICS or with an enterprise image\n    } else {\n        throw e;\n    }\n}","preventionTips":["Pair service requirements with the image edition in one config object.","Avoid blindly enabling all services.","Document licensing constraints (Analytics/Eventing = Enterprise) in test infrastructure."],"tags":["testcontainers","couchbase","licensing","configuration"],"backgroundTag":"conflicting-config-options","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"}