{"record":{"id":"1df695fec2864233","repo":"nats-io/nats-server","slug":"config-reload-not-supported-for-cluster-port-old","errorCode":null,"errorMessage":"config reload not supported for cluster port: old=%d, new=%d","messagePattern":"config reload not supported for cluster port: old=(.+?), new=(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/reload.go","lineNumber":2787,"sourceCode":"\t}\n\t// Allow routes to be accepted now.\n\ts.routesReject = false\n\t// If there is a pool size change or added accounts, solicit routes now.\n\tif co.poolSizeChanged || len(co.accsAdded) > 0 {\n\t\ts.solicitRoutes(opts.Routes, co.accsAdded)\n\t}\n\ts.mu.Unlock()\n}\n\n// validateClusterOpts ensures the new ClusterOpts does not change some of the\n// fields that do not support reload.\nfunc validateClusterOpts(old, new ClusterOpts) error {\n\tif old.Host != new.Host {\n\t\treturn fmt.Errorf(\"config reload not supported for cluster host: old=%s, new=%s\",\n\t\t\told.Host, new.Host)\n\t}\n\tif old.Port != new.Port {\n\t\treturn fmt.Errorf(\"config reload not supported for cluster port: old=%d, new=%d\",\n\t\t\told.Port, new.Port)\n\t}\n\t// Validate Cluster.Advertise syntax\n\tif new.Advertise != \"\" {\n\t\tif _, _, err := parseHostPort(new.Advertise, 0); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid Cluster.Advertise value of %s, err=%v\", new.Advertise, err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// diffRoutes diffs the old routes and the new routes and returns the ones that\n// should be added and removed from the server.\nfunc diffRoutes(old, new []*url.URL) (add, remove []*url.URL) {\n\t// Find routes to remove.\nremoveLoop:\n\tfor _, oldRoute := range old {\n\t\tfor _, newRoute := range new {","sourceCodeStart":2769,"sourceCodeEnd":2805,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/reload.go#L2769-L2805","documentation":"validateClusterOpts blocks a config reload that changes cluster.port: the cluster route listener port is fixed at startup, so any diff between old and new port aborts the reload with both values shown. The server continues listening on the old port.","triggerScenarios":"Thrown at server/reload.go:2787 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep cluster.port unchanged across reloads; revert the config edit","Restart the server to apply a new cluster port"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}