{"record":{"id":"f39210bcad63aff8","repo":"apache/pulsar","slug":"malformed-extension-found-for-extension-name-ex","errorCode":null,"errorMessage":"Malformed extension found for extension name `${extensionName}`","messagePattern":"Malformed extension found for extension name `(.+?)`","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"pulsar-proxy/src/main/java/org/apache/pulsar/proxy/extensions/ProxyExtensions.java","lineNumber":83,"sourceCode":"            if (null == definition) {\n                throw new RuntimeException(\"No extension is found for extension name `\" + extensionName\n                    + \"`. Available extensions are : \" + definitions.extensions());\n            }\n\n            ProxyExtensionWithClassLoader extension;\n            try {\n                extension = ProxyExtensionsUtils.load(definition, conf.getNarExtractionDirectory());\n            } catch (IOException e) {\n                log.error().attr(\"extension\", extensionName).exception(e)\n                        .log(\"Failed to load the extension\");\n                throw new RuntimeException(\"Failed to load the extension for extension name `\" + extensionName + \"`\");\n            }\n\n            if (!extension.accept(extensionName)) {\n                extension.close();\n                log.error().attr(\"extension\", extensionName)\n                        .log(\"Malformed extension found\");\n                throw new RuntimeException(\"Malformed extension found for extension name `\" + extensionName + \"`\");\n            }\n\n            extensionsBuilder.put(extensionName, extension);\n            log.info().attr(\"extension\", extensionName)\n                    .log(\"Successfully loaded extension\");\n        });\n\n        return new ProxyExtensions(extensionsBuilder.build());\n    }\n\n    private final Map<String, ProxyExtensionWithClassLoader> extensions;\n\n    ProxyExtensions(Map<String, ProxyExtensionWithClassLoader> extensions) {\n        this.extensions = extensions;\n    }\n\n    /**\n     * Return the handler for the provided <tt>extension</tt>.","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/extensions/ProxyExtensions.java#L65-L101","documentation":"Thrown when a successfully loaded extension NAR's ProxyExtension.accept(extensionName) returns false, meaning the bundled extension does not recognize or handle the name it was registered under. The proxy logs 'Malformed extension found', closes the extension, and refuses to start with it.","triggerScenarios":"ProxyExtensions.load(configuration) where an entry name in proxyExtensionNames does not match any service name the extension's accept() method returns true for — e.g. misspelled extension name in the proxy config or an extension NAR that exports a different extension name than configured.","commonSituations":"Typo in proxyExtensionNames (e.g. 'htto' instead of 'http'); configuring the NAR file name instead of the extension's registered name; upgrading an extension that renamed its accepted identifiers.","solutions":["Check the extension NAR's declared extension name (its ProxyExtension implementation / metadata) and use exactly that in proxyExtensionNames","Fix typos in the proxyExtensionNames configuration entry","If the extension renamed its identifier after an upgrade, update the config or pin the older NAR version","Consult the extension's documentation for the accepted names and restart the proxy"],"exampleFix":"// before (proxy.conf)\nproxyExtensionNames=webservice\n// after\nproxyExtensionNames=http","handlingStrategy":"validation","validationCode":"// Cross-check configured names against the NAR's declared extension name\nSet<String> declared = loadDeclaredExtensionNames(extDir); // parse META-INF proxyextension.yaml\nList<String> configured = conf.getProxyExtensions();\nList<String> invalid = configured.stream().filter(n -> !declared.contains(n)).collect(toList());\nif (!invalid.isEmpty()) throw new IllegalStateException(\"Unknown extension names: \" + invalid);","typeGuard":null,"tryCatchPattern":"try { proxyExtensions.load(conf); } catch (RuntimeException e) { if (e.getMessage().contains(\"Malformed extension\")) log.error(\"Extension name in config not accepted by the NAR; check proxyExtensionNames\"); throw e; }","preventionTips":["Use the extension name from the NAR metadata, not the file name","Re-check proxyExtensionNames after every extension upgrade"],"tags":["pulsar-proxy","extensions","configuration"],"backgroundTag":"extension-name-mismatch","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}