apache/pulsar · error · IllegalArgumentException

Function name is not provided

Error message

Function name is not provided

What it means

Trigger-request validation in ComponentImpl.validateTriggerRequestParams: the trigger payload is incomplete — the excerpt shows the first guards firing on null tenant, with function name among the required parameters — so the function trigger REST call is rejected before execution; the missing request parameter is the faulty input.

Source

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

        return null;
    }

    private void validateTriggerRequestParams(final String tenant,
                                              final String namespace,
                                              final String functionName,
                                              final String topic,
                                              final String input,
                                              final InputStream uploadedInputStream) {
        // Note : Checking topic is not required it can be null

        if (tenant == null) {
            throw new IllegalArgumentException("Tenant is not provided");
        }
        if (namespace == null) {
            throw new IllegalArgumentException("Namespace is not provided");
        }
        if (functionName == null) {
            throw new IllegalArgumentException("Function name is not provided");
        }
        if (uploadedInputStream == null && input == null) {
            throw new IllegalArgumentException("Trigger Data is not provided");
        }
    }

    private void throwStateStoreUnvailableResponse() {
        throw new RestException(Status.SERVICE_UNAVAILABLE,
                "State storage client is not done initializing. " + "Please try again in a little while.");
    }

    public static String createPackagePath(String tenant, String namespace, String functionName, String fileName) {
        return String.format("%s/%s/%s/%s", tenant, namespace, Codec.encode(functionName),
                getUniquePackageName(Codec.encode(fileName)));
    }

    /**
     * @deprecated use {@link #isAuthorizedRole(String, String, AuthenticationParameters)} instead.

View on GitHub (pinned to 820761864e)

Solutions

  1. Provide the function name in the trigger request

Example fix

// before
String fn = cfg.get("functionName"); // null
admin.functions().triggerFunction(tenant, ns, fn, topic, input, is);
// after
String fn = Objects.requireNonNull(cfg.get("functionName"), "functionName required");
admin.functions().triggerFunction(tenant, ns, fn, topic, input, is);
Defensive patterns

Strategy: validation

Validate before calling

Objects.requireNonNull(functionName, "functionName required to trigger a function");

Type guard

boolean isProvided(String s) { return s != null && !s.isEmpty(); }

Try / catch

try { admin.functions().triggerFunction(t, ns, fn, topic, input, is); }
catch (IllegalArgumentException e) { /* log invalid trigger request */ }

Prevention

When it happens

Trigger: POST to /functions/{tenant}/{namespace}/{functionName}/trigger or ComponentImpl.triggerFunction with functionName == null.

Common situations: Trigger CLI invoked without the function name; automated test harness builds the request from config with a missing name field.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


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