{"record":{"id":"b449efbe5ef2952c","repo":"apache/pulsar","slug":"resource-group-does-not-exist-rgname","errorCode":null,"errorMessage":"Resource group does not exist: ${rgName}","messagePattern":"Resource group does not exist: (.+?)","errorType":"exception","errorClass":"PulsarAdminException","httpStatus":null,"severity":"error","filePath":"pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java","lineNumber":147,"sourceCode":"\n        // Return a copy.\n        return new ResourceGroup(retrievedRG);\n    }\n\n    /**\n     * Update RG.\n     *\n     * @throws if RG with that name does not exist.\n     */\n    public void resourceGroupUpdate(String rgName, org.apache.pulsar.common.policies.data.ResourceGroup rgConfig)\n      throws PulsarAdminException {\n        if (rgConfig == null) {\n            throw new IllegalArgumentException(\"ResourceGroupUpdate: Invalid null ResourceGroup config\");\n        }\n\n        ResourceGroup rg = this.getResourceGroupInternal(rgName);\n        if (rg == null) {\n            throw new PulsarAdminException(\"Resource group does not exist: \" + rgName);\n        }\n        rg.updateResourceGroup(rgConfig);\n        rgUpdates.labels(rgName).inc();\n    }\n\n    public Set<String> resourceGroupGetAll() {\n        return resourceGroupsMap.keySet();\n    }\n\n    /**\n     * Delete RG.\n     *\n     * @throws if RG with that name does not exist, or if the RG exists but is still in use.\n     */\n    public void resourceGroupDelete(String name) throws PulsarAdminException {\n        ResourceGroup rg = this.getResourceGroupInternal(name);\n        if (rg == null) {\n            throw new PulsarAdminException(\"Resource group does not exist: \" + name);","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-broker/src/main/java/org/apache/pulsar/broker/resourcegroup/ResourceGroupService.java#L129-L165","documentation":"resourceGroupUpdate looks up the named resource group before applying the update and found none registered in the broker's resource-group map, so the update is rejected — the RG must be created first.","triggerScenarios":"Calling resourceGroupUpdate(rgName, cfg) where getResourceGroupInternal(rgName) returns null — the name was never created or was deleted (locally or on this cluster).","commonSituations":"Typo in the resource group name; update issued against a cluster where the group was never created; group deleted concurrently; running update before bootstrap populated policies.","solutions":["Create the resource group first","Verify the RG name and that it is visible on this broker"],"exampleFix":"// before\nsvc.resourceGroupUpdate(\"rg1\", cfg); // rg1 never created\n// after\nif (svc.getResourceGroup(\"rg1\") == null) {\n  svc.resourceGroupCreate(\"rg1\", cfg);\n} else {\n  svc.resourceGroupUpdate(\"rg1\", cfg);\n}","handlingStrategy":"validation","validationCode":"boolean exists = svc.resourceGroupGetAll().contains(rgName);\nif (!exists) {\n  svc.resourceGroupCreate(rgName, rgConfig); // create-then-update\n} else {\n  svc.resourceGroupUpdate(rgName, rgConfig);\n}","typeGuard":null,"tryCatchPattern":"try {\n  svc.resourceGroupUpdate(rgName, rgConfig);\n} catch (PulsarAdminException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Resource group does not exist\")) {\n    svc.resourceGroupCreate(rgName, rgConfig); // upsert pattern\n  } else throw e;\n}","preventionTips":["Call resourceGroupGet/list before update to confirm existence","Use an upsert (catch not-found, then create) for idempotent automation","Double-check the exact resource group name and target cluster","Ensure bootstrap scripts create required groups before updates run"],"tags":["broker","resource-group","not-found"],"backgroundTag":"resource-not-found","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"}