{"record":{"id":"8424542a76406a57","repo":"apache/pulsar","slug":"function-name-not-provided","errorCode":null,"errorMessage":"Function Name not provided","messagePattern":"Function Name not provided","errorType":"validation","errorClass":"ParameterException","httpStatus":null,"severity":"error","filePath":"pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java","lineNumber":1025,"sourceCode":"        void runCmd() throws Exception {\n            getAdmin().functions().deleteFunction(tenant, namespace, functionName);\n            print(\"Deleted successfully\");\n        }\n    }\n\n    @Command(description = \"Update a Pulsar Function that has been deployed to a Pulsar cluster\")\n    class UpdateFunction extends FunctionDetailsCommand {\n\n        @Option(names = \"--update-auth-data\", description = \"Whether or not to update the auth data #Java, Python\")\n        protected boolean updateAuthData;\n\n        @Override\n        protected void validateFunctionConfigs(FunctionConfig functionConfig) {\n            if (StringUtils.isEmpty(functionConfig.getName())) {\n                org.apache.pulsar.common.functions.Utils.inferMissingFunctionName(functionConfig);\n            }\n            if (StringUtils.isEmpty(functionConfig.getName())) {\n                throw new ParameterException(\"Function Name not provided\");\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\n        @Override\n        void runCmd() throws Exception {\n\n            UpdateOptionsImpl updateOptions = new UpdateOptionsImpl();\n            updateOptions.setUpdateAuthData(updateAuthData);\n            if (Utils.isFunctionPackageUrlSupported(functionConfig.getJar())) {\n                getAdmin().functions().updateFunctionWithUrl(functionConfig, functionConfig.getJar(), updateOptions);\n            } else if (Utils.isFunctionPackageUrlSupported(functionConfig.getPy())) {\n                getAdmin().functions().updateFunctionWithUrl(functionConfig, functionConfig.getPy(), updateOptions);","sourceCodeStart":1007,"sourceCodeEnd":1043,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java#L1007-L1043","documentation":"Thrown when a FunctionConfig still has no function name after inference. The CLI first tries Utils.inferMissingFunctionName (deriving a name from the artifact file name); if the name is still empty it raises this ParameterException because tenant/namespace/name are mandatory to address a function.","triggerScenarios":"`pulsar-admin functions create/update` with neither --name set nor an artifact from which a name can be inferred, hitting the check at CmdFunctions.java:1025 (OverrideConfigCommand path).","commonSituations":"Using a package URL (e.g. http://...) as the artifact so no filename-based name can be inferred and --name omitted; config YAML missing the `name` field; scripts that pass tenant/namespace but forget the function name.","solutions":["Pass --name <functionName> explicitly on the command line","Ensure your function config YAML/JSON includes a `name` field","If relying on inference, use a local file artifact whose filename can supply the name"],"exampleFix":"// before\npulsar-admin functions create --tenant t --namespace n --jar http://host/f.jar\n// after\npulsar-admin functions create --tenant t --namespace n --name myfunc --jar http://host/f.jar","handlingStrategy":"validation","validationCode":"if (config.getName() == null || config.getName().isBlank()) {\n    throw new IllegalArgumentException(\"Function name must be provided via --name\");\n}","typeGuard":null,"tryCatchPattern":"try { admin.functions().createFunction(...); }\ncatch (ParameterException e) { if (e.getMessage().equals(\"Function Name not provided\")) { log.error(\"Pass --name or use a file artifact so a name can be inferred\"); } throw e; }","preventionTips":["Always pass --name explicitly rather than relying on filename inference","Keep the `name` field populated in function config YAML","Note that inference works from local file artifacts, not remote URLs"],"tags":["cli","validation","naming","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"}