{"record":{"id":"7535c6948cc6b6a1","repo":"apache/pulsar","slug":"s-name-is-not-provided","errorCode":null,"errorMessage":"%s name is not provided","messagePattern":"(.+?) 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":1579,"sourceCode":"                                                            final String instanceId) throws IllegalArgumentException {\n        validateGetFunctionRequestParams(tenant, namespace, componentName, componentType);\n        if (instanceId == null) {\n            throw new IllegalArgumentException(String.format(\"%s Instance Id is not provided\", componentType));\n        }\n    }\n\n    protected void validateGetFunctionRequestParams(String tenant, String namespace, String subject,\n                                                    FunctionDetails.ComponentType componentType)\n            throws IllegalArgumentException {\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 (subject == null) {\n            throw new IllegalArgumentException(ComponentTypeUtils.toString(componentType) + \" name is not provided\");\n        }\n    }\n\n    private void validateDeregisterRequestParams(String tenant, String namespace, String subject,\n                                                 FunctionDetails.ComponentType componentType)\n            throws IllegalArgumentException {\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 (subject == null) {\n            throw new IllegalArgumentException(ComponentTypeUtils.toString(componentType) + \" name is not provided\");\n        }\n    }\n","sourceCodeStart":1561,"sourceCodeEnd":1597,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java#L1561-L1597","documentation":"An IllegalArgumentException thrown by ComponentImpl.validateGetFunctionRequestParams when the subject (component name) is null while getting a function/sink/source. The message interpolates the component type via ComponentTypeUtils.toString(componentType), e.g. 'Function name is not provided'.","triggerScenarios":"Calling getFunction/getFunctionStatus/getSink/getSource with tenant and namespace set but a null component name argument.","commonSituations":"Component name not passed from CLI flags or config; variable shadowing/typo leaving the name variable null; generic request-builder used where the name slot was never filled.","solutions":["Pass the function/sink/source name in the request","Fix the caller's argument wiring that left the name null","Check for typos between the config key and the field read"],"exampleFix":"// before\nadmin.functions().getFunction(\"public\", \"default\", null);\n// after\nadmin.functions().getFunction(\"public\", \"default\", \"my-fn\");","handlingStrategy":"validation","validationCode":"if (name == null || name.isEmpty()) {\n    throw new IllegalArgumentException(\"component name must be provided\");\n}","typeGuard":"static boolean hasComponentName(String name) {\n    return name != null && !name.trim().isEmpty();\n}","tryCatchPattern":"try {\n    return admin.functions().getFunction(tenant, ns, name);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().endsWith(\"name is not provided\")) {\n        throw new IllegalStateException(\"Component name missing in request\", e);\n    }\n    throw e;\n}","preventionTips":["Map CLI flags/config keys to the name field explicitly and check for typos","Require the component name in request builders (no implicit defaults)","Log the request triple before sending to spot nulls early"],"tags":["validation","missing-parameter","pulsar-functions","illegal-argument"],"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-14T05:17:10.506Z"}