{"record":{"id":"c820a074df3ac862","repo":"apache/pulsar","slug":"you-must-specify-a-name-for-the-function-or-a-full","errorCode":null,"errorMessage":"You must specify a name for the function or a Fully Qualified Function Name (FQFN)","messagePattern":"You must specify a name for the function or a Fully Qualified Function Name \\(FQFN\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java","lineNumber":164,"sourceCode":"            } else if (usesFqfn) {\n                // If the --fqfn flag is used, parse tenant, namespace, and name using that flag\n                String[] fqfnParts = fqfn.split(\"/\");\n                if (fqfnParts.length != 3) {\n                    throw new RuntimeException(\n                            \"Fully qualified function names (FQFNs) must be of the form tenant/namespace/name\");\n                }\n                tenant = fqfnParts[0];\n                namespace = fqfnParts[1];\n                functionName = fqfnParts[2];\n            } else {\n                if (tenant == null) {\n                    tenant = PUBLIC_TENANT;\n                }\n                if (namespace == null) {\n                    namespace = DEFAULT_NAMESPACE;\n                }\n                if (null == functionName) {\n                    throw new RuntimeException(\n                            \"You must specify a name for the function or a Fully Qualified Function Name (FQFN)\");\n                }\n            }\n        }\n    }\n\n    /**\n     * Commands that require a function config.\n     */\n    @Getter\n    abstract class FunctionDetailsCommand extends BaseCommand {\n        @Option(names = \"--fqfn\", description = \"The Fully Qualified Function Name (FQFN) for the function\"\n                + \" #Java, Python\")\n        protected String fqfn;\n        @Option(names = \"--tenant\", description = \"The tenant of a Pulsar Function #Java, Python, Go\")\n        protected String tenant;\n        @Option(names = \"--namespace\", description = \"The namespace of a Pulsar Function #Java, Python, Go\")\n        protected String namespace;","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java#L146-L182","documentation":"In the else branch of processArguments, after defaulting tenant and namespace, the function name must still be present; if functionName is null (and no --fqfn was given) a RuntimeException is thrown. Every function operation needs an identifiable name.","triggerScenarios":"Running a functions subcommand with only --tenant (and optionally --namespace), or with none of --tenant/--namespace/--name/--fqfn at all, so no name can be resolved.","commonSituations":"Omitting --name in scripts, assuming the jar filename supplies the name (it doesn't at this CLI parsing stage for all commands), or typos like --function-name instead of --name.","solutions":["Add --name (or --function-name on some subcommands) with the function name.","Or identify the function with --fqfn tenant/namespace/name instead.","If the name should come from the function config, ensure the config file used with --function-config contains a name."],"exampleFix":"// before\npulsar-admin functions create --tenant public --namespace default --jar my.jar --classname org.ex.MyFn\n// after\npulsar-admin functions create --tenant public --namespace default --name myfunc --jar my.jar --classname org.ex.MyFn","handlingStrategy":"validation","validationCode":"if (fqfn == null && functionName == null) {\n    throw new IllegalArgumentException(\"Provide --name (or --fqfn) for the function\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    cmd.run();\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"name for the function\")) {\n        System.err.println(\"Add --name or use --fqfn tenant/namespace/name.\");\n    }\n}","preventionTips":["Always pass --name in scripted function operations.","Prefer --fqfn tenant/namespace/name for unambiguous identification.","Verify flag spelling (--name vs --function-name) for the subcommand in use."],"tags":["cli","functions","missing-argument","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-14T05:17:10.506Z"}