testcontainers/testcontainers-java · error · IllegalArgumentException
Kibana version is not supported. Minimum version is
Error message
Kibana version %s is not supported. Minimum version is %s
What it means
KibanaContainer enforces a minimum supported Kibana/Elasticsearch version (MINIMUM_SUPPORTED_VERSION). ensureCompatibleVersion parses the version string with ComparableVersion and throws IllegalArgumentException if it is below the minimum, because older Kibana images lack APIs the container integration depends on.
Solutions
- Upgrade the Kibana image tag to a version at or above MINIMUM_SUPPORTED_VERSION (check the constant in KibanaContainer).
- Keep the Kibana and Elasticsearch image versions in lock-step.
- If you truly need an old version, use an unmanaged setup (external mode) rather than this container class.
Example fix
// before
new KibanaContainer(DockerImageName.parse("docker.elastic.co/kibana/kibana:6.8.0"))
// after
new KibanaContainer(DockerImageName.parse("docker.elastic.co/kibana/kibana:8.11.0")) Defensive patterns
Strategy: validation
Validate before calling
String tag = image.getVersionPart();
org.apache.maven.artifact.versioning.ComparableVersion v = new org.apache.maven.artifact.versioning.ComparableVersion(tag);
if (v.compareTo(new org.apache.maven.artifact.versioning.ComparableVersion("7.17.0")) < 0) {
throw new IllegalArgumentException("Kibana image too old: " + tag);
} Prevention
- Centralize image version constants and share them between Elasticsearch and Kibana declarations.
- Pin supported tags in one place and upgrade Kibana and ES together.
- Review MINIMUM_SUPPORTED_VERSION in KibanaContainer when choosing tags.
When it happens
Trigger: Creating a KibanaContainer (constructor or via buildDockerImageName) with an image tag whose version is lower than MINIMUM_SUPPORTED_VERSION, e.g. DockerImageName.parse("docker.elastic.co/kibana/kibana:6.x") or any tag that resolves to a too-old version.
Common situations: Pinning an old image tag copied from legacy test code; upgrading Elasticsearch tests selectively so Kibana stays behind; using a typo'd tag like "7.1" mistaken for "7.17".
Related errors
- withReuse(true) is not supported for KibanaContainer in…
- Cannot set Elasticsearch URL when using Elasticsearch…
- Elasticsearch containerId is not available. In managed…
- Failed to connect Elasticsearch container to ad-hoc shared…
- Cannot create service account token in external mode
AI-assisted analysis of testcontainers/testcontainers-java@8e549514e3 (2026-09-12).
Data as JSON: /api/errors/e9a99b3ad75adf4f.
Report an issue: GitHub.
Appendix: source
Thrown at modules/elasticsearch/src/main/java/org/testcontainers/elasticsearch/KibanaContainer.java:521
String networkId = network.getId();
try {
DockerClientFactory
.instance()
.client()
.connectToNetworkCmd()
.withContainerId(containerId)
.withNetworkId(networkId)
.exec();
} catch (Exception e) {
throw new IllegalStateException("Failed to connect Elasticsearch container to ad-hoc shared network", e);
}
}
private static void ensureCompatibleVersion(String esVersion) {
ComparableVersion comparableVersion = new ComparableVersion(esVersion);
if (comparableVersion.isLessThan(MINIMUM_SUPPORTED_VERSION)) {
throw new IllegalArgumentException(
String.format(
"Kibana version %s is not supported. Minimum version is %s",
comparableVersion,
MINIMUM_SUPPORTED_VERSION
)
);
}
}
private String createKibanaServiceAccountToken(String protocol) {
if (elasticsearch == null) {
throw new IllegalStateException("Cannot create service account token in external mode");
}
String elasticPassword = elasticsearch
.getEnvMap()
.getOrDefault("ELASTIC_PASSWORD", ElasticsearchContainer.ELASTICSEARCH_DEFAULT_PASSWORD);
View on GitHub (pinned to 8e549514e3)