{"record":{"id":"d958b324f7014362","repo":"TechnitiumSoftware/DnsServer","slug":"failed-to-update-cluster-options-the-cluster-is-n","errorCode":null,"errorMessage":"Failed to update Cluster options: the Cluster is not initialized.","messagePattern":"Failed to update Cluster options: the Cluster is not initialized\\.","errorType":"exception","errorClass":"DnsServerException","httpStatus":null,"severity":"error","filePath":"DnsServerCore/Cluster/ClusterManager.cs","lineNumber":902,"sourceCode":"                                                    dnsSettings: true,\n                                                    logSettings: false,\n                                                    zones: true,\n                                                    allowedZones: true,\n                                                    blockedZones: true,\n                                                    blockLists: true,\n                                                    apps: true,\n                                                    scopes: false,\n                                                    stats: false,\n                                                    logs: false,\n                                                    isConfigTransfer: true,\n                                                    ifModifiedSince: ifModifiedSince,\n                                                    includeZones: includeZones);\n        }\n\n        public void UpdateClusterOptions(ushort heartbeatRefreshIntervalSeconds, ushort heartbeatRetryIntervalSeconds, ushort configRefreshIntervalSeconds, ushort configRetryIntervalSeconds)\n        {\n            if (!ClusterInitialized)\n                throw new DnsServerException(\"Failed to update Cluster options: the Cluster is not initialized.\");\n\n            if (GetSelfNode().Type != ClusterNodeType.Primary)\n                throw new DnsServerException(\"Failed to update Cluster options: only the Primary node can update the Cluster options.\");\n\n            if ((heartbeatRefreshIntervalSeconds < 10) || (heartbeatRefreshIntervalSeconds > 300))\n                throw new ArgumentOutOfRangeException(nameof(heartbeatRefreshIntervalSeconds));\n\n            if ((heartbeatRetryIntervalSeconds < 10) || (heartbeatRetryIntervalSeconds > 300))\n                throw new ArgumentOutOfRangeException(nameof(heartbeatRetryIntervalSeconds));\n\n            if ((configRefreshIntervalSeconds < 30) || (configRefreshIntervalSeconds > 3600))\n                throw new ArgumentOutOfRangeException(nameof(configRefreshIntervalSeconds));\n\n            if ((configRetryIntervalSeconds < 30) || (configRetryIntervalSeconds > 3600))\n                throw new ArgumentOutOfRangeException(nameof(configRetryIntervalSeconds));\n\n            if (configRefreshIntervalSeconds <= heartbeatRefreshIntervalSeconds)\n                throw new ArgumentException(\"Failed to update Cluster options: The config refresh interval must be greater than the heartbeat refresh interval.\");","sourceCodeStart":884,"sourceCodeEnd":920,"githubUrl":"https://github.com/TechnitiumSoftware/DnsServer/blob/d0484b6c1e7439cdc53d67d81e9c876cda2ad756/DnsServerCore/Cluster/ClusterManager.cs#L884-L920","documentation":"UpdateClusterOptions requires an active cluster (ClusterInitialized true). Cluster-wide timing options (heartbeat/config intervals) only exist once the cluster is set up.","triggerScenarios":"Calling UpdateClusterOptions on a standalone or not-yet-initialized node; after the cluster was left or reset.","commonSituations":"Calling the tuning endpoint before CreateCluster completes; targeting the wrong server; an init failure leaving ClusterInitialized false.","solutions":["Initialize the cluster on the Primary first","Confirm ClusterInitialized before tuning","Re-run init if it failed"],"exampleFix":"// before\nclusterManager.UpdateClusterOptions(hb, hbRetry, cfg, cfgRetry);\n\n// after\nif (!clusterManager.ClusterInitialized)\n    throw new InvalidOperationException(\"Cluster not initialized.\");\nclusterManager.UpdateClusterOptions(hb, hbRetry, cfg, cfgRetry);","handlingStrategy":"validation","validationCode":"if (!clusterManager.ClusterInitialized)\n    return BadRequest(\"Cluster not initialized; cannot update options.\");\nclusterManager.UpdateClusterOptions(hb, hbRetry, cfg, cfgRetry);","typeGuard":null,"tryCatchPattern":"catch (DnsServerException ex) when (ex.Message.Contains(\"Cluster is not initialized\"))\n{ /* init cluster or redirect to Primary */ }","preventionTips":["Gate option-tuning UI on cluster state","Verify initialization before exposing tuning controls"],"tags":["cluster","lifecycle","configuration","validation","dns-server"],"backgroundTag":null,"analyzedSha":"d0484b6c1e7439cdc53d67d81e9c876cda2ad756","analyzedAt":"2026-08-13T22:57:35.508Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}