{"record":{"id":"56bf8f3ae251d09d","repo":"kubernetes/kops","slug":"etcdmembers-found-with-same-name-q-in-etcd-cluste","errorCode":null,"errorMessage":"EtcdMembers found with same name %q in etcd-cluster %q","messagePattern":"EtcdMembers found with same name %q in etcd-cluster %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/populate_cluster_spec.go","lineNumber":140,"sourceCode":"\t\t\t\t\treturn fmt.Errorf(\"EtcdClusters #%d did not specify a Name\", i)\n\t\t\t\t}\n\n\t\t\t\tfor i, m := range etcd.Members {\n\t\t\t\t\tif m.Name == \"\" {\n\t\t\t\t\t\treturn fmt.Errorf(\"EtcdMember #%d of etcd-cluster %s did not specify a Name\", i, etcd.Name)\n\t\t\t\t\t}\n\n\t\t\t\t\tif fi.ValueOf(m.InstanceGroup) == \"\" {\n\t\t\t\t\t\treturn fmt.Errorf(\"EtcdMember %s:%s did not specify a InstanceGroup\", etcd.Name, m.Name)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tetcdInstanceGroups := make(map[string]kopsapi.EtcdMemberSpec)\n\t\t\t\tetcdNames := make(map[string]kopsapi.EtcdMemberSpec)\n\n\t\t\t\tfor _, m := range etcd.Members {\n\t\t\t\t\tif _, ok := etcdNames[m.Name]; ok {\n\t\t\t\t\t\treturn fmt.Errorf(\"EtcdMembers found with same name %q in etcd-cluster %q\", m.Name, etcd.Name)\n\t\t\t\t\t}\n\n\t\t\t\t\tinstanceGroupName := fi.ValueOf(m.InstanceGroup)\n\n\t\t\t\t\tif _, ok := etcdInstanceGroups[instanceGroupName]; ok {\n\t\t\t\t\t\tklog.Warningf(\"EtcdMembers are in the same InstanceGroup %q in etcd-cluster %q (fault-tolerance may be reduced)\", instanceGroupName, etcd.Name)\n\t\t\t\t\t}\n\n\t\t\t\t\t//if clusterSubnets[zone] == nil {\n\t\t\t\t\t//\treturn fmt.Errorf(\"EtcdMembers for %q is configured in zone %q, but that is not configured at the k8s-cluster level\", etcd.Name, m.Zone)\n\t\t\t\t\t//}\n\t\t\t\t\tetcdNames[m.Name] = m\n\t\t\t\t\tetcdInstanceGroups[instanceGroupName] = m\n\t\t\t\t}\n\n\t\t\t\tif (len(etcdNames) % 2) == 0 {\n\t\t\t\t\t// Not technically a requirement, but doesn't really make sense to allow\n\t\t\t\t\treturn fmt.Errorf(\"there should be an odd number of control-plane-zones, for etcd's quorum.  Hint: Use --zones and --control-plane-zones to declare worker and control plane node zones separately\")","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/populate_cluster_spec.go#L122-L158","documentation":"Within one etcd cluster, member names must be unique; run() builds a map keyed on m.Name and throws this error when a duplicate is found. Duplicate names would produce ambiguous DNS/etcd member identities, so cluster population is rejected.","triggerScenarios":"PopulateClusterSpec with an EtcdClusters entry where two members share the same Name value — e.g. copy-pasting a member block without changing the name.","commonSituations":"Copy-pasting etcd member entries in cluster YAML and forgetting to rename; templating loops that reuse a fixed name; merging specs from different clusters that both use default member names.","solutions":["Make each member name unique within its etcd cluster (e.g. a, b, c keyed by zone).","Run `kops get cluster -oyaml` and check spec.etcdClusters[].members[] for repeated `name:` values.","If member names are generated, key them on the instance group or zone so they can't collide."],"exampleFix":"# before\nmembers:\n- name: a\n  instanceGroup: control-plane-1a\n- name: a\n  instanceGroup: control-plane-1b\n# after\nmembers:\n- name: a\n  instanceGroup: control-plane-1a\n- name: b\n  instanceGroup: control-plane-1b","handlingStrategy":"validation","validationCode":"seen := map[string]bool{}\nfor _, etcd := range cluster.Spec.EtcdClusters {\n\tfor _, m := range etcd.Members {\n\t\tif seen[m.Name] {\n\t\t\treturn fmt.Errorf(\"duplicate etcd member name %q in %q\", m.Name, etcd.Name)\n\t\t}\n\t\tseen[m.Name] = true\n\t}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never copy-paste etcd member blocks without renaming","Key member names on zone or instance group so they are naturally unique","Lint cluster YAML for duplicate keys before applying"],"tags":["etcd","cluster-spec","duplicate"],"backgroundTag":"duplicate-identifier","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}