{"record":{"id":"eb3d1fce60c4d4c0","repo":"kubernetes/kops","slug":"building-instance-group-model-w","errorCode":null,"errorMessage":"building instance group model: %w","messagePattern":"building instance group model: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/nodemodel/nodeupconfigbuilder.go","lineNumber":195,"sourceCode":"\tcluster := n.cluster\n\n\tif ig == nil {\n\t\treturn nil, nil, fmt.Errorf(\"instanceGroup cannot be nil\")\n\t}\n\n\trole := ig.Spec.Role\n\tif role == \"\" {\n\t\treturn nil, nil, fmt.Errorf(\"cannot determine role for instance group: %v\", ig.ObjectMeta.Name)\n\t}\n\n\tisMaster := role.HasControlPlane()\n\thasAPIServer := isMaster || role.HasAPIServer()\n\n\tconfig, bootConfig := nodeup.NewConfig(cluster, ig)\n\n\tigModel, err := kopsmodel.ForInstanceGroup(cluster, ig)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"building instance group model: %w\", err)\n\t}\n\n\tif !hasAPIServer && n.assetBuilder.KubeletSupportedVersion != \"\" {\n\t\t// Set kubernetes version to avoid spurious rolling-update\n\t\tconfig.KubernetesVersion = n.assetBuilder.KubeletSupportedVersion\n\n\t\t// TODO: Rename KubernetesVersion to ControlPlaneVersion\n\n\t\tif err := igModel.ForceKubernetesVersion(n.assetBuilder.KubeletSupportedVersion); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t}\n\n\tkubernetesAssets, err := BuildKubernetesFileAssets(igModel, n.assetBuilder)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tconfig.Assets = make(map[architectures.Architecture][]string)","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/nodemodel/nodeupconfigbuilder.go#L177-L213","documentation":"BuildConfig calls kopsmodel.ForInstanceGroup to build the instance-group model used for nodeup config. If that model construction fails, the error is wrapped as 'building instance group model'. The cause typically comes from validation or unsupported fields in the IG spec.","triggerScenarios":"kopsmodel.ForInstanceGroup(cluster, ig) returns an error while building nodeup config — e.g. invalid or unsupported instance group spec fields.","commonSituations":"Incompatible combination of cluster spec and IG spec (new feature flags with old kOps); invalid machine type/architecture fields; corrupted or hand-edited IG spec.","solutions":["Read the wrapped cause (%w) for the specific model failure and fix the offending IG field","Validate the instance group with kops tooling (kops replace/validate -f) before bootstrapping","Align kOps versions between cluster management and nodeup binary"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"igModel, err := kopsmodel.ForInstanceGroup(cluster, ig)\nif err != nil {\n    return fmt.Errorf(\"building instance group model: %w\", err) // inspect cause, fix IG field\n}","preventionTips":["Keep kOps CLI and nodeup versions aligned","Validate IG specs with kops replace -f before bootstrap","Avoid hand-editing generated IG spec fields","Test IG spec changes on a dev cluster first"],"tags":["instancegroup","nodeup","model"],"backgroundTag":"instance-group-model-build-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"}