{"record":{"id":"096853656f0666c5","repo":"apache/pulsar","slug":"trigger-data-is-not-provided","errorCode":null,"errorMessage":"Trigger Data is not provided","messagePattern":"Trigger Data 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":1661,"sourceCode":"    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.\n     */\n    @Deprecated\n    public boolean isAuthorizedRole(String tenant, String namespace, String clientRole,","sourceCodeStart":1643,"sourceCodeEnd":1679,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java#L1643-L1679","documentation":"Thrown by the trigger-request validation in ComponentImpl when neither trigger data (input string) nor an uploaded input stream is supplied. Triggering a function means feeding it data, so at least one of the two must be present. Topic may be null, but the trigger payload itself cannot.","triggerScenarios":"POST to /functions/{tenant}/{namespace}/{functionName}/trigger with an empty body and no multipart uploadedInputStream, or ComponentImpl.triggerFunction called with input == null && uploadedInputStream == null.","commonSituations":"curl POST with no --data body; multipart form missing the data field; scripts testing functions that forget to attach the trigger input.","solutions":["Provide the trigger data as the request body (e.g. curl --data 'payload').","Or attach the input via multipart file upload (uploadedInputStream).","If programmatically calling, assert at least one of input/uploadedInputStream is non-null first."],"exampleFix":"// before\ncurl -X POST /admin/v3/functions/public/default/my-fn/trigger\n// after\ncurl -X POST /admin/v3/functions/public/default/my-fn/trigger --data 'test-message'","handlingStrategy":"validation","validationCode":"if ((input == null || input.isEmpty()) && uploadedInputStream == null) throw new IllegalArgumentException(\"trigger data (input or file) required\");","typeGuard":"boolean hasTriggerData(String input, java.io.InputStream stream) { return (input != null && !input.isEmpty()) || stream != null; }","tryCatchPattern":"try { admin.functions().triggerFunction(t, ns, fn, topic, input, is); }\ncatch (IllegalArgumentException e) { /* log missing trigger data */ }","preventionTips":["Always pass --data or a file when triggering via curl","Check both input string and stream before calling the trigger API"],"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"}