{"record":{"id":"f911b424c7f2b5ae","repo":"kubernetes/kops","slug":"instance-group-q-already-exists","errorCode":null,"errorMessage":"instance group %q already exists","messagePattern":"instance group %q already exists","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/create_instancegroup.go","lineNumber":194,"sourceCode":"\tif err != nil {\n\t\treturn err\n\t}\n\n\tchannel, err := cloudup.ChannelForCluster(clientset.VFSContext(), cluster)\n\tif err != nil {\n\t\tklog.Warningf(\"%v\", err)\n\t}\n\n\texisting, err := clientset.InstanceGroupsFor(cluster).Get(ctx, options.InstanceGroupName, metav1.GetOptions{})\n\tif err != nil {\n\t\t// We expect a NotFound error when creating the instance group\n\t\tif !errors.IsNotFound(err) {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif existing != nil {\n\t\treturn fmt.Errorf(\"instance group %q already exists\", options.InstanceGroupName)\n\t}\n\n\t// Populate some defaults\n\tig := &kopsapi.InstanceGroup{}\n\tig.ObjectMeta.Name = options.InstanceGroupName\n\n\trole, ok := kopsapi.ParseInstanceGroupRole(options.Role, true)\n\tif !ok {\n\t\treturn fmt.Errorf(\"unknown role %q\", options.Role)\n\t}\n\tig.Spec.Role = role\n\n\tig.Spec.Subnets = options.Subnets\n\n\tig.Spec.Zones = options.Zones\n\n\tcloud, err := cloudup.BuildCloud(cluster)\n\tif err != nil {","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/create_instancegroup.go#L176-L212","documentation":"RunCreateInstanceGroup fetched the named instance group and got an existing object back (the Get did not return NotFound). Creating an IG with a duplicate name is rejected to avoid overwriting existing configuration.","triggerScenarios":"Thrown at cmd/kops/create_instancegroup.go:194 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a different instance group name","Edit the existing instance group instead: kops edit ig <name>","Delete the existing IG first if replacement is intended"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}