testcontainers/testcontainers-java · error · IllegalStateException
The Analytics Service is only supported with the Enterprise…
Error message
The Analytics Service is only supported with the Enterprise version
What it means
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.
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.
Example fix
// before
new CouchbaseContainer(DockerImageName.parse("couchbase:community-7.0.2"))
.withServiceQuota(CouchbaseService.ANALYTICS, 1024)
// after
new CouchbaseContainer(DockerImageName.parse("couchbase:enterprise-7.1.1"))
.withServiceQuota(CouchbaseService.ANALYTICS, 1024) Defensive patterns
Strategy: validation
Validate before calling
if (!image.contains("enterprise") && services.contains(CouchbaseService.ANALYTICS)) {
throw new IllegalStateException("ANALYTICS requires an Enterprise image");
} Try / catch
try {
container.start();
} catch (IllegalStateException e) {
if (e.getMessage().contains("Analytics Service is only supported with the Enterprise")) {
// rebuild container without ANALYTICS or with an enterprise image
} else {
throw e;
}
} Prevention
- 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.
When it happens
Trigger: Building a CouchbaseContainer from a Community image (e.g. couchbase:community) while calling .withServiceQuota(CouchbaseService.ANALYTICS, quota) or enabling ANALYTICS in the service set.
Common situations: Switching the image to a community tag to avoid licensing; CI images pinned to community; forgetting ANALYTICS was enabled when downgrading images.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- The Eventing Service is only supported with the Enterprise…
- The provided service (service) has no quota to configure
- Changing startup timeout is not supported with mode
- Unexpected scheme
- Setting a in not supported in the versions below 22.1.0
AI-assisted analysis of testcontainers/testcontainers-java@8e549514e3 (2026-09-12).
Data as JSON: /api/errors/2950576cd8a7ccfd.
Report an issue: GitHub.
Appendix: source
Thrown at modules/couchbase/src/main/java/org/testcontainers/couchbase/CouchbaseContainer.java:395
new HttpWaitStrategy().forPort(MGMT_PORT).forPath("/pools").forStatusCode(200).waitUntilReady(this);
}
/**
* Fetches edition (enterprise or community) of started container.
*/
private void initializeIsEnterprise() {
@Cleanup
Response response = doHttpRequest(MGMT_PORT, "/pools", "GET", null, true);
try {
isEnterprise = MAPPER.readTree(response.body().string()).get("isEnterprise").asBoolean();
} catch (IOException e) {
throw new IllegalStateException("Couchbase /pools did not return valid JSON");
}
if (!isEnterprise) {
if (enabledServices.contains(CouchbaseService.ANALYTICS)) {
throw new IllegalStateException("The Analytics Service is only supported with the Enterprise version");
}
if (enabledServices.contains(CouchbaseService.EVENTING)) {
throw new IllegalStateException("The Eventing Service is only supported with the Enterprise version");
}
}
}
/**
* Initializes the {@link #hasTlsPorts} flag.
* <p>
* Community Edition might support TLS one happy day, so use a "supports TLS" flag separate from
* the "enterprise edition" flag.
*/
private void initializeHasTlsPorts() {
@Cleanup
Response response = doHttpRequest(MGMT_PORT, "/pools/default/nodeServices", "GET", null, true);
try {View on GitHub (pinned to 8e549514e3)