{"record":{"id":"205e00e59852bf9d","repo":"nats-io/nats-server","slug":"cluster-v","errorCode":null,"errorMessage":"cluster: %v","messagePattern":"cluster: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/server.go","lineNumber":1122,"sourceCode":"}\n\nfunc validateCluster(o *Options) error {\n\tif o.Cluster.Name != _EMPTY_ && strings.Contains(o.Cluster.Name, \" \") {\n\t\treturn ErrClusterNameHasSpaces\n\t}\n\tif p := o.Cluster.Permissions; p != nil {\n\t\tperms := &Permissions{Publish: p.Import, Subscribe: p.Export}\n\t\tif err := checkClusterPermissionSubjects(perms); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif o.Cluster.Compression.Mode != _EMPTY_ {\n\t\tif err := validateAndNormalizeCompressionOption(&o.Cluster.Compression, CompressionS2Fast); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := validatePinnedCerts(o.Cluster.TLSPinnedCerts); err != nil {\n\t\treturn fmt.Errorf(\"cluster: %v\", err)\n\t}\n\t// Check that cluster name if defined matches any gateway name.\n\t// Note that we have already verified that the gateway name does not have spaces.\n\tif o.Gateway.Name != _EMPTY_ && o.Gateway.Name != o.Cluster.Name {\n\t\tif o.Cluster.Name != _EMPTY_ {\n\t\t\treturn ErrClusterNameConfigConflict\n\t\t}\n\t\t// Set this here so we do not consider it dynamic.\n\t\to.Cluster.Name = o.Gateway.Name\n\t}\n\tclusterName := o.Cluster.Name\n\tif clusterName == _EMPTY_ && len(o.LeafNode.Remotes) > 0 && o.Cluster.Port == 0 {\n\t\tclusterName = o.ServerName\n\t}\n\tif clusterName == leafNoOriginCluster {\n\t\treturn ErrClusterNameReserved\n\t}\n\tif l := len(o.Cluster.PinnedAccounts); l > 0 {","sourceCodeStart":1104,"sourceCodeEnd":1140,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/server.go#L1104-L1140","documentation":"Generic cluster-validation wrapper in validateCluster: a subordinate check (cluster permissions subjects, compression validation, or pinned TLS certs) failed and its error is wrapped with the 'cluster:' prefix to attribute it to the cluster configuration block. The underlying %v error names the real problem; inspect it rather than this prefix.","triggerScenarios":"Thrown at server/server.go:1122 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped error text to identify the failing cluster sub-check","Fix the offending cluster config section (permissions, compression, tls.pinned_certs)","Re-run nats-server -t (or --config with dry check) to re-validate the config"],"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-08T10:18:20.063Z"}