{"record":{"id":"12e22b67dcf07228","repo":"apache/pulsar","slug":"namespace-s-does-not-yet-reference-resource-group","errorCode":null,"errorMessage":"Namespace %s does not yet reference resource group %s","messagePattern":"Namespace (.+?) does not yet reference resource group (.+?)","errorType":"exception","errorClass":"PulsarAdminException","httpStatus":null,"severity":"error","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java","lineNumber":296,"sourceCode":"    }\n\n    /**\n     * UnRegisters a namespace from a resource group.\n     *\n     * @param resourceGroupName\n     * @param fqNamespaceName i.e., in \"tenant/Namespace\" format)\n     * @throws if the RG does not exist, or if the NS does not references the RG yet.\n     */\n    public void unRegisterNameSpace(String resourceGroupName, NamespaceName fqNamespaceName)\n            throws PulsarAdminException {\n        ResourceGroup rg = checkResourceGroupExists(resourceGroupName);\n\n        ResourceGroupOpStatus status = rg.registerUsage(fqNamespaceName.toString(), ResourceGroupRefTypes.Namespaces,\n                false, this.resourceUsageTransportManagerMgr);\n        if (status == ResourceGroupOpStatus.DoesNotExist) {\n            String errMesg = String.format(\"Namespace %s does not yet reference resource group %s\",\n                    fqNamespaceName, resourceGroupName);\n            throw new PulsarAdminException(errMesg);\n        }\n\n        // Dissociate this NS-name from the RG.\n        this.namespaceToRGsMap.remove(fqNamespaceName, rg);\n        rgNamespaceUnRegisters.labels(resourceGroupName).inc();\n\n        // If this was the last registration (tenant or namespace), stop schedulers.\n        maybeStopSchedulersIfIdle();\n    }\n\n    /**\n     * Return the resource group associated with a namespace.\n     *\n     * @param namespaceName\n     * @throws if the RG does not exist, or if the NS already references the RG.\n     */\n    public ResourceGroup getNamespaceResourceGroup(NamespaceName namespaceName) {\n        return this.namespaceToRGsMap.get(namespaceName);","sourceCodeStart":278,"sourceCodeEnd":314,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java#L278-L314","documentation":"Namespace-level unregistration mismatch in unRegisterNameSpace: ResourceGroup.registerUsage reports the namespace is not bound to the given resource group, so the requested removal cannot proceed. Usually a double-unregister or a mismatched RG name in the namespace policy.","triggerScenarios":"Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java:296 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the RG name matches the namespace's actual binding"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}