{"record":{"id":"9e0d9834406eeb0c","repo":"apache/pulsar","slug":"function-name-is-not-provided","errorCode":null,"errorMessage":"Function name is not provided","messagePattern":"Function name is not provided","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java","lineNumber":1658,"sourceCode":"        return null;\n    }\n\n    private void validateTriggerRequestParams(final String tenant,\n                                              final String namespace,\n                                              final String functionName,\n                                              final String topic,\n                                              final String input,\n                                              final InputStream uploadedInputStream) {\n        // Note : Checking topic is not required it can be null\n\n        if (tenant == null) {\n            throw new IllegalArgumentException(\"Tenant is not provided\");\n        }\n        if (namespace == null) {\n            throw new IllegalArgumentException(\"Namespace is not provided\");\n        }\n        if (functionName == null) {\n            throw new IllegalArgumentException(\"Function name is not provided\");\n        }\n        if (uploadedInputStream == null && input == null) {\n            throw new IllegalArgumentException(\"Trigger Data is not provided\");\n        }\n    }\n\n    private void throwStateStoreUnvailableResponse() {\n        throw new RestException(Status.SERVICE_UNAVAILABLE,\n                \"State storage client is not done initializing. \" + \"Please try again in a little while.\");\n    }\n\n    public static String createPackagePath(String tenant, String namespace, String functionName, String fileName) {\n        return String.format(\"%s/%s/%s/%s\", tenant, namespace, Codec.encode(functionName),\n                getUniquePackageName(Codec.encode(fileName)));\n    }\n\n    /**\n     * @deprecated use {@link #isAuthorizedRole(String, String, AuthenticationParameters)} instead.","sourceCodeStart":1640,"sourceCodeEnd":1676,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java#L1640-L1676","documentation":"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.","triggerScenarios":"POST to /functions/{tenant}/{namespace}/{functionName}/trigger or ComponentImpl.triggerFunction with functionName == null.","commonSituations":"Trigger CLI invoked without the function name; automated test harness builds the request from config with a missing name field.","solutions":["Provide the function name in the trigger request"],"exampleFix":"// before\nString fn = cfg.get(\"functionName\"); // null\nadmin.functions().triggerFunction(tenant, ns, fn, topic, input, is);\n// after\nString fn = Objects.requireNonNull(cfg.get(\"functionName\"), \"functionName required\");\nadmin.functions().triggerFunction(tenant, ns, fn, topic, input, is);","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(functionName, \"functionName required to trigger a function\");","typeGuard":"boolean isProvided(String s) { return s != null && !s.isEmpty(); }","tryCatchPattern":"try { admin.functions().triggerFunction(t, ns, fn, topic, input, is); }\ncatch (IllegalArgumentException e) { /* log invalid trigger request */ }","preventionTips":["Resolve the function name from deployment metadata rather than free text","Fail fast when config lookup for the name returns null"],"tags":["pulsar-functions","missing-parameter","function-trigger","validation"],"backgroundTag":"missing-required-parameter","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}