{"record":{"id":"d5788f4ddaaa7450","repo":"apache/pulsar","slug":"namespace-is-not-provided","errorCode":null,"errorMessage":"Namespace is not provided","messagePattern":"Namespace is not provided","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java","lineNumber":1553,"sourceCode":"                        authParams);\n            } else {\n                if (!isSuperUser(authParams)) {\n                    throw new RestException(Status.UNAUTHORIZED, \"Client is not authorized to perform operation\");\n                }\n            }\n        }\n\n        return getStreamingOutput(path);\n    }\n\n    private void validateListFunctionRequestParams(final String tenant, final String namespace)\n            throws IllegalArgumentException {\n\n        if (tenant == null) {\n            throw new IllegalArgumentException(\"Tenant is not provided\");\n        }\n        if (namespace == null) {\n            throw new IllegalArgumentException(\"Namespace is not provided\");\n        }\n    }\n\n    protected void validateGetFunctionInstanceRequestParams(final String tenant,\n                                                            final String namespace,\n                                                            final String componentName,\n                                                            final FunctionDetails.ComponentType componentType,\n                                                            final String instanceId) throws IllegalArgumentException {\n        validateGetFunctionRequestParams(tenant, namespace, componentName, componentType);\n        if (instanceId == null) {\n            throw new IllegalArgumentException(String.format(\"%s Instance Id is not provided\", componentType));\n        }\n    }\n\n    protected void validateGetFunctionRequestParams(String tenant, String namespace, String subject,\n                                                    FunctionDetails.ComponentType componentType)\n            throws IllegalArgumentException {\n","sourceCodeStart":1535,"sourceCodeEnd":1571,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java#L1535-L1571","documentation":"An IllegalArgumentException thrown by ComponentImpl.validateListFunctionRequestParams when the namespace parameter is null while listing functions/sinks/sources. The worker requires both tenant and namespace to compose the namespace the components belong to.","triggerScenarios":"Calling listFunctions (REST GET .../functions/{tenant}/{namespace} or the Java admin API) with a valid tenant but null namespace.","commonSituations":"Config file or env var for the namespace missing; programmatic request object built with only the tenant set; URL path truncation producing a null path parameter.","solutions":["Provide the namespace argument (e.g. 'default') in the list request","Fix the caller's configuration/property wiring that left namespace null","Validate request parameters client-side before invoking the API"],"exampleFix":"// before\nadmin.functions().listFunctions(\"public\", null);\n// after\nadmin.functions().listFunctions(\"public\", \"default\");","handlingStrategy":"validation","validationCode":"if (namespace == null || namespace.isEmpty()) {\n    throw new IllegalArgumentException(\"namespace must be provided before listing functions\");\n}","typeGuard":"static boolean hasNamespace(String ns) {\n    return ns != null && !ns.trim().isEmpty();\n}","tryCatchPattern":"try {\n    return admin.functions().listFunctions(tenant, namespace);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().equals(\"Namespace is not provided\")) {\n        namespace = \"default\";\n        return admin.functions().listFunctions(tenant, namespace);\n    }\n    throw e;\n}","preventionTips":["Default namespace to 'default' in tooling when unspecified","Parse fully-qualified names (tenant/namespace/name) with explicit splitting and null checks","Validate request params client-side before any worker REST call"],"tags":["validation","missing-parameter","pulsar-functions","illegal-argument"],"backgroundTag":"missing-required-parameter","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"}