{"record":{"id":"ae80999ef63884e1","repo":"kubernetes/kops","slug":"failed-to-get-all-volumes-by-region-from-s-v","errorCode":null,"errorMessage":"failed to get all volumes by region from %s: %v","messagePattern":"failed to get all volumes by region from (.+?): (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/do/cloud.go","lineNumber":327,"sourceCode":"// FindClusterStatus discovers the status of the cluster, by looking for the tagged etcd volumes\nfunc (c *doCloudImplementation) FindClusterStatus(cluster *kops.Cluster) (*kops.ClusterStatus, error) {\n\tetcdStatus, err := findEtcdStatus(c, cluster)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstatus := &kops.ClusterStatus{\n\t\tEtcdClusters: etcdStatus,\n\t}\n\tklog.V(2).Infof(\"Cluster status (from cloud): %v\", fi.DebugAsJsonString(status))\n\treturn status, nil\n}\n\n// findEtcdStatus discovers the status of etcd, by looking for the tagged etcd volumes\nfunc findEtcdStatus(c *doCloudImplementation, cluster *kops.Cluster) ([]kops.EtcdClusterStatus, error) {\n\tstatusMap := make(map[string]*kops.EtcdClusterStatus)\n\tvolumes, err := c.GetAllVolumesByRegion()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get all volumes by region from %s: %v\", c.Region(), err)\n\t}\n\n\tfor _, volume := range volumes {\n\t\tvolumeID := volume.ID\n\n\t\tetcdClusterName := \"\"\n\t\tvar etcdClusterSpec *etcd.EtcdClusterSpec\n\n\t\tfor _, myTag := range volume.Tags {\n\t\t\tklog.V(8).Infof(\"findEtcdStatus status (from cloud): checking if volume with tag %q belongs to cluster\", myTag)\n\t\t\t// check if volume belongs to this cluster.\n\t\t\t// tag will be in the format \"KubernetesCluster:dev5-k8s-local\" (where clusterName is dev5.k8s.local)\n\t\t\tclusterName := strings.ReplaceAll(cluster.Name, \".\", \"-\")\n\t\t\tif strings.Contains(myTag, fmt.Sprintf(\"%s:%s\", TagKubernetesClusterNamePrefix, clusterName)) {\n\t\t\t\tklog.V(10).Infof(\"findEtcdStatus cluster comparison matched for tag: %v\", myTag)\n\t\t\t\t// this volume belongs to our cluster, add this to our etcdClusterSpec.\n\t\t\t\t// loop through the tags again and\n\t\t\t\tfor _, volumeTag := range volume.Tags {","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/do/cloud.go#L309-L345","documentation":"findEtcdStatus discovers etcd cluster health by listing all block-storage volumes in the region (GetAllVolumesByRegion) and reading their kOps tags. If that listing fails, the error is wrapped with the region for context. Without the volume list, etcd cluster status cannot be determined and FindClusterStatus fails.","triggerScenarios":"GetAllVolumesByRegion() (godo Storage.List, region-paginated) returns an error: API auth failure, rate limiting, network error, or an invalid/unsupported region slug.","commonSituations":"Wrong region configured for the cluster; DO API token lacking read scope on volumes; transient API outages; rate limits when many volumes/pages must be listed.","solutions":["Check the wrapped error for 401/403 (fix token scopes) vs 429 (back off and retry).","Verify the cluster's DO region is correct and volumes exist there (`doctl compute volume list --region <slug>`).","Confirm network egress to the DO API from the kOps host.","Re-run `kops get cluster --full` / status command after transient failures — the read path is safe to retry."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"_, _, err := client.Storage.ListVolumes(context.TODO(), region, nil)\nif err != nil { return fmt.Errorf(\"cannot list volumes in %s: %w\", region, err) }","typeGuard":null,"tryCatchPattern":"status, err := cloud.FindClusterStatus(cluster)\nif err != nil {\n    if isRateLimited(err) { backoff(); retry() }\n    return fmt.Errorf(\"etcd status unavailable: %w\", err)\n}","preventionTips":["Validate the region slug against actual DO volumes before status queries.","Grant the token read scope on block storage.","Back off on 429 when many volumes/pages are listed.","Retry transient failures; volume listing is read-only and safe."],"tags":["digitalocean","storage","etcd","api"],"backgroundTag":"cloud-api-list-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}