apache/pulsar · error · IllegalArgumentException
Function Names differ
Error message
Function Names differ
What it means
FunctionConfigUtils.validateUpdate refuses an update that changes the function's name: updates must keep the same identity (tenant/namespace/name), and the new config's name differs from the existing one.
Source
Thrown at pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/FunctionConfigUtils.java:994
}
}
public static ExtractedFunctionDetails validateJavaFunction(FunctionConfig functionConfig,
ValidatableFunctionPackage validatableFunctionPackage) {
doCommonChecks(functionConfig);
return doJavaChecks(functionConfig, validatableFunctionPackage);
}
public static FunctionConfig validateUpdate(FunctionConfig existingConfig, FunctionConfig newConfig) {
FunctionConfig mergedConfig = existingConfig.toBuilder().build();
if (!existingConfig.getTenant().equals(newConfig.getTenant())) {
throw new IllegalArgumentException("Tenants differ");
}
if (!existingConfig.getNamespace().equals(newConfig.getNamespace())) {
throw new IllegalArgumentException("Namespaces differ");
}
if (!existingConfig.getName().equals(newConfig.getName())) {
throw new IllegalArgumentException("Function Names differ");
}
if (!StringUtils.isEmpty(newConfig.getClassName())) {
mergedConfig.setClassName(newConfig.getClassName());
}
if (!StringUtils.isEmpty(newConfig.getJar())) {
mergedConfig.setJar(newConfig.getJar());
}
if (newConfig.getInputSpecs() == null) {
newConfig.setInputSpecs(new HashMap<>());
}
if (mergedConfig.getInputSpecs() == null) {
mergedConfig.setInputSpecs(new HashMap<>());
}
if (newConfig.getInputs() != null) {View on GitHub (pinned to 820761864e)
Solutions
- Keep the function name identical when updating
- Delete and recreate with the new name instead
Example fix
// before
updateConfig.setName("exclamation-v2"); // existing name: exclamation
// after
updateConfig.setName(existingConfig.getName()); // "exclamation" Defensive patterns
Strategy: validation
Validate before calling
if (!existingConfig.getName().equals(newConfig.getName())) {
throw new IllegalArgumentException("Update payload must reuse function name " + existingConfig.getName());
} Type guard
boolean sameName(FunctionConfig a, FunctionConfig b) {
return a.getName().equals(b.getName());
} Try / catch
try {
merged = FunctionConfigUtils.validateUpdate(existing, updated);
} catch (IllegalArgumentException e) {
if (e.getMessage().equals("Function Names differ")) {
updated.setName(existing.getName());
merged = FunctionConfigUtils.validateUpdate(existing, updated);
} else { throw e; }
} Prevention
- Source the function name from a single constant/CLI flag used in both create and update.
- Do not encode versions in the function name if you plan to update in place.
- For renames, always delete + create.
When it happens
Trigger: Calling the update function admin API where newConfig.getName() != existingConfig.getName(), e.g. renaming my-function to my-function-v2 via update instead of create.
Common situations: Versioned naming schemes that bump the name on each deploy; renaming to 'fix' a typo via update; template substitutions changing the function name between releases.
Related errors
- Tenants differ
- Namespaces differ
- Input Topics cannot be altered
- isRegexPattern for input topic
- Output Serde mismatch
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/f2ad0b1e9333569e.
Report an issue: GitHub.