{"record":{"id":"777aeaf899a6c0c1","repo":"kubernetes/kops","slug":"failed-to-build-cloud-instance-group-for-instance","errorCode":null,"errorMessage":"failed to build cloud instance group for instance group %q: %w","messagePattern":"failed to build cloud instance group for instance group %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/hetzner/cloud.go","lineNumber":336,"sourceCode":"\tfor name, serverGroup := range serverGroups {\n\t\tvar instanceGroup *kops.InstanceGroup\n\t\tfor _, ig := range instanceGroups {\n\t\t\tgroupName := fmt.Sprintf(\"%s-%s\", cluster.Name, ig.Name)\n\t\t\tif name == groupName {\n\t\t\t\tinstanceGroup = ig\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif instanceGroup == nil {\n\t\t\tif warnUnmatched {\n\t\t\t\tklog.Warningf(\"Server group %q has no corresponding instance group\", name)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tcloudInstanceGroups[instanceGroup.Name], err = buildCloudInstanceGroup(instanceGroup, serverGroup, nodeMap)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to build cloud instance group for instance group %q: %w\", instanceGroup.Name, err)\n\t\t}\n\t}\n\n\treturn cloudInstanceGroups, nil\n}\n\n// findServerGroups finds all server groups belonging to the cluster\nfunc findServerGroups(c *hetznerCloudImplementation, clusterName string) (map[string][]*hcloud.Server, error) {\n\tservers, err := c.GetServers(clusterName)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to list servers: %w\", err)\n\t}\n\n\tserverGroups := make(map[string][]*hcloud.Server)\n\tfor _, server := range servers {\n\t\tinstanceGroupNameLabel, ok := server.Labels[TagKubernetesInstanceGroup]\n\t\tif !ok {\n\t\t\tklog.Warningf(\"failed to find instance group name for server %s(%d)\", server.Name, server.ID)","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/hetzner/cloud.go#L318-L354","documentation":"GetCloudGroups calls buildCloudInstanceGroup for each matched server group; this error is thrown when that builder fails, meaning servers could not be reconciled into a CloudInstanceGroup (e.g. inconsistent member data).","triggerScenarios":"buildCloudInstanceGroup returning an error while mapping servers/nodes, typically when a server in the group cannot be converted to a CloudInstance (bad or missing member metadata).","commonSituations":"Cluster state drift: servers with duplicated or empty instance-group labels, nodes deregistered or renamed so the nodeMap no longer matches server names, or partially deleted instances after an interrupted rolling update.","solutions":["Inspect the wrapped buildCloudInstanceGroup error for the offending server/node","Reconcile drift: kops rolling-update --cloud-labels or recreate mismatched instances","Verify node names in the cluster match Hetzner server names used in nodeMap","Run kops validate to identify and remove orphaned/mislabelled servers"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before GetCloudGroups, verify each server maps to a known node or instance group\nfor _, s := range servers {\n\tif _, ok := nodeMap[s.Name]; !ok {\n\t\tklog.Warningf(\"server %q has no matching node\", s.Name)\n\t}\n}","typeGuard":"func groupMatches(name string, clusterName string, igs []*kops.InstanceGroup) *kops.InstanceGroup {\n\tfor _, ig := range igs {\n\t\tif name == clusterName+\"-\"+ig.Name {\n\t\t\treturn ig\n\t\t}\n\t}\n\treturn nil\n}","tryCatchPattern":"groups, err := cloud.GetCloudGroups(cluster, igs, warnUnmatched, nodes)\nif err != nil {\n\treturn fmt.Errorf(\"get cloud groups: %w\", err)\n}\nfor name, g := range groups {\n\tif g == nil || len(g.Members) == 0 {\n\t\tklog.Warningf(\"group %q built with no members; check state drift\", name)\n\t}\n}","preventionTips":["Run kops validate regularly to catch label/node drift","Keep Hetzner server names in sync with Kubernetes node names","Avoid manual console edits to cluster-managed servers","Complete interrupted rolling updates before further operations"],"tags":["hetzner","groups","instances","state-drift"],"backgroundTag":"cloud-instance-group-build-failed","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"}