{"record":{"id":"761a4661c115268b","repo":"apache/pulsar","slug":"either-a-java-jar-or-a-python-file-or-a-go-executa-761a46","errorCode":null,"errorMessage":"Either a Java jar or a Python file or a Go executable binary needs to be specified for the function. Please specify one.","messagePattern":"Either a Java jar or a Python file or a Go executable binary needs to be specified for the function\\. Please specify one\\.","errorType":"validation","errorClass":"ParameterException","httpStatus":null,"severity":"error","filePath":"pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java","lineNumber":725,"sourceCode":"            if (StringUtils.isEmpty(functionConfig.getName())) {\n                throw new IllegalArgumentException(\"No Function name specified\");\n            }\n            if (StringUtils.isEmpty(functionConfig.getTenant())) {\n                org.apache.pulsar.common.functions.Utils.inferMissingTenant(functionConfig);\n            }\n            if (StringUtils.isEmpty(functionConfig.getNamespace())) {\n                org.apache.pulsar.common.functions.Utils.inferMissingNamespace(functionConfig);\n            }\n\n            if (isNotBlank(functionConfig.getJar()) && isNotBlank(functionConfig.getPy())\n                    && isNotBlank(functionConfig.getGo())) {\n                throw new ParameterException(\"Either a Java jar or a Python file or a Go executable binary needs to\"\n                        + \" be specified for the function. Cannot specify both.\");\n            }\n\n            if (isBlank(functionConfig.getJar()) && isBlank(functionConfig.getPy())\n                    && isBlank(functionConfig.getGo())) {\n                throw new ParameterException(\"Either a Java jar or a Python file or a Go executable binary needs to\"\n                        + \" be specified for the function. Please specify one.\");\n            }\n\n            if (!isBlank(functionConfig.getJar()) && !functionConfig.getJar().startsWith(\"builtin://\")\n                    && !Utils.isFunctionPackageUrlSupported(functionConfig.getJar())\n                    && !new File(functionConfig.getJar()).exists()) {\n                throw new ParameterException(\"The specified jar file does not exist\");\n            }\n            if (!isBlank(functionConfig.getPy()) && !Utils.isFunctionPackageUrlSupported(functionConfig.getPy())\n                    && !new File(functionConfig.getPy()).exists()) {\n                throw new ParameterException(\"The specified python file does not exist\");\n            }\n            if (!isBlank(functionConfig.getGo()) && !Utils.isFunctionPackageUrlSupported(functionConfig.getGo())\n                    && !new File(functionConfig.getGo()).exists()) {\n                throw new ParameterException(\"The specified go executable binary does not exist\");\n            }\n        }\n    }","sourceCodeStart":707,"sourceCodeEnd":743,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java#L707-L743","documentation":"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.","triggerScenarios":"`pulsar-admin functions create/update/localrun` invoked without --jar, --py, or --go (or with all of them empty), at CmdFunctions.java:725.","commonSituations":"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.","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"],"exampleFix":"// before\npulsar-admin functions create --tenant t --namespace n --name f --inputs in\n// after\npulsar-admin functions create --tenant t --namespace n --name f --inputs in --jar my.jar","handlingStrategy":"validation","validationCode":"if (blank(config.getJar()) && blank(config.getPy()) && blank(config.getGo())) {\n    throw new IllegalArgumentException(\"FunctionConfig requires one of jar, py, or go\");\n}","typeGuard":"boolean hasArtifact(FunctionConfig c) {\n    return isNonBlank(c.getJar()) || isNonBlank(c.getPy()) || isNonBlank(c.getGo());\n}","tryCatchPattern":"try { admin.functions().createFunction(...); }\ncatch (ParameterException e) { if (e.getMessage().contains(\"Please specify one\")) { log.error(\"No artifact specified for function\"); } throw e; }","preventionTips":["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"],"tags":["cli","validation","pulsar-functions"],"backgroundTag":"missing-required-argument","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"}