elastic/elasticsearch · error · UserException

78

78

Error message

this distribution of Elasticsearch contains X-Pack by default

What it means

Thrown inside the per-plugin install loop when pluginId equals the literal "x-pack". Since X-Pack ships bundled with the default Elasticsearch distribution, attempting to install it as a separate plugin is rejected with exit code 78 (CONFIG). This is a hard stop, not a warning.

Source

Thrown at distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/cli/InstallPluginAction.java:227

            throw new UserException(ExitCodes.USAGE, "at least one plugin id is required");
        }

        final Set<String> uniquePluginIds = new HashSet<>();
        for (final InstallablePlugin plugin : plugins) {
            if (uniquePluginIds.add(plugin.getId()) == false) {
                throw new UserException(ExitCodes.USAGE, "duplicate plugin id [" + plugin.getId() + "]");
            }
        }

        final String logPrefix = terminal.isHeadless() ? "" : "-> ";

        final Map<String, List<Path>> deleteOnFailures = new LinkedHashMap<>();
        for (final InstallablePlugin plugin : plugins) {
            final String pluginId = plugin.getId();
            terminal.println(logPrefix + "Installing " + pluginId);
            try {
                if ("x-pack".equals(pluginId)) {
                    throw new UserException(ExitCodes.CONFIG, "this distribution of Elasticsearch contains X-Pack by default");
                }

                if (PLUGINS_CONVERTED_TO_MODULES.contains(pluginId)) {
                    // This deliberately does not throw an exception in order to avoid failing automation that relies on installing this
                    // plugin during deployment.
                    terminal.errorPrintln(
                        "[" + pluginId + "] is no longer a plugin but instead a module packaged with this distribution of Elasticsearch"
                    );
                    continue;
                }

                final List<Path> deleteOnFailure = new ArrayList<>();
                deleteOnFailures.put(pluginId, deleteOnFailure);

                final Path pluginZip = download(plugin, env.tmpDir());
                final Path extractedZip = unzip(pluginZip, env.pluginsDir());
                deleteOnFailure.add(extractedZip);
                final PluginDescriptor pluginDescriptor = installPlugin(plugin, extractedZip, deleteOnFailure);

View on GitHub (pinned to db6a809a66)

Solutions

  1. Remove `x-pack` from the plugin install list — it is already present in the distribution.
  2. If you need to verify X-Pack features, query the cluster (e.g. GET _xpack) instead of installing.
  3. Audit provisioning scripts and remove any `x-pack` references in plugin install blocks.

Example fix

# before
elasticsearch-plugin install x-pack
# after
# (remove the line; X-Pack is bundled)
Defensive patterns

Strategy: validation

Validate before calling

List<String> requested = List.of("x-pack", "analysis-icu");
requested = requested.stream().filter(id -> !"x-pack".equals(id)).toList();
// proceed only with the filtered list

Prevention

When it happens

Trigger: Running `bin/elasticsearch-plugin install x-pack` on any modern distribution that already contains X-Pack; install scripts/role playbooks that still carry an `x-pack` entry from pre-7.x eras.

Common situations: Upgrading from ES 5.x where X-Pack was a separate download; copy-pasted provisioning code; CI baselines that haven't been refreshed.

Related errors


AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12). Data as JSON: /api/errors/58129b8cf0f11e66. Report an issue: GitHub.