elastic/elasticsearch · error · PluginSyncException

Empty location for plugin [{id}]

Error message

Empty location for plugin [{id}]

What it means

Thrown by PluginsConfig.validate while iterating plugins that have a non-null location: if a location string is non-null but `isBlank()` (empty or whitespace only), it is rejected as PluginSyncException. This catches the gap where a plugin gets past the official/migrated check because location was set, but the value carries no usable content.

Source

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

                );
            }
        }

        if (this.proxy != null) {
            final String[] parts = this.proxy.split(":");
            if (parts.length != 2) {
                throw new PluginSyncException("Malformed [proxy], expected [host:port] in [elasticsearch-plugins.yml]");
            }

            if (ProxyUtils.validateProxy(parts[0], parts[1]) == false) {
                throw new PluginSyncException("Malformed [proxy], expected [host:port] in [elasticsearch-plugins.yml]");
            }
        }

        for (InstallablePlugin p : plugins) {
            if (p.getLocation() != null) {
                if (p.getLocation().isBlank()) {
                    throw new PluginSyncException("Empty location for plugin [" + p.getId() + "]");
                }

                try {
                    // This also accepts Maven coordinates
                    new URI(p.getLocation());
                } catch (URISyntaxException e) {
                    throw new PluginSyncException("Malformed location for plugin [" + p.getId() + "]");
                }
            }
        }
    }

    public List<InstallablePlugin> getPlugins() {
        return plugins;
    }

    public String getProxy() {
        return proxy;

View on GitHub (pinned to db6a809a66)

Solutions

  1. Provide a real location value (URL, file:// path, or Maven coordinate) for the plugin.
  2. If the plugin is official/migrated, remove the `location:` key entirely so the null check at line 82 governs.
  3. Lint the YAML so no `location:` resolves to an empty/whitespace string.

Example fix

# before:
plugins:
  - id: custom-x
    location:        # blank -> error
# after (official plugin, drop location):
plugins:
  - id: analysis-icu
# or (non-official, give a real value):
plugins:
  - id: custom-x
    location: file:///opt/plugins/custom-x.zip
Defensive patterns

Strategy: validation

Validate before calling

// Reject blank locations before validation.
for (InstallablePlugin p : parsed.getPlugins()) {
    if (p.getLocation() != null && p.getLocation().isBlank()) {
        throw new IllegalArgumentException("Plugin " + p.getId() + " has a blank location");
    }
}

Prevention

When it happens

Trigger: For each plugin with `getLocation() != null`, the code runs `p.getLocation().isBlank()`; a blank location string throws with the plugin id in the message.

Common situations: YAML entry like `- id: x` then `location:` with no value (parses as empty string); location set to spaces or a stray newline; templating rendered an empty location placeholder.

Related errors


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