{"record":{"id":"2a19025d60510a43","repo":"apache/pulsar","slug":"fully-qualified-function-names-fqfns-must-be-of","errorCode":null,"errorMessage":"Fully qualified function names (FQFNs) must be of the form tenant/namespace/name","messagePattern":"Fully qualified function names \\(FQFNs\\) must be of the form tenant/namespace/name","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java","lineNumber":150,"sourceCode":"        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                }\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        }","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdFunctions.java#L132-L168","documentation":"When --fqfn is used, CmdFunctions splits it on '/' and requires exactly three parts: tenant, namespace, and function name. An FQFN with a different number of segments throws a RuntimeException describing the required tenant/namespace/name form.","triggerScenarios":"Passing --fqfn values like 'public/default' (missing name), 'public/default/ex/extra', or an empty/garbled string so split('/') yields != 3 parts.","commonSituations":"Truncating an FQFN copied from a UI, including a topic-like extra segment, or using backslashes instead of forward slashes on Windows shells.","solutions":["Supply the full three-part FQFN: --fqfn tenant/namespace/functionName.","Count the '/' separators — exactly two are allowed.","Alternatively use --tenant/--namespace/--name explicitly instead of --fqfn."],"exampleFix":"// before\npulsar-admin functions get --fqfn public/default\n// after\npulsar-admin functions get --fqfn public/default/myfunc","handlingStrategy":"validation","validationCode":"if (fqfn != null) {\n    String[] parts = fqfn.split(\"/\");\n    if (parts.length != 3 || fqfn.startsWith(\"/\") || fqfn.endsWith(\"/\")) {\n        throw new IllegalArgumentException(\"FQFN must be tenant/namespace/name: \" + fqfn);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    admin.functions().getFunction(tenant, ns, name);\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"tenant/namespace/name\")) {\n        System.err.println(\"Malformed FQFN; expected exactly two '/' separators.\");\n    }\n}","preventionTips":["Build FQFNs programmatically as String.join(\"/\", tenant, namespace, name).","Never append status/extra segments to an FQFN.","Trim slashes and whitespace before passing FQFNs on the command line."],"tags":["cli","functions","fqfn","validation"],"backgroundTag":"invalid-fqfn-format","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"}