apache/pulsar · error · PulsarAdminException

Tenant ${tenantName} does not yet reference resource group $

Error message

Tenant ${tenantName} does not yet reference resource group ${resourceGroupName}

What it means

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.

Source

Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java:235

        // Ensure schedulers are started if this is the first registration.
        maybeStartSchedulers();
    }

    /**
     * UnRegisters a tenant from a resource group.
     *
     * @param resourceGroupName
     * @param tenantName
     * @throws if the RG does not exist, or if the tenant does not references the RG yet.
     */
    public void unRegisterTenant(String resourceGroupName, String tenantName) throws PulsarAdminException {
        ResourceGroup rg = checkResourceGroupExists(resourceGroupName);

        ResourceGroupOpStatus status = rg.registerUsage(tenantName, ResourceGroupRefTypes.Tenants, false,
                                                        this.resourceUsageTransportManagerMgr);
        if (status == ResourceGroupOpStatus.DoesNotExist) {
            String errMesg = "Tenant " + tenantName + " does not yet reference resource group " + resourceGroupName;
            throw new PulsarAdminException(errMesg);
        }

        // Dissociate this tenant name from the RG.
        this.tenantToRGsMap.remove(tenantName, rg);
        rgTenantUnRegisters.labels(resourceGroupName).inc();

        // If this was the last registration (tenant or namespace), stop schedulers.
        maybeStopSchedulersIfIdle();
    }

    /**
     * Registers a namespace as a user of a resource group.
     *
     * @param resourceGroupName
     * @param fqNamespaceName (i.e., in "tenant/Namespace" format)
     * @throws if the RG does not exist, or if the NS already references the RG.
     */
    public void registerNameSpace(String resourceGroupName, NamespaceName fqNamespaceName) throws PulsarAdminException {

View on GitHub (pinned to 820761864e)

Solutions

  1. Check which RG the tenant is actually registered to and unregister from that one
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java:235 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/pulsar@820761864e (2026-09-06). Data as JSON: /api/errors/bd476652595115d1. Report an issue: GitHub.