{"record":{"id":"b7cba42a7e1b6d24","repo":"prestodb/presto","slug":"selector-refers-to-nonexistent-group-s","errorCode":null,"errorMessage":"Selector refers to nonexistent group: %s","messagePattern":"Selector refers to nonexistent group: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-resource-group-managers/src/main/java/com/facebook/presto/resourceGroups/AbstractResourceConfigurationManager.java","lineNumber":122,"sourceCode":"                    spec.getGroup()));\n        }\n        return selectors.build();\n    }\n\n    private void validateSelectors(List<ResourceGroupSpec> groups, SelectorSpec spec)\n    {\n        spec.getQueryType().ifPresent(this::validateQueryType);\n        List<ResourceGroupNameTemplate> selectorGroups = spec.getGroup().getSegments();\n        StringBuilder fullyQualifiedGroupName = new StringBuilder();\n        while (!selectorGroups.isEmpty()) {\n            ResourceGroupNameTemplate groupName = selectorGroups.get(0);\n            fullyQualifiedGroupName.append(groupName);\n            Optional<ResourceGroupSpec> match = groups\n                    .stream()\n                    .filter(groupSpec -> groupSpec.getName().equals(groupName))\n                    .findFirst();\n            if (!match.isPresent()) {\n                throw new IllegalArgumentException(format(\"Selector refers to nonexistent group: %s\", fullyQualifiedGroupName.toString()));\n            }\n            fullyQualifiedGroupName.append(\".\");\n            groups = match.get().getSubGroups();\n            selectorGroups = selectorGroups.subList(1, selectorGroups.size());\n        }\n    }\n\n    private void validateQueryType(String queryType)\n    {\n        try {\n            QueryType.valueOf(queryType.toUpperCase());\n        }\n        catch (IllegalArgumentException e) {\n            throw new IllegalArgumentException(format(\"Selector specifies an invalid query type: %s\", queryType));\n        }\n    }\n\n    protected AbstractResourceConfigurationManager(ClusterMemoryPoolManager memoryPoolManager)","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-resource-group-managers/src/main/java/com/facebook/presto/resourceGroups/AbstractResourceConfigurationManager.java#L104-L140","documentation":"AbstractResourceConfigurationManager.validateSelectors walks each selector's group path, matching successive subgroup names against the configured resource group tree. If any segment of the selector's fully-qualified group path does not exist in the resource group specification, it throws IllegalArgumentException 'Selector refers to nonexistent group'.","triggerScenarios":"A selector's group property names a resource group (or nested sub-group) that is absent from the resource group config, or a typo'd group name in a selector, or a selector path whose prefix exists but whose deeper segment doesn't.","commonSituations":"Renamed/deleted resource groups without updating selector rules; JSON/YAML selector files referencing groups defined in a different file that failed to load; indentation mistakes nesting a group under the wrong parent.","solutions":["Align each selector's group path with the actual resource group tree in the config","Fix typos in group names in selector definitions","Check startup logs for resource group spec load failures that leave the tree incomplete","Validate the whole config (group names vs selector references) before deploying"],"exampleFix":"// before\n\"selectors\": [{ \"group\": \"global.adhoc.bi\" }] // 'bi' does not exist\n// after\n\"selectors\": [{ \"group\": \"global.adhoc.analytics\" }]","handlingStrategy":"validation","validationCode":"Set<String> definedGroups = collectAllGroupPaths(resourceGroupSpecs);\nfor (SelectorSpec s : selectors) {\n    if (!definedGroups.contains(s.getGroup())) {\n        throw new IllegalArgumentException(\"selector references unknown group: \" + s.getGroup());\n    }\n}","typeGuard":null,"tryCatchPattern":"try { manager.validateSelectors(selectors, groups); } catch (IllegalArgumentException e) { log.error(\"selector config error: \" + e.getMessage()); throw new ConfigurationException(e.getMessage()); }","preventionTips":["Keep selector group paths in sync with the resource group tree","Run config validation in CI before deploying resource group files","Watch for spec-load failures that silently drop groups","Search configs for renamed/removed group names after refactors"],"tags":["resource-groups","configuration","selector","presto"],"backgroundTag":"selector-nonexistent-group","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}