{"record":{"id":"556ae419bd4d24f7","repo":"apache/pulsar","slug":"tenant-is-not-provided","errorCode":null,"errorMessage":"Tenant is not provided","messagePattern":"Tenant 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":1550,"sourceCode":"                String componentName = tokens[2];\n\n                throwRestExceptionIfUnauthorizedForNamespace(tenant, namespace, componentName, \"download package for\",\n                        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,","sourceCodeStart":1532,"sourceCodeEnd":1568,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/rest/api/ComponentImpl.java#L1532-L1568","documentation":"An IllegalArgumentException thrown by ComponentImpl.validateListFunctionRequestParams when the tenant parameter is null while listing functions/sinks/sources in a namespace. It is a fail-fast guard so the worker never queries the function metadata store with an incomplete fully-qualified name.","triggerScenarios":"Calling listFunctions (REST GET .../functions/{tenant}/{namespace} or the Java admin API) with a null tenant argument, e.g. from a programmatically built request where the tenant field was never populated.","commonSituations":"Client code building a ListFunction request from parsed config where the tenant key is absent; REST call with empty path segments mapped to null; SDK versions where defaults were not applied.","solutions":["Supply a non-null tenant in the list request (e.g. public/default)","Fix the client configuration so the tenant value is read and passed correctly","Validate inputs on the caller side before invoking the admin API"],"exampleFix":"// before\nadmin.functions().listFunctions(null, \"default\");\n// after\nadmin.functions().listFunctions(\"public\", \"default\");","handlingStrategy":"validation","validationCode":"if (tenant == null || tenant.isEmpty()) {\n    throw new IllegalArgumentException(\"tenant must be provided before listing functions\");\n}","typeGuard":"static boolean hasTenant(String tenant) {\n    return tenant != null && !tenant.trim().isEmpty();\n}","tryCatchPattern":"try {\n    return admin.functions().listFunctions(tenant, namespace);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().equals(\"Tenant is not provided\")) {\n        tenant = resolveDefaultTenant();\n        return admin.functions().listFunctions(tenant, namespace);\n    }\n    throw e;\n}","preventionTips":["Always initialize tenant to 'public' as a default in client configs","Validate the full tenant/namespace/name triple before any admin API call","Fail fast at config-load time if required Pulsar coordinates are missing"],"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"}