{"record":{"id":"bd476652595115d1","repo":"apache/pulsar","slug":"tenant-tenantname-does-not-yet-reference-resour","errorCode":null,"errorMessage":"Tenant ${tenantName} does not yet reference resource group ${resourceGroupName}","messagePattern":"Tenant (.+?) 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":235,"sourceCode":"        // Ensure schedulers are started if this is the first registration.\n        maybeStartSchedulers();\n    }\n\n    /**\n     * UnRegisters a tenant from a resource group.\n     *\n     * @param resourceGroupName\n     * @param tenantName\n     * @throws if the RG does not exist, or if the tenant does not references the RG yet.\n     */\n    public void unRegisterTenant(String resourceGroupName, String tenantName) throws PulsarAdminException {\n        ResourceGroup rg = checkResourceGroupExists(resourceGroupName);\n\n        ResourceGroupOpStatus status = rg.registerUsage(tenantName, ResourceGroupRefTypes.Tenants, false,\n                                                        this.resourceUsageTransportManagerMgr);\n        if (status == ResourceGroupOpStatus.DoesNotExist) {\n            String errMesg = \"Tenant \" + tenantName + \" does not yet reference resource group \" + resourceGroupName;\n            throw new PulsarAdminException(errMesg);\n        }\n\n        // Dissociate this tenant name from the RG.\n        this.tenantToRGsMap.remove(tenantName, rg);\n        rgTenantUnRegisters.labels(resourceGroupName).inc();\n\n        // If this was the last registration (tenant or namespace), stop schedulers.\n        maybeStopSchedulersIfIdle();\n    }\n\n    /**\n     * Registers a namespace as a user of 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 already references the RG.\n     */\n    public void registerNameSpace(String resourceGroupName, NamespaceName fqNamespaceName) throws PulsarAdminException {","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java#L217-L253","documentation":"Resource-group unregistration mismatch in unRegisterTenant: the tenant is not currently associated with the named resource group (ResourceGroup.registerUsage returns a failure status), so there is nothing to remove. Typically caused by unregistering twice or by naming a different RG than the one the tenant actually references.","triggerScenarios":"Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java:235 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check which RG the tenant is actually registered to and unregister from that one"],"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-14T00:17:10.932Z"}