{"record":{"id":"9d802b2e669ef8c4","repo":"apache/pulsar","slug":"the-configure-entry-advertisedlisteners-is-inval","errorCode":null,"errorMessage":"the configure entry `advertisedListeners` is invalid. because ${entry} do not contain listener name","messagePattern":"the configure entry `advertisedListeners` is invalid\\. because (.+?) do not contain listener name","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-broker-common/src/main/java/org/apache/pulsar/broker/validator/MultipleListenerValidator.java","lineNumber":176,"sourceCode":"                        ? override.getBrokerHttpsUrl() : fallback.getBrokerHttpsUrl())\n                .build();\n    }\n\n    private static Map<String, AdvertisedListener> parseAdvertisedListeners(ServiceConfiguration config) {\n        if (StringUtils.isBlank(config.getAdvertisedListeners())) {\n            return new LinkedHashMap<>();\n        }\n        Map<String, List<String>> listeners = new LinkedHashMap<>();\n        // Trim whitespace around comma-separated entries so configurations split across multiple\n        // lines or padded for readability are accepted, and skip empties.\n        for (final String raw : StringUtils.split(config.getAdvertisedListeners(), \",\")) {\n            String str = StringUtils.trim(raw);\n            if (StringUtils.isEmpty(str)) {\n                continue;\n            }\n            int index = str.indexOf(\":\");\n            if (index <= 0) {\n                throw new IllegalArgumentException(\"the configure entry `advertisedListeners` is invalid. because \"\n                        + str + \" do not contain listener name\");\n            }\n            String listenerName = StringUtils.trim(str.substring(0, index));\n            validateListenerName(listenerName);\n            String value = StringUtils.trim(str.substring(index + 1));\n            listeners.computeIfAbsent(listenerName, k -> new ArrayList<>(2));\n            listeners.get(listenerName).add(value);\n        }\n        final Map<String, AdvertisedListener> result = new LinkedHashMap<>();\n        final Map<String, Set<String>> reverseMappings = new LinkedHashMap<>();\n        for (final Map.Entry<String, List<String>> entry : listeners.entrySet()) {\n            if (entry.getValue().size() > 4) {\n                throw new IllegalArgumentException(\"there are redundant configure for listener `\" + entry.getKey()\n                        + \"`\");\n            }\n            URI pulsarAddress = null, pulsarSslAddress = null, pulsarHttpAddress = null, pulsarHttpsAddress = null;\n            for (final String strUri : entry.getValue()) {\n                try {","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/validator/MultipleListenerValidator.java#L158-L194","documentation":"IllegalArgumentException thrown by MultipleListenerValidator.parseAdvertisedListeners when an advertisedListeners entry has no listener-name prefix, i.e. no ':' before any name (index of ':' is <= 0). Each entry must be in the form <listenerName>:<scheme>://<host>:<port>; a bare URL like pulsar://host:6650 is rejected because the parser cannot determine which listener it belongs to.","triggerScenarios":"Configuring advertisedListeners=pulsar://host:6650 (missing 'name:' prefix); an entry starting with ':' (empty name yields index 0, also rejected); whitespace-only or malformed segments left after comma splitting.","commonSituations":"Copying legacy advertisedAddress-style values into the newer advertisedListeners property without adding the name prefix; migration from old configs on upgrade; string templating dropping the name portion.","solutions":["Prefix every entry with a listener name: internal:pulsar://host:6650","Ensure the name portion is non-empty and contains only ASCII letters, digits, underscore, hyphen","Validate the comma-separated list has one 'name:url' pair per entry"],"exampleFix":"// before\nadvertisedListeners=pulsar://broker.example.com:6650\n// after\nadvertisedListeners=internal:pulsar://broker.example.com:6650","handlingStrategy":"validation","validationCode":"for (String entry : advertisedListeners.split(\",\")) {\n    entry = entry.trim();\n    int idx = entry.indexOf(':');\n    if (idx <= 0 || !entry.substring(0, idx).matches(\"[A-Za-z0-9_-]+\")) {\n        throw new IllegalArgumentException(\"advertisedListeners entry '\" + entry + \"' must be <listenerName>:<url>\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always prefix each advertisedListeners entry with a name and colon","Migrate legacy advertisedAddress configs by adding the name prefix","Lint the comma-separated list for empty or prefix-less segments","Keep a canonical example of the expected format in deployment docs"],"tags":["configuration","advertised-listeners","listener-name","multi-listener"],"backgroundTag":"invalid-listener-format","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}