apache/pulsar · error · java.lang.RuntimeException

No entry filter is found for name `${filterName}`. Available

Error message

No entry filter is found for name `${filterName}`. Available entry filters are : ${definitions}

What it means

loadEntryFilters resolves each requested filter name to its EntryFilterMetaData before instantiating it. If the name is absent from the definitions map it throws a RuntimeException listing available filter names, meaning the broker cannot construct the filter set requested by a policy.

Source

Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/service/plugin/EntryFilterProvider.java:109

    }

    public List<EntryFilter> loadEntryFiltersForPolicy(EntryFilters policy)
            throws IOException {
        final String names = policy.getEntryFilterNames();
        if (StringUtils.isBlank(names)) {
            return Collections.emptyList();
        }
        final List<String> entryFilterList = readEntryFiltersString(names);
        return loadEntryFilters(entryFilterList);
    }

    private List<EntryFilter> loadEntryFilters(Collection<String> entryFilterNames)
            throws IOException {
        ImmutableMap.Builder<String, EntryFilter> builder = ImmutableMap.builder();
        for (String filterName : entryFilterNames) {
            EntryFilterMetaData metaData = definitions.get(filterName);
            if (null == metaData) {
                throw new RuntimeException("No entry filter is found for name `" + filterName
                        + "`. Available entry filters are : " + definitions.keySet());
            }
            final EntryFilter entryFilter = load(metaData);
            builder.put(filterName, entryFilter);
            log.info().attr("filterName", filterName).log("Successfully loaded entry filter");
        }
        return builder.build().values().asList();
    }

    public List<EntryFilter> getBrokerEntryFilters() {
        return brokerEntryFilters;
    }

    private void initialize() throws IOException {
        final String entryFiltersDirectory = serviceConfiguration.getEntryFiltersDirectory();
        Path path = Paths.get(entryFiltersDirectory).toAbsolutePath().normalize();
        log.info().attr("path", path).log("Searching for entry filters");

View on GitHub (pinned to 820761864e)

Solutions

  1. Compare the requested name against the 'Available entry filters' list in the exception message and fix the spelling
  2. Ensure the filter NAR exists in the entryFiltersDirectory on ALL brokers and restart
  3. Update the topic/namespace policy to only reference deployed filters

Example fix

// before
RuntimeException: No entry filter is found for name `Redact`. Available: [audit-filter]
// after
set entryFilterNames=audit-filter  // match an available filter name exactly
Defensive patterns

Strategy: validation

Validate before calling

Map<String, EntryFilterMetaData> defs = provider.getDefinitions();
if (!defs.containsKey(filterName)) {
    throw new IllegalArgumentException(filterName + " not deployed; available: " + defs.keySet());
}

Type guard

boolean filterDeployed(String name, Map<String, EntryFilterMetaData> defs) { return defs.get(name) != null; }

Try / catch

try {
    filters = provider.loadEntryFilters(names);
} catch (RuntimeException e) {
    log.error("Entry filter load failed: {}", e.getMessage()); // message lists available filters
}

Prevention

When it happens

Trigger: initializeBrokerEntryFilters or loadEntryFiltersForPolicy encounters a filter name in the configured/policy list that has no registered metadata (NAR missing, name mismatch).

Common situations: Same as policy validation but at load time: filter NAR directory misconfigured (wrong broker.conf entryFilter directory), NAR failed to register, policy referencing a filter present on one broker but not another in a heterogeneous cluster.

Related errors


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