TechnitiumSoftware/DnsServer · error · DnsServerException

Failed to update Secondary node: the Cluster is not initiali

Error message

Failed to update Secondary node: the Cluster is not initialized.

What it means

UpdateSecondaryNode refuses to run because the local node has not initialized or joined a cluster (ClusterInitialized is false). Every Secondary-node management call requires an active cluster context on the Primary.

Source

Thrown at DnsServerCore/Cluster/ClusterManager.cs:819

            //update cluster catalog zone ACLs and save zone file
            UpdateClusterCatalogZoneOptions();

            //save all changes
            SaveConfigFile();

            //notify all secondary nodes
            TriggerNotifyAllSecondaryNodes();

            //trigger NS and SOA update for member zones
            TriggerRecordUpdateForClusterCatalogMemberZones();

            return secondaryNode;
        }

        public ClusterNode UpdateSecondaryNode(int secondaryNodeId, Uri secondaryNodeUrl, IReadOnlyList<IPAddress> secondaryNodeIpAddresses, X509Certificate2 secondaryNodeCertificate)
        {
            if (!ClusterInitialized)
                throw new DnsServerException("Failed to update Secondary node: the Cluster is not initialized.");

            if (GetSelfNode().Type != ClusterNodeType.Primary)
                throw new DnsServerException("Failed to update Secondary node: only a Primary node can update a Secondary node's details in the Cluster.");

            IReadOnlyDictionary<int, ClusterNode> clusterNodes = _clusterNodes;

            if (!clusterNodes.TryGetValue(secondaryNodeId, out ClusterNode secondaryNode))
                throw new DnsServerException("Failed to update Secondary node: the specified node does not exist in the Cluster.");

            if (secondaryNode.Type != ClusterNodeType.Secondary)
                throw new DnsServerException("Failed to update Secondary node: the specified node to update must be a Secondary node.");

            //validate for duplicate names
            foreach (KeyValuePair<int, ClusterNode> clusterNode in clusterNodes)
            {
                if (clusterNode.Key == secondaryNodeId)
                    continue; //skip self

View on GitHub (pinned to d0484b6c1e)

Solutions

  1. Ensure the server is the cluster Primary and ClusterInitialized is true before calling
  2. Point the call at the Primary node's API endpoint, not a Secondary or standalone server
  3. Re-run cluster initialization if it failed earlier

Example fix

// before
clusterManager.UpdateSecondaryNode(id, url, ips, cert);

// after
if (!clusterManager.ClusterInitialized)
    throw new InvalidOperationException("Cluster not initialized; cannot update Secondary node.");
clusterManager.UpdateSecondaryNode(id, url, ips, cert);
Defensive patterns

Strategy: validation

Validate before calling

if (!clusterManager.ClusterInitialized)
    return BadRequest("Cluster is not initialized on this node.");
clusterManager.UpdateSecondaryNode(id, url, ips, cert);

Try / catch

catch (DnsServerException ex) when (ex.Message.Contains("Cluster is not initialized"))
{ /* route the client to the Primary node or init the cluster */ }

Prevention

When it happens

Trigger: Calling UpdateSecondaryNode before CreateCluster/InitializeAndJoinClusterAsync completed; calling it on a standalone non-clustered server; calling after the cluster was left or reset.

Common situations: Misrouted API call hitting a node that is not the cluster Primary; stale config pointing automation at the wrong server; an earlier cluster initialization that failed silently.

Related errors


AI-assisted analysis of TechnitiumSoftware/DnsServer@d0484b6c1e (2026-08-13). Data as JSON: /api/errors/79f0e42e04d1c0a6. Report an issue: GitHub.