{"record":{"id":"bef64a84ca7f1727","repo":"quarkusio/quarkus","slug":"wasn-t-able-to-determine-the-distribution-of-the-s","errorCode":null,"errorMessage":"Wasn't able to determine the distribution of the search service based on the provided image name [${imageName}]. Please specify the distribution explicitly.","messagePattern":"Wasn't able to determine the distribution of the search service based on the provided image name \\[(.+?)\\]\\. Please specify the distribution explicitly\\.","errorType":"exception","errorClass":"BuildException","httpStatus":null,"severity":"error","filePath":"extensions/elasticsearch-rest-client-common/deployment/src/main/java/io/quarkus/elasticsearch/restclient/common/deployment/DevServicesElasticsearchProcessor.java","lineNumber":271,"sourceCode":"\n    private Distribution resolveDistribution(ElasticsearchDevServicesBuildTimeConfig config,\n            DevservicesElasticsearchBuildItemsConfiguration buildItemConfig) throws BuildException {\n        // First, let's see if it was explicitly configured:\n        if (config.distribution().isPresent()) {\n            return config.distribution().get();\n        }\n        // Now let's see if we can guess it from the image:\n        if (config.imageName().isPresent()) {\n            String imageNameRepository = DockerImageName.parse(config.imageName().get()).getRepository()\n                    .toLowerCase(Locale.ROOT);\n            if (imageNameRepository.contains(DEV_SERVICE_OPENSEARCH)) {\n                return Distribution.OPENSEARCH;\n            }\n            if (imageNameRepository.contains(DEV_SERVICE_ELASTICSEARCH)) {\n                return Distribution.ELASTIC;\n            }\n            // no luck guessing so let's ask user to be more explicit:\n            throw new BuildException(\n                    \"Wasn't able to determine the distribution of the search service based on the provided image name [\"\n                            + config.imageName().get()\n                            + \"]. Please specify the distribution explicitly.\",\n                    Collections.emptyList());\n        }\n        // Otherwise, let's see if the build item has a value available:\n        if (buildItemConfig.distribution() != null) {\n            return buildItemConfig.distribution();\n        }\n        // If we didn't get an explicit distribution\n        // and no image name was provided\n        // then elastic is a default distribution:\n        return DEFAULT_DISTRIBUTION;\n    }\n\n    private Map<String, String> buildPropertiesMap(DevservicesElasticsearchBuildItemsConfiguration buildItemConfig,\n            String httpHosts) {\n        Map<String, String> propertiesToSet = new HashMap<>();","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/elasticsearch-rest-client-common/deployment/src/main/java/io/quarkus/elasticsearch/restclient/common/deployment/DevServicesElasticsearchProcessor.java#L253-L289","documentation":"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.","triggerScenarios":"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.","commonSituations":"Air-gapped environments using mirrored images with different names; custom-built images re-tagged without 'elasticsearch'/'opensearch' in the name.","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)"],"exampleFix":"// before\nquarkus.elasticsearch.devservices.image-name=myregistry.local/search:2.11.0\n// after\nquarkus.elasticsearch.devservices.image-name=myregistry.local/search:2.11.0\nquarkus.elasticsearch.devservices.distribution=opensearch","handlingStrategy":"validation","validationCode":"// in application.properties, whenever a custom image-name is used\nquarkus.elasticsearch.devservices.distribution=elasticsearch","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["devservices","elasticsearch","opensearch","containers","configuration"],"backgroundTag":"ambiguous-image-distribution","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}