apache/pulsar · error · IllegalArgumentException
%s name is not provided
Error message
%s name is not provided
What it means
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'.
Source
Thrown at pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java:1579
final String instanceId) throws IllegalArgumentException {
validateGetFunctionRequestParams(tenant, namespace, componentName, componentType);
if (instanceId == null) {
throw new IllegalArgumentException(String.format("%s Instance Id is not provided", componentType));
}
}
protected void validateGetFunctionRequestParams(String tenant, String namespace, String subject,
FunctionDetails.ComponentType componentType)
throws IllegalArgumentException {
if (tenant == null) {
throw new IllegalArgumentException("Tenant is not provided");
}
if (namespace == null) {
throw new IllegalArgumentException("Namespace is not provided");
}
if (subject == null) {
throw new IllegalArgumentException(ComponentTypeUtils.toString(componentType) + " name is not provided");
}
}
private void validateDeregisterRequestParams(String tenant, String namespace, String subject,
FunctionDetails.ComponentType componentType)
throws IllegalArgumentException {
if (tenant == null) {
throw new IllegalArgumentException("Tenant is not provided");
}
if (namespace == null) {
throw new IllegalArgumentException("Namespace is not provided");
}
if (subject == null) {
throw new IllegalArgumentException(ComponentTypeUtils.toString(componentType) + " name is not provided");
}
}
View on GitHub (pinned to 820761864e)
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
Example fix
// before
admin.functions().getFunction("public", "default", null);
// after
admin.functions().getFunction("public", "default", "my-fn"); Defensive patterns
Strategy: validation
Validate before calling
if (name == null || name.isEmpty()) {
throw new IllegalArgumentException("component name must be provided");
} Type guard
static boolean hasComponentName(String name) {
return name != null && !name.trim().isEmpty();
} Try / catch
try {
return admin.functions().getFunction(tenant, ns, name);
} catch (IllegalArgumentException e) {
if (e.getMessage().endsWith("name is not provided")) {
throw new IllegalStateException("Component name missing in request", e);
}
throw e;
} Prevention
- 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
When it happens
Trigger: Calling getFunction/getFunctionStatus/getSink/getSource with tenant and namespace set but a null component name argument.
Common situations: 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.
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
- Tenant is not provided
- Namespace is not provided
- %s Instance Id is not provided
- Key is not provided
- Function name is not provided
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/7535c6948cc6b6a1.
Report an issue: GitHub.