testcontainers/testcontainers-java · error · IllegalStateException

The Eventing Service is only supported with the Enterprise…

Error message

The Eventing Service is only supported with the Enterprise version

What it means

initializeIsEnterprise() reads isEnterprise from the /pools management endpoint; when the edition is Community and the EVENTING service was requested, the container throws IllegalStateException because the Eventing Service is Enterprise-only, analogous to the Analytics check.

Solutions

  1. Switch to an Enterprise Edition image tag (couchbase:enterprise-...).
  2. Remove EVENTING from the enabled services and any withServiceQuota(CouchbaseService.EVENTING, ...) call.
  3. Restructure the test so eventing behavior is covered against an Enterprise-based environment.

Example fix

// before
new CouchbaseContainer("couchbase:community-7.0.2")
    .withServiceQuota(CouchbaseService.EVENTING, 512)
// after
new CouchbaseContainer("couchbase:enterprise-7.1.1")
    .withServiceQuota(CouchbaseService.EVENTING, 512)
Defensive patterns

Strategy: validation

Validate before calling

if (!image.contains("enterprise") && services.contains(CouchbaseService.EVENTING)) {
    throw new IllegalStateException("EVENTING requires an Enterprise image");
}

Try / catch

try {
    container.start();
} catch (IllegalStateException e) {
    if (e.getMessage().contains("Eventing Service is only supported with the Enterprise")) {
        // rebuild container without EVENTING or with an enterprise image
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Using a Community couchbase image while calling .withServiceQuota(CouchbaseService.EVENTING, ...) or otherwise adding EVENTING to the enabled services.

Common situations: Community images in CI to avoid licensing; enabling all services by default; image tag downgrades that silently switch to Community.

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


AI-assisted analysis of testcontainers/testcontainers-java@8e549514e3 (2026-09-12). Data as JSON: /api/errors/bd15d24090db419f. Report an issue: GitHub.

Appendix: source

Thrown at modules/couchbase/src/main/java/org/testcontainers/couchbase/CouchbaseContainer.java:398

    /**
     * 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 {
            String clusterTopology = response.body().string();
            hasTlsPorts =
                !MAPPER

View on GitHub (pinned to 8e549514e3)