{"record":{"id":"0325086af028c437","repo":"prestodb/presto","slug":"configuration-invalid-032508","errorCode":"CONFIGURATION_INVALID","errorMessage":"No root groups are configured","messagePattern":"No root groups are configured","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-resource-group-managers/src/main/java/com/facebook/presto/resourceGroups/reloading/ReloadingResourceGroupConfigurationManager.java","lineNumber":109,"sourceCode":"        this.maxRefreshInterval = config.getMaxRefreshInterval();\n        this.exactMatchSelectorEnabled = config.getExactMatchSelectorEnabled();\n        this.managerSpecProvider = requireNonNull(managerSpecProvider, \"provider is null\");\n        load();\n    }\n\n    @Override\n    protected Optional<Duration> getCpuQuotaPeriod()\n    {\n        return cpuQuotaPeriod.get();\n    }\n\n    @Override\n    protected List<ResourceGroupSpec> getRootGroups()\n    {\n        checkMaxRefreshInterval();\n\n        if (this.selectors.get().isEmpty()) {\n            throw new PrestoException(CONFIGURATION_INVALID, \"No root groups are configured\");\n        }\n\n        return rootGroups.get();\n    }\n\n    @PreDestroy\n    public void destroy()\n    {\n        configExecutor.shutdownNow();\n    }\n\n    @PostConstruct\n    public void start()\n    {\n        if (started.compareAndSet(false, true)) {\n            configExecutor.scheduleWithFixedDelay(this::load, 10, 10, TimeUnit.SECONDS);\n        }\n    }","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-resource-group-managers/src/main/java/com/facebook/presto/resourceGroups/reloading/ReloadingResourceGroupConfigurationManager.java#L91-L127","documentation":"ReloadingResourceGroupConfigurationManager.getRootGroups refuses to serve when the reloading selectors list is empty, throwing PrestoException with code CONFIGURATION_INVALID. This guards against routing queries with an empty (failed or not-yet-loaded) configuration.","triggerScenarios":"getRootGroups called before the configuration file has loaded, or after a reload that produced zero selectors; selectors atomic reference empty at call time.","commonSituations":"Resource group config file missing/empty at startup; reload wrote an empty selectors list; manager started before config source is available.","solutions":["Ensure the configuration source defines at least one selector and valid root groups","Check why load() produced an empty selector list (file path, permissions, parse errors) in the manager logs","Call the manager's load/refresh endpoint or restart after fixing the config source"],"exampleFix":"// before (resource-groups.json) missing selectors entirely\n// after: add selectors\n{\"selectors\": [{\"source\": \".*\"}], \"rootGroups\": [...]}","handlingStrategy":"try-catch","validationCode":"if (manager.getSelectors().isEmpty()) {\n    throw new IllegalStateException(\"Refusing to serve queries: no selectors configured\");\n}","typeGuard":null,"tryCatchPattern":"try { rootGroups = manager.getRootGroups(); } catch (PrestoException e) {\n    if (e.getErrorCode() == ResourceGroupManagerErrorCode.CONFIGURATION_INVALID.toErrorCode()) { reloadConfig(); }\n    else throw e;\n}","preventionTips":["Ship a default config with at least one catch-all selector","Monitor refresh failures and config file emptiness","Gate query admission on successful initial config load"],"tags":["presto","resource-groups","configuration"],"backgroundTag":"empty-configuration","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"}