{"record":{"id":"eb108a50afc51fe5","repo":"elastic/elasticsearch","slug":"malformed-proxy-expected-host-port-in-elasti","errorCode":null,"errorMessage":"Malformed [proxy], expected [host:port] in [elasticsearch-plugins.yml]","messagePattern":"Malformed \\[proxy\\], expected \\[host:port\\] in \\[elasticsearch-plugins\\.yml\\]","errorType":"exception","errorClass":"PluginSyncException","httpStatus":null,"severity":"error","filePath":"distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/cli/PluginsConfig.java","lineNumber":91,"sourceCode":"            if (uniquePluginIds.add(plugin.getId()) == false) {\n                throw new PluginSyncException(\"Duplicate plugin ID [\" + plugin.getId() + \"] found in [elasticsearch-plugins.yml]\");\n            }\n        }\n\n        for (InstallablePlugin plugin : this.plugins) {\n            if (officialPlugins.contains(plugin.getId()) == false\n                && migratedPlugins.contains(plugin.getId()) == false\n                && plugin.getLocation() == null) {\n                throw new PluginSyncException(\n                    \"Must specify location for non-official plugin [\" + plugin.getId() + \"] in [elasticsearch-plugins.yml]\"\n                );\n            }\n        }\n\n        if (this.proxy != null) {\n            final String[] parts = this.proxy.split(\":\");\n            if (parts.length != 2) {\n                throw new PluginSyncException(\"Malformed [proxy], expected [host:port] in [elasticsearch-plugins.yml]\");\n            }\n\n            if (ProxyUtils.validateProxy(parts[0], parts[1]) == false) {\n                throw new PluginSyncException(\"Malformed [proxy], expected [host:port] in [elasticsearch-plugins.yml]\");\n            }\n        }\n\n        for (InstallablePlugin p : plugins) {\n            if (p.getLocation() != null) {\n                if (p.getLocation().isBlank()) {\n                    throw new PluginSyncException(\"Empty location for plugin [\" + p.getId() + \"]\");\n                }\n\n                try {\n                    // This also accepts Maven coordinates\n                    new URI(p.getLocation());\n                } catch (URISyntaxException e) {\n                    throw new PluginSyncException(\"Malformed location for plugin [\" + p.getId() + \"]\");","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/cli/PluginsConfig.java#L73-L109","documentation":"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.","triggerScenarios":"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.","commonSituations":"Proxy configured as bare hostname without port; IPv6 address used raw (colons everywhere); typo like `host =port`; extra whitespace or trailing colons after paste.","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."],"exampleFix":"# before:\nproxy: proxy.internal       # missing port\n# or\nproxy: http://proxy.internal:8080   # scheme -> too many parts\n# after:\nproxy: proxy.internal:8080","handlingStrategy":"validation","validationCode":"// Validate proxy shape before deploy.\nString proxy = parsed.getProxy();\nif (proxy != null && proxy.split(\":\").length != 2) {\n    throw new IllegalArgumentException(\"proxy must be host:port, got: \" + proxy);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["plugins-config","validation","proxy","yaml","plugin-cli"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:17:08.281Z"}