{"record":{"id":"9020403965bd3d81","repo":"temporalio/temporal","slug":"master-cluster-is-not-specified-in-cluster-info","errorCode":null,"errorMessage":"Master cluster is not specified in cluster info","messagePattern":"Master cluster is not specified in cluster info","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"common/cluster/metadata.go","lineNumber":164,"sourceCode":"\t\tpanic(\"Empty cluster information\")\n\t} else if len(masterClusterName) == 0 {\n\t\tpanic(\"Master cluster name is empty\")\n\t} else if len(currentClusterName) == 0 {\n\t\tpanic(\"Current cluster name is empty\")\n\t} else if failoverVersionIncrement == 0 || failoverVersionIncrement > math.MaxInt32 {\n\t\tpanic(\"Version increment <= 0 or > 2147483647\")\n\t}\n\n\tversionToClusterName, err := updateVersionToClusterName(clusterInfo, failoverVersionIncrement)\n\tif err != nil {\n\t\t// nolint:forbidigo // matches the other startup-config panics in this constructor\n\t\tpanic(err.Error())\n\t}\n\tif _, ok := clusterInfo[currentClusterName]; !ok {\n\t\tpanic(\"Current cluster is not specified in cluster info\")\n\t}\n\tif _, ok := clusterInfo[masterClusterName]; !ok {\n\t\tpanic(\"Master cluster is not specified in cluster info\")\n\t}\n\n\tcopyClusterInfo := make(map[string]ClusterInformation)\n\tmaps.Copy(copyClusterInfo, clusterInfo)\n\tif refreshDuration == nil {\n\t\trefreshDuration = dynamicconfig.GetDurationPropertyFn(refreshInterval)\n\t}\n\treturn &metadataImpl{\n\t\tstatus:                   common.DaemonStatusInitialized,\n\t\tenableGlobalNamespace:    enableGlobalNamespace,\n\t\tfailoverVersionIncrement: failoverVersionIncrement,\n\t\tmasterClusterName:        masterClusterName,\n\t\tcurrentClusterName:       currentClusterName,\n\t\tclusterInfo:              copyClusterInfo,\n\t\tversionToClusterName:     versionToClusterName,\n\t\tclusterChangeCallback:    make(map[any]CallbackFn),\n\t\tclusterMetadataStore:     clusterMetadataStore,\n\t\tlogger:                   logger,","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/common/cluster/metadata.go#L146-L182","documentation":"NewMetadata requires that masterClusterName also be a key in the clusterInfo map. The master (home) cluster must be present because cross-cluster failover and version computations reference its initial failover version. A missing master entry panics at construction time.","triggerScenarios":"cluster.NewMetadata(clusterInfo, \"masterCluster\", currentClusterName, ...) where \"masterCluster\" is not a key in clusterInfo.","commonSituations":"Configuring a non-primary (remote) Temporal datacenter whose clusterMetadata omits the primary cluster entry; stale config after renaming the master cluster.","solutions":["Add the master cluster to clusterInfo with the correct InitialFailoverVersion","Ensure masterClusterName exactly matches one of the clusterInfo keys","Keep the primary cluster's entry identical across all datacenters' configs"],"exampleFix":"// before\nmd := cluster.NewMetadata(map[string]cluster.ClusterInformation{}, \"master\", \"current\", 1, nil, nil)\n// after\nclusterInfo := map[string]cluster.ClusterInformation{\"master\": {InitialFailoverVersion: 0, IsEnabled: true}}\nmd := cluster.NewMetadata(clusterInfo, \"master\", \"current\", 1, nil, nil)","handlingStrategy":"validation","validationCode":"if _, ok := clusterInfo[masterClusterName]; !ok {\n  return fmt.Errorf(\"master cluster %q missing from clusterInfo\", masterClusterName)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure remote datacenter configs include the primary (master) cluster entry","Validate masterClusterName against clusterInfo keys before startup","Version-control cluster configs together so master entries stay in sync"],"tags":["go","panic","configuration","multi-cluster"],"backgroundTag":"cluster-not-in-config","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}