{"record":{"id":"2aee380dabaab4e6","repo":"kubernetes/kops","slug":"unknown-group-type-for-group-q","errorCode":null,"errorMessage":"unknown group type for group %q","messagePattern":"unknown group type for group %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/instancegroups/rollingupdate.go","lineNumber":134,"sourceCode":"\tvar resultsMutex sync.Mutex\n\tresults := make(map[string]error)\n\n\tmasterGroups := make(map[string]*cloudinstances.CloudInstanceGroup)\n\tapiServerGroups := make(map[string]*cloudinstances.CloudInstanceGroup)\n\tnodeGroups := make(map[string]*cloudinstances.CloudInstanceGroup)\n\tbastionGroups := make(map[string]*cloudinstances.CloudInstanceGroup)\n\tfor k, group := range groups {\n\t\tswitch {\n\t\tcase group.InstanceGroup.Spec.Role.HasNode():\n\t\t\tnodeGroups[k] = group\n\t\tcase group.InstanceGroup.Spec.Role.HasAPIServer():\n\t\t\tapiServerGroups[k] = group\n\t\tcase group.InstanceGroup.Spec.Role.HasControlPlane():\n\t\t\tmasterGroups[k] = group\n\t\tcase group.InstanceGroup.Spec.Role.HasBastion():\n\t\t\tbastionGroups[k] = group\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown group type for group %q\", group.InstanceGroup.ObjectMeta.Name)\n\t\t}\n\t}\n\n\t// Upgrade bastions first; if these go down we can't see anything\n\t{\n\t\tvar wg sync.WaitGroup\n\n\t\tfor _, k := range sortGroups(bastionGroups) {\n\t\t\twg.Add(1)\n\t\t\tgo func(k string) {\n\t\t\t\tresultsMutex.Lock()\n\t\t\t\tresults[k] = fmt.Errorf(\"function panic bastions\")\n\t\t\t\tresultsMutex.Unlock()\n\n\t\t\t\tdefer wg.Done()\n\n\t\t\t\terr := c.rollingUpdateInstanceGroup(ctx, bastionGroups[k], c.BastionInterval)\n","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/instancegroups/rollingupdate.go#L116-L152","documentation":"RollingUpdate partitions all instance groups into API-server, control-plane, and bastion buckets by role; a group whose InstanceGroup.Spec.Role matches none of those falls into the default case and aborts the whole update with 'unknown group type'. Only specific roles (Master/ControlPlane, APIServer, Bastion) plus a broad default are recognized — groups with role BareMetal or a zero-valued Role hit this.","triggerScenarios":"An InstanceGroup in the cluster spec has an unset or unrecognized Spec.Role (e.g. role not set in YAML, typo, or a role only valid for other purposes), so when RunRollingUpdateCluster iterates groups the switch hits the default branch.","commonSituations":"Hand-edited InstanceGroup YAML missing the `spec.role` field; cluster specs created by older kOps versions with role values that newer code no longer buckets; copy-pasted manifests where role was accidentally deleted.","solutions":["Check the InstanceGroup: `kops get ig -o yaml` and set a valid `spec.role` (Node, Master/ControlPlane, Bastion, APIServer)","If the field is missing, re-apply after adding it: `kops replace -f ig.yaml` then re-run the rolling update","Upgrade/downgrade kOps to a version matching your cluster spec format if a version mismatch caused role parsing to fail"],"exampleFix":"// before\nkind: InstanceGroup\nmetadata:\n  name: nodes-a\nspec:\n  machineType: t3.medium\n// after\nkind: InstanceGroup\nmetadata:\n  name: nodes-a\nspec:\n  role: Node\n  machineType: t3.medium","handlingStrategy":"validation","validationCode":"for _, ig := range igs {\n    r := ig.Spec.Role\n    if !r.HasControlPlane() && !r.HasAPIServer() && !r.HasBastion() && !r.HasNode() {\n        return fmt.Errorf(\"instance group %q has invalid role %q\", ig.Name, r)\n    }\n}","typeGuard":"func roleIsKnown(r api.InstanceGroupRole) bool {\n    switch r {\n    case api.InstanceGroupRoleControlPlane, api.InstanceGroupRoleAPIServer,\n        api.InstanceGroupRoleBastion, api.InstanceGroupRoleNode:\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Always set spec.role in InstanceGroup manifests","Validate specs with kops get ig / kops replace before rolling","Keep kOps CLI version aligned with the cluster spec version"],"tags":["configuration","instance-group","role","rolling-update"],"backgroundTag":"invalid-instance-group-role","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"}