elastic/elasticsearch · error · PluginSyncException
Malformed [proxy], expected [host:port] in [elasticsearch-pl
Error message
Malformed [proxy], expected [host:port] in [elasticsearch-plugins.yml]
What it means
Thrown by PluginsConfig.validate when a non-null proxy string in elasticsearch-plugins.yml does not split into exactly two `:`-separated parts (host:port). This is the first of two malformed-proxy checks (the second, at line 95, re-throws the same message after ProxyUtils.validateProxy fails). PluginSyncException is used.
Source
Thrown at distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/cli/PluginsConfig.java:91
if (uniquePluginIds.add(plugin.getId()) == false) {
throw new PluginSyncException("Duplicate plugin ID [" + plugin.getId() + "] found in [elasticsearch-plugins.yml]");
}
}
for (InstallablePlugin plugin : this.plugins) {
if (officialPlugins.contains(plugin.getId()) == false
&& migratedPlugins.contains(plugin.getId()) == false
&& plugin.getLocation() == null) {
throw new PluginSyncException(
"Must specify location for non-official plugin [" + plugin.getId() + "] in [elasticsearch-plugins.yml]"
);
}
}
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() + "]");View on GitHub (pinned to db6a809a66)
Solutions
- Format the proxy as exactly `host:port`, e.g. `proxy: proxy.internal:8080`.
- For IPv6 proxies, wrap the host in brackets: `[::1]:8080` so only the port follows the last colon.
- Re-run after fixing and confirm validateProxy (line 95) no longer fires.
Example fix
# before: proxy: proxy.internal # missing port # or proxy: http://proxy.internal:8080 # scheme -> too many parts # after: proxy: proxy.internal:8080
Defensive patterns
Strategy: validation
Validate before calling
// Validate proxy shape before deploy.
String proxy = parsed.getProxy();
if (proxy != null && proxy.split(":").length != 2) {
throw new IllegalArgumentException("proxy must be host:port, got: " + proxy);
} Prevention
- Template the proxy from `host` + `port` variables joined by `:`.
- For IPv6, wrap host in brackets before joining.
- Lint the proxy field in CI against the `^[^:]+:[0-9]+$` (or bracketed) regex.
When it happens
Trigger: validate reads this.proxy; if non-null it splits on `:`. A string with zero, two, or more than one colon (e.g. `host`, `host:port:extra`, or an IPv6-ish literal) yields parts.length != 2 and throws.
Common situations: Proxy configured as bare hostname without port; IPv6 address used raw (colons everywhere); typo like `host =port`; extra whitespace or trailing colons after paste.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Cannot have null or empty IDs in [elasticsearch-plugins.yml]
- Duplicate plugin ID [{id}] found in [elasticsearch-plugins.y
- Must specify location for non-official plugin [{id}] in [ela
- Empty location for plugin [{id}]
- Malformed location for plugin [{id}]
AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12).
Data as JSON: /api/errors/eb108a50afc51fe5.
Report an issue: GitHub.