quarkusio/quarkus · error · BuildException
Wasn't able to determine the distribution of the search serv
Error message
Wasn't able to determine the distribution of the search service based on the provided image name [${imageName}]. Please specify the distribution explicitly. What it means
DevServicesElasticsearchProcessor.resolveDistribution() guesses the search-service distribution (Elasticsearch vs OpenSearch) from the container image name. If quarkus.elasticsearch.devservices.image-name is set but the repository part contains neither 'opensearch' nor 'elasticsearch', it cannot guess and throws a BuildException asking the user to specify the distribution explicitly.
Source
Thrown at extensions/elasticsearch-rest-client-common/deployment/src/main/java/io/quarkus/elasticsearch/restclient/common/deployment/DevServicesElasticsearchProcessor.java:271
private Distribution resolveDistribution(ElasticsearchDevServicesBuildTimeConfig config,
DevservicesElasticsearchBuildItemsConfiguration buildItemConfig) throws BuildException {
// First, let's see if it was explicitly configured:
if (config.distribution().isPresent()) {
return config.distribution().get();
}
// Now let's see if we can guess it from the image:
if (config.imageName().isPresent()) {
String imageNameRepository = DockerImageName.parse(config.imageName().get()).getRepository()
.toLowerCase(Locale.ROOT);
if (imageNameRepository.contains(DEV_SERVICE_OPENSEARCH)) {
return Distribution.OPENSEARCH;
}
if (imageNameRepository.contains(DEV_SERVICE_ELASTICSEARCH)) {
return Distribution.ELASTIC;
}
// no luck guessing so let's ask user to be more explicit:
throw new BuildException(
"Wasn't able to determine the distribution of the search service based on the provided image name ["
+ config.imageName().get()
+ "]. Please specify the distribution explicitly.",
Collections.emptyList());
}
// Otherwise, let's see if the build item has a value available:
if (buildItemConfig.distribution() != null) {
return buildItemConfig.distribution();
}
// If we didn't get an explicit distribution
// and no image name was provided
// then elastic is a default distribution:
return DEFAULT_DISTRIBUTION;
}
private Map<String, String> buildPropertiesMap(DevservicesElasticsearchBuildItemsConfiguration buildItemConfig,
String httpHosts) {
Map<String, String> propertiesToSet = new HashMap<>();View on GitHub (pinned to e1c734241f)
Solutions
- Set quarkus.elasticsearch.devservices.distribution=elasticsearch (or opensearch) explicitly
- Rename/re-tag the image so its repository contains 'elasticsearch' or 'opensearch'
- Use the standard image name (docker.elastic.co/elasticsearch/elasticsearch or opensearchproject/opensearch)
Example fix
// before quarkus.elasticsearch.devservices.image-name=myregistry.local/search:2.11.0 // after quarkus.elasticsearch.devservices.image-name=myregistry.local/search:2.11.0 quarkus.elasticsearch.devservices.distribution=opensearch
Defensive patterns
Strategy: validation
Validate before calling
// in application.properties, whenever a custom image-name is used quarkus.elasticsearch.devservices.distribution=elasticsearch
Prevention
- Always set devservices.distribution alongside a custom image-name
- Keep 'elasticsearch' or 'opensearch' in mirrored image repository names
- Test dev-mode startup after changing dev-services images
When it happens
Trigger: Setting quarkus.elasticsearch.devservices.image-name to a custom/renamed image (e.g. a local registry mirror like myregistry.local/search:2.11) whose name contains neither keyword.
Common situations: Air-gapped environments using mirrored images with different names; custom-built images re-tagged without 'elasticsearch'/'opensearch' in the name.
Related errors
- Multiple extensions request different distributions of Elast
- Services named ${servicesToWaitFor} do not exist, but wait c
- You must provide either a valid username/password pair for B
- Multiple extensions request different versions of Elasticsea
- Failed to load application configuration
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/bef64a84ca7f1727.
Report an issue: GitHub.