nats-io/nats-server · error
config reload not supported for cluster host: old=%s, new=%s
Error message
config reload not supported for cluster host: old=%s, new=%s
What it means
validateClusterOpts blocks a config reload that changes cluster.host: the cluster listener's bind address cannot be changed without recreating the listener socket, so reload aborts with the old and new host values. The running server keeps its original cluster host; the new config is discarded.
Source
Thrown at server/reload.go:2783
return true
})
}
}
}
// Allow routes to be accepted now.
s.routesReject = false
// If there is a pool size change or added accounts, solicit routes now.
if co.poolSizeChanged || len(co.accsAdded) > 0 {
s.solicitRoutes(opts.Routes, co.accsAdded)
}
s.mu.Unlock()
}
// validateClusterOpts ensures the new ClusterOpts does not change some of the
// fields that do not support reload.
func validateClusterOpts(old, new ClusterOpts) error {
if old.Host != new.Host {
return fmt.Errorf("config reload not supported for cluster host: old=%s, new=%s",
old.Host, new.Host)
}
if old.Port != new.Port {
return fmt.Errorf("config reload not supported for cluster port: old=%d, new=%d",
old.Port, new.Port)
}
// Validate Cluster.Advertise syntax
if new.Advertise != "" {
if _, _, err := parseHostPort(new.Advertise, 0); err != nil {
return fmt.Errorf("invalid Cluster.Advertise value of %s, err=%v", new.Advertise, err)
}
}
return nil
}
// diffRoutes diffs the old routes and the new routes and returns the ones that
// should be added and removed from the server.
func diffRoutes(old, new []*url.URL) (add, remove []*url.URL) {View on GitHub (pinned to 3a66a489d2)
Solutions
- Revert cluster.host to the value the server is currently using and reload
- Restart nats-server to bind the new cluster host
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server/reload.go:2783 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of nats-io/nats-server@3a66a489d2 (2026-09-02).
Data as JSON: /api/errors/b271641e9dfc920f.
Report an issue: GitHub.