apache/pulsar · error · RuntimeException

No factory is found for name `${name}`. Available names are

Error message

No factory is found for name `${name}`. Available names are : ${factories}

What it means

Extension lookup failure in CustomCommandFactoryProvider.createCustomCommandFactories: the customCommandFactories property lists a factory name for which no matching NAR metadata entry was found; the available factory names are listed to help correct the configuration entry, which is the faulty input.

Source

Thrown at pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/utils/CustomCommandFactoryProvider.java:65

     * create a Command Factory.
     */
    public static List<CustomCommandFactory> createCustomCommandFactories(
            Properties conf) throws IOException {
        String names = conf.getProperty("customCommandFactories", "");
        List<CustomCommandFactory> result = new ArrayList<>();
        if (names.isEmpty()) {
            // early exit
            return result;
        }

        String directory = conf.getProperty("cliExtensionsDirectory", "cliextensions");
        String narExtractionDirectory = NarClassLoader.DEFAULT_NAR_EXTRACTION_DIR;
        CustomCommandFactoryDefinitions definitions = searchForCustomCommandFactories(directory,
                narExtractionDirectory);
        for (String name : names.split(",")) {
            CustomCommandFactoryMetaData metaData = definitions.getFactories().get(name);
            if (null == metaData) {
                throw new RuntimeException("No factory is found for name `" + name
                        + "`. Available names are : " + definitions.getFactories());
            }
            CustomCommandFactory factory = load(metaData, narExtractionDirectory);
            if (factory != null) {
                result.add(factory);
            }
            log.debug().attr("name", name).log("Successfully loaded command factory");
        }
        return result;
    }

    private static CustomCommandFactoryDefinitions searchForCustomCommandFactories(String directory,
                                                                       String narExtractionDirectory)
            throws IOException {
        Path path = Paths.get(directory).toAbsolutePath().normalize();
        log.debug().attr("path", path).log("Searching for command factories");

        CustomCommandFactoryDefinitions customCommandFactoryDefinitions = new CustomCommandFactoryDefinitions();

View on GitHub (pinned to 820761864e)

Solutions

  1. Fix the factory name in the config
  2. Install the NAR providing that factory in the extensions directory
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/utils/CustomCommandFactoryProvider.java:65 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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