apache/pulsar · error · IllegalStateException

Didn't find %s in built-in functions

Error message

Didn't find %s in built-in functions

What it means

For FUNCTION component types (or after the connector lookup), the functions manager is consulted for a built-in function archive. If not found and componentType is non-null, IllegalStateException('Didn't find <type> in built-in functions') is thrown; with null componentType the message mentions both connectors and functions.

Source

Thrown at pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java:1514

    }

    private Path getBuiltinArchivePath(String pkgPath, FunctionDetails.ComponentType componentType) {
        String type = pkgPath.replaceFirst("^builtin://", "");
        if (!FunctionDetails.ComponentType.FUNCTION.equals(componentType)) {
            Connector connector = worker().getConnectorsManager().getConnector(type);
            if (connector != null) {
                return connector.getArchivePath();
            }
            if (componentType != null) {
                throw new IllegalStateException("Didn't find " + type + " in built-in connectors");
            }
        }
        FunctionArchive function = worker().getFunctionsManager().getFunction(type);
        if (function != null) {
            return function.getArchivePath();
        }
        if (componentType != null) {
            throw new IllegalStateException("Didn't find " + type + " in built-in functions");
        }
        throw new IllegalStateException("Didn't find " + type + " in built-in connectors or functions");
    }

    @Override
    public StreamingOutput downloadFunction(final String path, final AuthenticationParameters authParams) {

        if (!isWorkerServiceAvailable()) {
            throwUnavailableException();
        }

        if (worker().getWorkerConfig().isAuthorizationEnabled()) {
            // to maintain backwards compatibility but still have authorization
            String[] tokens = path.split("/");
            if (tokens.length == 4) {
                String tenant = tokens[0];
                String namespace = tokens[1];
                String componentName = tokens[2];

View on GitHub (pinned to 820761864e)

Solutions

  1. Place the built-in function NAR in the worker's functionsDirectory and restart
  2. Use a type from 'pulsar-admin functions available-functions'
  3. Upload your own function package and reference it instead of a builtin type
  4. Fix the type string typo

Example fix

// before
outputSpec: { type: "my-custom-function" }  // not installed
// after
outputSpec: { type: "wordcount" }  // or install the NAR into functionsDirectory
Defensive patterns

Strategy: validation

Validate before calling

boolean known = admin.functions().getBuiltInFunctions().stream()
    .anyMatch(f -> f.equalsIgnoreCase(type));
if (!known) throw new IllegalStateException("type '" + type + "' is not an installed builtin function");

Try / catch

try { resolveArchive(type); } catch (IllegalStateException e) { log.error("builtin function missing: {} — deploy NAR to functionsDirectory", type); }

Prevention

When it happens

Trigger: downloadFunction/getFunctionArchive with type not present in the worker's functionsDirectory registry and not found among built-in connectors either.

Common situations: Built-in function NAR not placed in functionsDirectory; referencing a Java/Python function class name instead of a built-in function type; worker not configured to ship built-in functions.

Related errors


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