{"record":{"id":"2bcb4bec9398ba6f","repo":"kubernetes/kops","slug":"could-not-determine-etcd-cluster-type-for-volume","errorCode":null,"errorMessage":"could not determine etcd cluster type for volume: %s","messagePattern":"could not determine etcd cluster type for volume: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/do/cloud.go","lineNumber":394,"sourceCode":"\t}\n\n\tstatus := make([]kops.EtcdClusterStatus, 0, len(statusMap))\n\tfor _, v := range statusMap {\n\t\tstatus = append(status, *v)\n\t}\n\n\treturn status, nil\n}\n\nfunc (c *doCloudImplementation) getEtcdClusterSpec(volumeName string, dropletName string) (*etcd.EtcdClusterSpec, error) {\n\tvar clusterKey string\n\tswitch {\n\tcase strings.Contains(volumeName, \"etcd-main\"):\n\t\tclusterKey = \"main\"\n\tcase strings.Contains(volumeName, \"etcd-events\"):\n\t\tclusterKey = \"events\"\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"could not determine etcd cluster type for volume: %s\", volumeName)\n\t}\n\n\treturn &etcd.EtcdClusterSpec{\n\t\tClusterKey: clusterKey,\n\t\tNodeName:   dropletName,\n\t\tNodeNames:  []string{dropletName},\n\t}, nil\n}\n\nfunc getCloudGroups(c *doCloudImplementation, cluster *kops.Cluster, instancegroups []*kops.InstanceGroup, warnUnmatched bool, nodes []v1.Node) (map[string]*cloudinstances.CloudInstanceGroup, error) {\n\tnodeMap := cloudinstances.GetNodeMap(nodes, cluster)\n\n\tgroups := make(map[string]*cloudinstances.CloudInstanceGroup)\n\tinstanceGroups, err := findInstanceGroups(c, cluster.ObjectMeta.Name)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to find autoscale groups: %v\", err)\n\t}\n","sourceCodeStart":376,"sourceCodeEnd":412,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/do/cloud.go#L376-L412","documentation":"getEtcdClusterSpec classifies an etcd volume purely by substring matching its name: 'etcd-main' maps to the main cluster, 'etcd-events' to the events cluster. If the volume name contains neither, the etcd cluster type cannot be determined and it returns this error, which the caller wraps with tag/volume context.","triggerScenarios":"A volume whose tags claim it belongs to this kOps cluster (has cluster + index tags) but whose Name has no 'etcd-main'/'etcd-events' substring — renamed volumes, foreign volumes accidentally tagged, or volumes created with non-kOps naming.","commonSituations":"Manual volume renaming during recovery/DR; volumes from an unrelated system that inherited the cluster tag; introducing a third etcd type that this kOps version doesn't recognize.","solutions":["Rename the volume so its name contains 'etcd-main' or 'etcd-events' as appropriate.","Remove the kOps cluster tags from volumes that are not actually kOps etcd volumes.","Confirm only expected etcd volumes carry the cluster tag: `doctl compute volume list` and audit names/tags.","If a new etcd cluster type is legitimately in use, upgrade kOps to a version that recognizes it."],"exampleFix":"// before\nvolume.Name = \"mycluster-data-1\"\n// after\nvolume.Name = \"mycluster-dyn-etcd-main-1\"  // must contain etcd-main or etcd-events","handlingStrategy":"validation","validationCode":"if !strings.Contains(volumeName, \"etcd-main\") && !strings.Contains(volumeName, \"etcd-events\") {\n    return fmt.Errorf(\"volume %q will not be recognized as kOps etcd\", volumeName)\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"could not determine etcd cluster type\") {\n    return renameOrUntagVolume(volume) // fix name or remove cluster tags\n}","preventionTips":["Use kOps to create/etcd volumes so naming conventions hold.","Audit volume names/tags after manual recovery operations.","Remove kOps cluster tags from volumes not managed by kOps.","Upgrade kOps if a new etcd cluster type must be recognized."],"tags":["digitalocean","storage","etcd","naming-convention"],"backgroundTag":"unrecognized-resource-name","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"}