apache/pulsar · error · RuntimeException

Malformed extension found for extension name `${extensionNam

Error message

Malformed extension found for extension name `${extensionName}`

What it means

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.

Source

Thrown at pulsar-proxy/src/main/java/org/apache/pulsar/proxy/extensions/ProxyExtensions.java:83

            if (null == definition) {
                throw new RuntimeException("No extension is found for extension name `" + extensionName
                    + "`. Available extensions are : " + definitions.extensions());
            }

            ProxyExtensionWithClassLoader extension;
            try {
                extension = ProxyExtensionsUtils.load(definition, conf.getNarExtractionDirectory());
            } catch (IOException e) {
                log.error().attr("extension", extensionName).exception(e)
                        .log("Failed to load the extension");
                throw new RuntimeException("Failed to load the extension for extension name `" + extensionName + "`");
            }

            if (!extension.accept(extensionName)) {
                extension.close();
                log.error().attr("extension", extensionName)
                        .log("Malformed extension found");
                throw new RuntimeException("Malformed extension found for extension name `" + extensionName + "`");
            }

            extensionsBuilder.put(extensionName, extension);
            log.info().attr("extension", extensionName)
                    .log("Successfully loaded extension");
        });

        return new ProxyExtensions(extensionsBuilder.build());
    }

    private final Map<String, ProxyExtensionWithClassLoader> extensions;

    ProxyExtensions(Map<String, ProxyExtensionWithClassLoader> extensions) {
        this.extensions = extensions;
    }

    /**
     * Return the handler for the provided <tt>extension</tt>.

View on GitHub (pinned to 820761864e)

Solutions

  1. Check the extension NAR's declared extension name (its ProxyExtension implementation / metadata) and use exactly that in proxyExtensionNames
  2. Fix typos in the proxyExtensionNames configuration entry
  3. If the extension renamed its identifier after an upgrade, update the config or pin the older NAR version
  4. Consult the extension's documentation for the accepted names and restart the proxy

Example fix

// before (proxy.conf)
proxyExtensionNames=webservice
// after
proxyExtensionNames=http
Defensive patterns

Strategy: validation

Validate before calling

// Cross-check configured names against the NAR's declared extension name
Set<String> declared = loadDeclaredExtensionNames(extDir); // parse META-INF proxyextension.yaml
List<String> configured = conf.getProxyExtensions();
List<String> invalid = configured.stream().filter(n -> !declared.contains(n)).collect(toList());
if (!invalid.isEmpty()) throw new IllegalStateException("Unknown extension names: " + invalid);

Try / catch

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; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Related errors


AI-assisted analysis of apache/pulsar@820761864e (2026-09-06). Data as JSON: /api/errors/f39210bcad63aff8. Report an issue: GitHub.