{"record":{"id":"3dd01b3129913bba","repo":"prestodb/presto","slug":"configuration-unavailable-3dd01b","errorCode":"CONFIGURATION_UNAVAILABLE","errorMessage":"Resource group configuration cannot be fetched from source.","messagePattern":"Resource group configuration cannot be fetched from source\\.","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"critical","filePath":"presto-resource-group-managers/src/main/java/com/facebook/presto/resourceGroups/reloading/ReloadingResourceGroupConfigurationManager.java","lineNumber":293,"sourceCode":"        while (parent.isPresent()) {\n            current = parent.get();\n            parent = current.getParent();\n        }\n\n        ResourceGroup rootResourceGroup = groups.get(current);\n        checkState(rootResourceGroup != null, \"%s is missing in the groups map for groupId %s\", current, groupId);\n        return rootResourceGroup;\n    }\n\n    private void checkMaxRefreshInterval()\n    {\n        if (System.nanoTime() - lastRefresh.get() > maxRefreshInterval.toMillis() * MILLISECONDS.toNanos(1)) {\n            String message = \"Resource group configuration cannot be fetched from source.\";\n            if (lastRefresh.get() != 0) {\n                message += format(\" Current resource group configuration is loaded %s ago\", succinctNanos(System.nanoTime() - lastRefresh.get()).toString());\n            }\n\n            throw new PrestoException(CONFIGURATION_UNAVAILABLE, message);\n        }\n    }\n\n    @Managed\n    @Nested\n    public CounterStat getRefreshFailures()\n    {\n        return refreshFailures;\n    }\n}\n","sourceCodeStart":275,"sourceCodeEnd":304,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-resource-group-managers/src/main/java/com/facebook/presto/resourceGroups/reloading/ReloadingResourceGroupConfigurationManager.java#L275-L304","documentation":"checkMaxRefreshInterval throws PrestoException CONFIGURATION_UNAVAILABLE when the time since the last successful config refresh exceeds maxRefreshInterval, signaling callers that the cached configuration is stale and the source could not be reached. The message appends how long ago the config was loaded when a load happened before.","triggerScenarios":"getRootGroups, match, or getSelectors invoked more than maxRefreshInterval after the last successful load; the periodic refresh job failing (source unreachable, parse error) so lastRefresh is not updated.","commonSituations":"Config store/network outage while the coordinator keeps accepting queries; misconfigured refresh interval shorter than the reload period; source persistently failing so staleness grows past the threshold.","solutions":["Restore connectivity/availability of the configuration source and let the refresh succeed","Increase maxRefreshInterval in the manager properties to tolerate longer source outages","Investigate refresh failures via the exposed refreshFailures stat and reload logs"],"exampleFix":"// before\nresource-group.config-manager=...\nrefresh-interval=1s max-refresh-interval=2s\n// after\nrefresh-interval=30s max-refresh-interval=10m","handlingStrategy":"try-catch","validationCode":"// Track last successful refresh yourself and warn before the threshold\nlong nanosSinceRefresh = System.nanoTime() - lastRefreshNanos;\nif (nanosSinceRefresh > maxRefreshIntervalNanos * 0.8) log.warn(\"Resource group config nearly stale\");","typeGuard":null,"tryCatchPattern":"try { return manager.match(criteria); } catch (PrestoException e) {\n    if (e.getErrorCode().getName().equals(\"CONFIGURATION_UNAVAILABLE\")) {\n        manager.load(); // force refresh, then retry once\n        return manager.match(criteria);\n    }\n    throw e;\n}","preventionTips":["Set maxRefreshInterval well above the normal refresh interval to absorb transient outages","Monitor the refreshFailures stat and alert on sustained failures","Ensure the config source is highly available (replicated store) and the reload job retries with backoff"],"tags":["presto","resource-groups","configuration","availability"],"backgroundTag":"stale-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"}