{"record":{"id":"0446c2792fdc6ce2","repo":"elastic/elasticsearch","slug":"expected-at-most-one-implementation-found","errorCode":null,"errorMessage":"Expected at most one {} implementation, found: {}","messagePattern":"Expected at most one (.+?) implementation, found: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":500,"severity":"critical","filePath":"modules/data-streams/src/main/java/org/elasticsearch/datastreams/DataStreamsPlugin.java","lineNumber":178,"sourceCode":"    public DataStreamsPlugin(Settings settings) {\n        this.settings = settings;\n    }\n\n    @Override\n    public void loadExtensions(ExtensionLoader loader) {\n        downsamplingOperations = loadSingleExtension(loader, DownsamplingOperations.class, downsamplingOperations);\n        frozenTransitionInfoProvider = loadSingleExtension(loader, FrozenTransitionInfoProvider.class, frozenTransitionInfoProvider);\n    }\n\n    /**\n     * Loads at most one implementation of the given extension point, falling back to {@code fallback} if none is\n     * registered. Throws if more than one implementation is found, since these extension points are meant to be\n     * implemented by a single optional plugin.\n     */\n    private static <T> T loadSingleExtension(ExtensionLoader loader, Class<T> type, T fallback) {\n        List<T> extensions = loader.loadExtensions(type);\n        if (extensions.size() > 1) {\n            throw new IllegalStateException(\n                \"Expected at most one \"\n                    + type.getSimpleName()\n                    + \" implementation, found: \"\n                    + extensions.stream().map(Object::getClass).toList()\n            );\n        }\n        return extensions.isEmpty() ? fallback : extensions.get(0);\n    }\n\n    protected Clock getClock() {\n        return Clock.systemUTC();\n    }\n\n    // The dependency of index.look_ahead_time is a cluster setting and currently there is no clean validation approach for this:\n    static void additionalLookAheadTimeValidation(TimeValue lookAhead, TimeValue timeSeriesPollInterval) {\n        if (lookAhead.compareTo(timeSeriesPollInterval) < 0) {\n            final String message = String.format(\n                Locale.ROOT,","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/data-streams/src/main/java/org/elasticsearch/datastreams/DataStreamsPlugin.java#L160-L196","documentation":"Thrown by DataStreamsPlugin.loadSingleExtension when more than one plugin registers an implementation of a single-slot extension point (DownsamplingOperations, FrozenTransitionInfoProvider, etc.). These extension points are designed for at most one implementation; multiple registrations are an ambiguous, unsupported deployment state and fail fast at plugin load.","triggerScenarios":"Installing two plugins that each provide a DownsamplingOperations or FrozenTransitionInfoProvider; a custom plugin duplicating functionality already provided by a bundled plugin.","commonSituations":"Custom plugin ships alongside an Elastic plugin that already implements the same extension point; upgrading and accidentally leaving an old custom extension plugin installed.","solutions":["Remove one of the conflicting plugins so exactly one (or zero) implementations of the named extension point is installed.","If you need custom behavior, have your plugin replace, not augment, the bundled implementation.","Inspect the loaded extensions list in the error message to identify both conflicting plugin classes."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// At install time, enumerate plugins and assert at most one implements each single-slot extension.\nSet<Class<?>> singleSlot = Set.of(DownsamplingOperations.class, FrozenTransitionInfoProvider.class);\nfor (Class<?> t : singleSlot) {\n  long count = installedPlugins.stream().filter(p -> Arrays.asList(p.getClass().getInterfaces()).contains(t)).count();\n  if (count > 1) throw new IllegalStateException(\"multiple \" + t.getSimpleName() + \" implementations installed\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Audit installed plugins before deploy; ensure only one (or zero) single-slot extension implementation is present.","When adding a custom extension plugin, disable/remove the bundled equivalent first."],"tags":["data-streams","plugins","extension-point","elasticsearch"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}