{"record":{"id":"e8f67fc07d0d7a8d","repo":"apache/pulsar","slug":"you-must-specify-either-a-fully-qualified-function","errorCode":null,"errorMessage":"You must specify either a Fully Qualified Function Name (FQFN) or tenant, namespace, and function name","messagePattern":"You must specify either a Fully Qualified Function Name \\(FQFN\\) or tenant, namespace, and function name","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java","lineNumber":144,"sourceCode":"        protected String fqfn;\n\n        @Option(names = \"--tenant\", description = \"The tenant of a Pulsar Function\")\n        protected String tenant;\n\n        @Option(names = \"--namespace\", description = \"The namespace of a Pulsar Function\")\n        protected String namespace;\n\n        @Option(names = \"--name\", description = \"The name of a Pulsar Function\")\n        protected String functionName;\n\n        @Override\n        void processArguments() throws Exception {\n            boolean usesSetters = (null != tenant || null != namespace || null != functionName);\n            boolean usesFqfn = (null != fqfn);\n\n            // Throw an exception if --fqfn is set alongside any combination of --tenant, --namespace, and --name\n            if (usesFqfn && usesSetters) {\n                throw new RuntimeException(\"You must specify either a Fully Qualified Function Name (FQFN) \"\n                        + \"or tenant, namespace, and function name\");\n            } 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                }","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java#L126-L162","documentation":"CmdFunctions.processArguments enforces mutually exclusive function identification: either --fqfn alone, or --tenant/--namespace/--name. If --fqfn is combined with any of the individual setters, a RuntimeException is thrown because the two identification methods could conflict.","triggerScenarios":"Invoking any pulsar-functions subcommand (create, update, delete, get, etc.) with --fqfn together with --tenant, --namespace, or --name on the command line.","commonSituations":"Scripting a command that previously used tenant/namespace/name and adding --fqfn for clarity, or expanding an alias that already contained the individual options.","solutions":["Remove --tenant/--namespace/--name and rely solely on --fqfn tenant/namespace/name.","Or drop --fqfn and keep the explicit --tenant, --namespace, --name options."],"exampleFix":"// before\npulsar-admin functions delete --tenant public --namespace default --name ex --fqfn public/default/ex\n// after\npulsar-admin functions delete --fqfn public/default/ex","handlingStrategy":"validation","validationCode":"if (fqfn != null && (tenant != null || namespace != null || name != null)) {\n    throw new IllegalArgumentException(\"Use either --fqfn or --tenant/--namespace/--name, not both\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    functionsAdmin.delete(fqfnOrParams...);\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"FQFN\")) {\n        System.err.println(\"Specify identification one way: --fqfn alone, or tenant+namespace+name.\");\n    }\n}","preventionTips":["Standardize scripts on one identification style (prefer --fqfn).","Check wrapper-script defaults so --tenant/--name are not silently always set.","Audit command aliases that may embed hidden options."],"tags":["cli","functions","argument-conflict","pulsar-functions"],"backgroundTag":"mutually-exclusive-arguments","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"}