testcontainers/testcontainers-java · warning

Version is less than 1.0.0 or not a semantic version.

Error message

Version {} is less than 1.0.0 or not a semantic version.

What it means

ChromaDBContainer.isVersion2 parses the image's version tag with ComparableVersion and returns true only for versions >= 1.0.0 (new Chroma 0.6+ API layout). For pre-1.0.0 or non-semantic version tags it logs this warning and returns false, causing the container to use the legacy API endpoints (api/v1) which will fail against genuinely new images.

Solutions

  1. Pin an explicit semantic version, e.g. chromadb/chroma:1.0.0 or 0.5.5, instead of latest
  2. Upgrade the image tag to >= 1.0.0 if you intend to use the v2 API layout
  3. Use DockerImageName parsing-compatible tags (major.minor.patch) so ComparableVersion can compare them
  4. Update testcontainers chromadb module version if your image is new but misclassified

Example fix

// before
new ChromaDBContainer("chromadb/chroma:latest");
// after
new ChromaDBContainer("chromadb/chroma:1.0.0");
Defensive patterns

Strategy: validation

Validate before calling

String tag = imageName.substring(imageName.lastIndexOf(':') + 1);
if (!tag.matches("\\d+\\.\\d+\\.\\d+.*")) throw new IllegalArgumentException("Use a semantic version tag for chromadb/chroma, not: " + tag);

Try / catch

// warning only — no exception thrown; assert on behavior instead:
Assert.assertEquals("1.0.0", imageTag); // pin explicitly before container.start()

Prevention

When it happens

Trigger: Using a ChromaDB image tag that is not a semantic version (e.g. latest, 0.6, dev builds) or a tag below 1.0.0, so the container cannot determine which REST API layout to use and falls back to v1 endpoints.

Common situations: Pinning chromadb/chroma:latest in CI and the version probe misparses; using an old 0.4.x image whose API doesn't match either expectation; custom Chroma builds with non-semantic tags.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at modules/chromadb/src/main/java/org/testcontainers/chromadb/ChromaDBContainer.java:53

        withExposedPorts(8000);
        waitingFor(Wait.forHttp(apiPath));
    }

    public String getEndpoint() {
        return "http://" + getHost() + ":" + getFirstMappedPort();
    }

    private static boolean isVersion2(String version) {
        if (version.equals("latest")) {
            return true;
        }

        ComparableVersion comparableVersion = new ComparableVersion(version);
        if (comparableVersion.isGreaterThanOrEqualTo("1.0.0")) {
            return true;
        }

        log.warn("Version {} is less than 1.0.0 or not a semantic version.", version);
        return false;
    }
}

View on GitHub (pinned to 8e549514e3)