apache/pulsar · error · ParameterException
Either a Java jar or a Python file or a Go executable binary
Error message
Either a Java jar or a Python file or a Go executable binary needs to be specified for the function. Please specify one.
What it means
Thrown by FunctionDetailsCommand.validateFunctionConfigs when a FunctionConfig has none of the three accepted code artifacts set: jar, py, and go are all blank. Pulsar Functions need one deployable artifact, so the CLI refuses to proceed with a function that has no code.
Source
Thrown at pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java:725
if (StringUtils.isEmpty(functionConfig.getName())) {
throw new IllegalArgumentException("No Function name specified");
}
if (StringUtils.isEmpty(functionConfig.getTenant())) {
org.apache.pulsar.common.functions.Utils.inferMissingTenant(functionConfig);
}
if (StringUtils.isEmpty(functionConfig.getNamespace())) {
org.apache.pulsar.common.functions.Utils.inferMissingNamespace(functionConfig);
}
if (isNotBlank(functionConfig.getJar()) && isNotBlank(functionConfig.getPy())
&& isNotBlank(functionConfig.getGo())) {
throw new ParameterException("Either a Java jar or a Python file or a Go executable binary needs to"
+ " be specified for the function. Cannot specify both.");
}
if (isBlank(functionConfig.getJar()) && isBlank(functionConfig.getPy())
&& isBlank(functionConfig.getGo())) {
throw new ParameterException("Either a Java jar or a Python file or a Go executable binary needs to"
+ " be specified for the function. Please specify one.");
}
if (!isBlank(functionConfig.getJar()) && !functionConfig.getJar().startsWith("builtin://")
&& !Utils.isFunctionPackageUrlSupported(functionConfig.getJar())
&& !new File(functionConfig.getJar()).exists()) {
throw new ParameterException("The specified jar file does not exist");
}
if (!isBlank(functionConfig.getPy()) && !Utils.isFunctionPackageUrlSupported(functionConfig.getPy())
&& !new File(functionConfig.getPy()).exists()) {
throw new ParameterException("The specified python file does not exist");
}
if (!isBlank(functionConfig.getGo()) && !Utils.isFunctionPackageUrlSupported(functionConfig.getGo())
&& !new File(functionConfig.getGo()).exists()) {
throw new ParameterException("The specified go executable binary does not exist");
}
}
}View on GitHub (pinned to 820761864e)
Solutions
- Add exactly one of --jar, --py, or --go pointing at your function artifact
- For built-in functions use --jar builtin://<name>; for remote artifacts use a supported package URL (file://, http://, etc.)
- Check your function config YAML/JSON so the artifact field (jar/py/go) is actually populated
Example fix
// before pulsar-admin functions create --tenant t --namespace n --name f --inputs in // after pulsar-admin functions create --tenant t --namespace n --name f --inputs in --jar my.jar
Defensive patterns
Strategy: validation
Validate before calling
if (blank(config.getJar()) && blank(config.getPy()) && blank(config.getGo())) {
throw new IllegalArgumentException("FunctionConfig requires one of jar, py, or go");
} Type guard
boolean hasArtifact(FunctionConfig c) {
return isNonBlank(c.getJar()) || isNonBlank(c.getPy()) || isNonBlank(c.getGo());
} Try / catch
try { admin.functions().createFunction(...); }
catch (ParameterException e) { if (e.getMessage().contains("Please specify one")) { log.error("No artifact specified for function"); } throw e; } Prevention
- Always include the artifact flag (--jar/--py/--go) in create/update commands
- Validate function config YAML has a non-empty artifact key before deployment
- Use builtin:// references for built-in functions when no local artifact exists
When it happens
Trigger: `pulsar-admin functions create/update/localrun` invoked without --jar, --py, or --go (or with all of them empty), at CmdFunctions.java:725.
Common situations: Forgetting the artifact flag while specifying tenant/namespace/inputs; a config file where the artifact key is misspelled or empty; templates with placeholder values stripped; running localrun expecting the artifact to be inherited from an existing config.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Either a Java jar or a Python file or a Go executable binary
- Function Name not provided
- State key needs to be specified
- Either a trigger value or a trigger filepath needs to be spe
- --source-file needs to be specified
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/761a4661c115268b.
Report an issue: GitHub.